Skip to content

Configuration

Puneet Kumar Mishra edited this page Oct 15, 2026 · 1 revision

⚙️ CrowdWide Configuration

This guide explains how to configure CrowdWide for local development.

📄 Environment Variables

CrowdWide uses environment variables to configure application settings and sensitive credentials.

Create a local .env file using the repository's example:

cp .env.example .env

On Windows PowerShell, use:

Copy-Item .env.example .env

Open .env in your code editor and configure the values required by your local environment.

🔑 Important Settings

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.

🗄️ MongoDB Configuration

CrowdWide requires a valid MongoDB connection for database operations.

  1. Set up a local MongoDB instance or a MongoDB Atlas database.
  2. Copy the appropriate connection string.
  3. Set it as MONGODB_URI in your .env file.
  4. Confirm that the database is reachable by the application.

Keep database credentials private.

🔐 Session Security

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.

🌐 Application URL

For local development, APP_URL may be configured as:

http://localhost:3000

For production, use the actual public URL and follow the deployment documentation.

🛡️ Security Best Practices

  • Never commit .env files containing secrets.
  • Keep .env.example free of real credentials.
  • Use separate configuration values for development and production.
  • Rotate exposed credentials immediately.
  • Grant database users only the permissions they need.

🧰 Troubleshooting

Environment variables are missing

Ensure .env exists in the project root and contains the required settings.

MongoDB connection fails

Check the connection string, database availability, credentials, and network permissions.

Session errors occur

Verify that SESSION_SECRET is configured and that the application can read the environment variables.

📚 Related Documentation

Clone this wiki locally