Wooble
Back to SAFIYA's profile
Verified on Wooble

EXPIRY ALERT ' 26

SAFIYA BEGAM KEXPIRY ALERT ' 26

Overview

How to Run Locally Prerequisites Node.js v18+ A MongoDB database — local mongod, or a free MongoDB Atlas cluster A Gmail account + App Password (for email alerts/import — optional, app works without it) Step 1 — Install everything npm run install:all Step 2 — Configure environment Copy server/.env.example → server/.env (or edit the existing .env) and fill in: MONGODB_URI=your-connection-string EMAIL_USER=youraddress@gmail.com EMAIL_APP_PASSWORD=your16charapppassword EMAIL_ALERTS_ENABLED=true For email import, also enable IMAP in Gmail: Settings → Forwarding and POP/IMAP → Enable IMAP. Step 3 — Seed demo data (optional but recommended) npm run seed Step 4 — Run npm run dev Backend → http://localhost:5000 Frontend → http://localhost:3000 ☁️ Deployment Deployed as two separate services: Backend (Express + Socket.IO) → Render, root directory server Frontend (React) → Vercel, root directory client Database → MongoDB Atlas The frontend reads two build-time environment variables so it can be deployed independently of the backend's domain: REACT_APP_API_URL=https://your-backend.onrender.com/api REACT_APP_SOCKET_URL=https://your-backend.onrender.com The backend's CLIENT_URL env var must point back at the deployed frontend domain, for CORS. Note: on Render's free tier, outbound SMTP/IMAP connections may be restricted, so email alerts/import are most reliable when run locally or on a paid tier. 🔌 API Reference Method Endpoint Description GET /api/records List records (?status=, ?category=, ?search=) GET /api/records/stats Dashboard stats + upcoming expiries POST /api/records Create record PUT /api/records/:id Update record (triggers reclassification) DELETE /api/records/:id Archive record (soft delete) POST /api/records/recalculate/all Manually recalculate all statuses POST /api/records/:id/send-alert Manually (re)send the expiry alert email POST /api/records/:id/attachment Upload/replace a record's document GET /api/records/:id/attachment Download the attached document DELETE /api/records/:id/attachment Remove the attached document GET /api/activity Recent activity log entries GET /api/email-import/status Whether email import is configured POST /api/email-import/scan Scan inbox, auto-classify, and create records Socket.IO Events Event Direction Payload record:created / record:updated Server → Client { record, stats, origin } record:deleted Server → Client { recordId, stats, origin } records:recalculated Server → Client { stats } activity:new Server → Client { entry } presence:update Server → Client { count } origin carries the originating client's socket id, so a client can tell "my own action" apart from "someone else's" and only toast for the latter.

Gallery

4