Both the Express server and the Vite-powered React client are configured entirely through environment variables — no hard-coded values in the codebase. Before starting either process you must create aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/abdelhafid37/talkbox/llms.txt
Use this file to discover all available pages before exploring further.
.env file in the relevant directory and populate it with the values described below.
- Server
- Client
Copy
server/.env.example to server/.env and fill in each value. The server reads these at startup via dotenv before connecting to MongoDB or binding the HTTP port.The port on which the Express server listens. Defaults to
3000 in the example file. Change this if port 3000 is already in use on your machine or your hosting platform assigns a different port automatically.A full MongoDB connection string. For MongoDB Atlas this looks like
mongodb+srv://<username>:<password>@<cluster>.mongodb.net/<dbname>?retryWrites=true&w=majority. For a local instance use mongodb://localhost:27017/talkbox. The server will exit with a non-zero code if the connection cannot be established at startup.The secret key used to sign and verify JSON Web Tokens for authenticated API routes and Socket.IO connections. This value must be kept private. A minimum of 32 randomly generated characters is strongly recommended (see the tip below).
The exact origin of the React client, including the protocol and port — for example
http://localhost:5173. This value is passed directly to the cors middleware in app.js and to Socket.IO’s CORS configuration in socket.js, so both REST API requests and WebSocket upgrade handshakes are restricted to this origin. In production, replace this with your deployed frontend URL.server/.env