Repository navigation
Configuration
This guide explains how to configure CrowdWide for local development.
CrowdWide uses environment variables to configure application settings and sensitive credentials.
Create a local .env file using the repository's example:
cp .env.example .envOn Windows PowerShell, use:
Copy-Item .env.example .envOpen .env in your code editor and configure the values required by your local environment.
| Variable | Purpose |
|---|---|
MONGODB_URI |
Connection string for MongoDB |
SESSION_SECRET |
Secret used to protect session integrity |
APP_URL |
Base URL of the application |
Check .env.example and the application source code for the complete list of supported variables and their default values.
CrowdWide requires a valid MongoDB connection for database operations.
- Set up a local MongoDB instance or a MongoDB Atlas database.
- Copy the appropriate connection string.
- Set it as
MONGODB_URIin your.envfile. - Confirm that the database is reachable by the application.
Keep database credentials private.
Set SESSION_SECRET to a long, randomly generated value.
You can generate one using Node.js:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"Never reuse production secrets in public examples or commit secret values to GitHub.
For local development, APP_URL may be configured as:
http://localhost:3000
For production, use the actual public URL and follow the deployment documentation.
- Never commit
.envfiles containing secrets. - Keep
.env.examplefree of real credentials. - Use separate configuration values for development and production.
- Rotate exposed credentials immediately.
- Grant database users only the permissions they need.
Ensure .env exists in the project root and contains the required settings.
Check the connection string, database availability, credentials, and network permissions.
Verify that SESSION_SECRET is configured and that the application can read the environment variables.