- Copy
.env.local.exampleto.env.localand fill in the values
Use openssl rand -base64 756 to generate a secure MONGO_REPLICA_SET_KEY
- Edit your
/etc/hostsfile to include the following lines:
127.0.0.1 mongodb
127.0.0.1 mongodb_replica_1
127.0.0.1 mongodb_replica_2
-
Run
pnpm installto install the dependencies -
Run
make db-upto start the MongoDB containers -
Run
make devto start the development environment
To login into the MongoDB shell, you can use the following commands:
-
make sc- show running containers -
make db-exec id=<mongodb_container_id>- login into the MongoDB container -
mongosh -u <username> -p <password>- replace<username>and<password>with your MongoDB credentials from .env file
make dev - start the development environment
make start - start the application
make test - run tests
make analyze - run code analysis tools
make unsafe-fix - run code analysis unsafe code fixes
make db-up - create and start database containers
make db-down - stop and remove database containers
make db-stop - stop database containers
make db-start - start stopped database containers
make db-exec id=<container-id> - login into database container by id
make sc - show running containers