Skip to main content

Documentation 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.

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 a .env file in the relevant directory and populate it with the values described below.
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.
PORT
number
required
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.
MONGO_URI
string
required
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.
JWT_SECRET
string
required
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).
CLIENT_URL
string
required
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
PORT=3000
MONGO_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/talkbox?retryWrites=true&w=majority
JWT_SECRET=<your-strong-random-secret>
CLIENT_URL=http://localhost:5173
Never commit a .env file to version control. Both server/.env and client/.env are listed in .gitignore by convention — verify this before your first commit. Exposing MONGO_URI or JWT_SECRET in a public repository can lead to unauthorised database access or forged authentication tokens.
Generate a cryptographically strong JWT_SECRET with a single command:
openssl rand -base64 32
This produces a 44-character Base64 string suitable for use as a signing secret. Copy the output directly into your server/.env file.

Build docs developers (and LLMs) love