freeCodeCamp/api
Lars Kappert d32e57813e
chore: update Knip to v5 (#56244)
2024-09-26 13:12:00 +02:00
..
__mocks__
prisma
src
tools
.gitignore
README.md
jest.config.ts
jest.utils.test.ts
jest.utils.ts
package.json
tsconfig.build.json
tsconfig.json

README.md

Working on the new api

Connecting to local database

The api uses the ORM Prisma and it needs the MongoDB instance to be a replica set.

Atlas

If you use MongoDB Atlas, the set is managed for you.

Local

The simplest way to run a replica set locally is to use the docker-compose file in /tools.

cd tools
docker compose up -d

The new db will be empty, so you can run the seed script to populate it.

cd ../.. # back to the root of the repo
pnpm seed

Login in development/testing

During development and testing, the api exposes the endpoint GET auth/dev-callback. Calling this will log you in as the user with the email foo@bar.com by setting the session cookie for that user.