Deploying PsycheIT to production involves building the React frontend into static assets, running the Express backend as a managed process, and hardening several default settings that are intentionally left simple for local development. Work through the checklist below before exposing the application to real users.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Nandini-13/PsycheIT/llms.txt
Use this file to discover all available pages before exploring further.
Pre-Deployment Checklist
Replace the hardcoded JWT secret
The server currently signs tokens with the literal string Set the output as
'secretKey'. Generate a cryptographically strong replacement and store it as an environment variable:JWT_SECRET in your server environment and update server.js to use process.env.JWT_SECRET instead of the hardcoded value.Replace flat-file user storage with a database
User records are written to
users.json using synchronous fs calls, which are not safe for concurrent requests and provide no durability guarantees. Before going live, migrate to a proper database — MongoDB, PostgreSQL, and SQLite are all reasonable choices for an application at this scale.Restrict CORS to your production domain
The backend currently mounts
cors() with no options, which allows requests from any origin. Lock this down to your frontend domain:Update hardcoded backend URLs in the frontend
The chatbot page references the backend via the hardcoded string
http://localhost:5000. Before building for production, replace every occurrence of this string in frontend/src/ with your production API base URL (e.g. https://api.your-domain.com).Building the Frontend
The Vite build command compiles, tree-shakes, and minifies the React application into a directory of static files:dist/ directory contains an index.html entry point and hashed asset files. Because all routing is handled client-side by React Router, you must configure your host to serve index.html for every path (the try_files $uri /index.html pattern in the Nginx example below handles this).
The dist/ directory can be deployed to any static hosting service or CDN:
- Netlify / Vercel — drag-and-drop or Git-connected deployments; both detect Vite automatically.
- GitHub Pages — push
dist/to agh-pagesbranch. - Nginx / Apache — copy
dist/to your web root and configure a catch-all rewrite rule. - Any object storage CDN (AWS S3 + CloudFront, Cloudflare R2, etc.) — upload
dist/and enable static website hosting.
Running the Backend
The Express server is a plain Node.js process with no built-in clustering or process supervision. For production, wrap it in a process manager so it restarts automatically on crash and survives server reboots. Using PM2 (recommended):server/ecosystem.config.cjs file:
NODE_ENV=production — Express 5 enables several performance and security optimisations in this mode.
Nginx Reverse Proxy
Place Nginx in front of both the static frontend assets and the Express API. This lets you serve everything from a single domain, handle TLS termination in one place, and keep the Node.js port unexposed to the internet.dist/ contents in /var/www/psycheit/dist, reload Nginx:
Calendly Integration
The counselor booking feature uses Calendly URLs embedded in
frontend/src/bookSession/booking.jsx. Two of the three counselors (nandini-gangadharan and meenal-singh) have real, active Calendly links. The third entry (nidhi-pathak) uses a placeholder URL (https://calendly.com/your-username/nidhi-pathak) that must be replaced with a real Calendly link before the booking feature is complete. No backend configuration is required — the integration is entirely client-side.