Skip to content

syncing admin panel branch - #34

Merged
laladwesh merged 22 commits into
admin-panelfrom
main
Jan 19, 2026
Merged

laladwesh merged 22 commits into
admin-panelfrom
main

Conversation

@laladwesh

@laladwesh laladwesh commented Jan 19, 2026 •

Copy link
Copy Markdown
Collaborator

CodeAnt-AI Description

Add health endpoint, make export/preview timestamps use IST, and improve production container behavior

What Changed

  • New GET /health endpoint returns service status, uptime, timestamp, and version for easy monitoring.
  • All displayed and exported timestamps (table, export files, export preview) are converted to Indian Standard Time (IST) ISO strings so users and downloads show local IST times instead of UTC.
  • Production container command increased Node memory and Docker Compose now restarts the service automatically; this reduces crashes due to memory limits and ensures the service is restarted on failure.
  • Unexpected remote-user lookup errors are logged before being converted to internal errors, improving diagnosability.

Impact

✅ Health endpoint for uptime and monitoring
✅ Exports and previews show IST timestamps
✅ Automatic container restarts in production

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

venkylm10 and others added 22 commits April 23, 2025 17:59
Merge pull request #19 from swciitg/admin-panel

Admin panel
Admin panel updates for some bugs
fixes routing and all in new admin panel
redirection fixed and extra routes removed
Implement health check endpoint
@codeant-ai

codeant-ai Bot commented Jan 19, 2026

Copy link
Copy Markdown

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@laladwesh
laladwesh merged commit e49ae76 into admin-panel Jan 19, 2026
1 check passed
@codeant-ai

codeant-ai Bot commented Jan 19, 2026

Copy link
Copy Markdown

Sequence Diagram

This PR adds a /health endpoint and changes entry export/preview responses to convert timestamps to IST before returning/exporting. The diagram shows the health check fast path and the core export/preview flow (DB read -> convert times -> respond).

sequenceDiagram
    participant Client
    participant API
    participant Backend
    participant Database

    Client->>API: GET /health
    API-->>Client: 200 OK (status, uptime, version)

    Client->>API: POST /entries/export-preview (filter/page)
    API->>Database: Query entries (filter, sort, paginate)
    Database-->>Backend: Raw entry documents (ISO timestamps)
    Backend->>Backend: Convert timestamps to IST (toISTISOString)
    Backend-->>API: Prepared rows (IST times / XLSX buffer)
    API-->>Client: 200 OK (JSON preview or XLSX file)
Loading

Generated by CodeAnt AI

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Jan 19, 2026
@codeant-ai

codeant-ai Bot commented Jan 19, 2026

Copy link
Copy Markdown

Nitpicks 🔍

🔒 No security issues identified
⚡ Recommended areas for review

  • Container runtime privileges
    The Dockerfile does not create or switch to a non-root user. Running Node as root inside the container is a security concern; consider creating a non-root user and setting appropriate ownership of application files.

  • Sensitive logging
    The code logs the full error object and response data to stdout. That can leak sensitive information (tokens, PII, internal error details) to logs and should be replaced with structured/sanitized logging or removed in production.

  • Missing e.response guard
    The code assumes e.response always exists and immediately uses res.status and res.data. If e.response is undefined (network error, timeout), this will throw a runtime error and obscure the original failure.

  • Entrypoint change
    The Dockerfile replaces the previous npm run start with a direct node ... app.js invocation. This can bypass package.json start script behavior (prestart hooks, environment preparations, or build/start wrappers like ts-node, pm2, or transpiled output paths). Verify that app.js exists in the image root and that invoking it directly preserves expected runtime behavior from package.json.

  • Unprotected health route
    The health endpoint is publicly available and returns operational details. For production it is recommended to rate-limit, restrict by IP or require a token (or at least return a minimal payload) to avoid abuse and reduce info leakage.

@codeant-ai

codeant-ai Bot commented Jan 19, 2026

Copy link
Copy Markdown

CodeAnt AI finished reviewing your PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants