PsycheIT’s backend reads runtime configuration from environment variables. Out of the box, the server ships with a safe default for local development — but that default is not suitable for production. This page documents the one configurable value the server currently reads, explains the dotenv setup, and details what must be changed before you deploy.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.
Backend Environment Variables
The Express server inserver/server.js reads the following environment variables at startup:
| Variable | Default | Required | Description |
|---|---|---|---|
PORT | 5000 | No | The TCP port the Express server binds to. Any process manager, reverse proxy, or hosting platform can override this. |
server.js in the current codebase. The JWT secret and the users file path are both hardcoded directly in the source (see the sections below).
How to Set the Port
You can override the port inline for a single run, or export it as a shell variable before starting the process:server.js:
Creating a .env File
dotenv is listed as a dependency in server/package.json ("dotenv": "^17.2.2"), but server.js does not call dotenv.config() — the import and initialisation are absent from the current source. This means a .env file is not loaded automatically.
If you want to use a .env file, add the following line near the top of server.js (after the other imports):
server/.env:
dotenv.config() is called, environment variables must be passed via the shell (inline or export) as shown above.
Frontend Configuration
The frontend does not use.env files or Vite’s import.meta.env variables. Instead, the backend URL is hardcoded in frontend/src/pages/chatbot.jsx:
http://localhost:5000 in frontend/src/ and replace them with your target API base URL. A future improvement would be to centralise this in a Vite environment variable (VITE_API_BASE_URL) so it can be set at build time without touching source files.
JWT Secret
Users File Path
User accounts are persisted to a flat JSON file at the path
./users.json, resolved relative to the directory from which node server.js is run. If you start the server from inside server/, the file will be created at server/users.json. This file is created automatically on the first successful login — no manual setup is required for local development.For any production deployment, replace this flat-file mechanism with a proper database (MongoDB, PostgreSQL, SQLite, etc.). The flat file is not safe for concurrent writes and offers no query capability or access controls.