freeCodeCamp/api
Oliver Eyton-Williams 517a351a28
feat(api): send errors to Sentry (#55208)
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2024-06-19 17:36:41 +05:30
..
__mocks__ refactor(api): more, smaller tests (#54671) 2024-05-20 11:18:14 -07:00
prisma fix(api): add msUsername index to prisma (#54187) 2024-04-02 09:15:01 -07:00
src feat(api): send errors to Sentry (#55208) 2024-06-19 17:36:41 +05:30
tools fix(api): use port 27017 (#54220) 2024-04-02 17:07:02 -07:00
.gitignore feat: create docker images for new api (#51538) 2023-09-13 02:15:25 +05:30
jest.config.ts test: speed up api tests (#53969) 2024-03-09 10:36:19 +05:30
jest.utils.test.ts feat(api): add csrf protection (#50275) 2023-05-18 17:06:40 +05:30
jest.utils.ts refactor(api): more, smaller tests (#54671) 2024-05-20 11:18:14 -07:00
package.json feat(api): add PUT /certificate/verify (#51507) 2024-02-28 16:01:35 +00:00
README.md fix(api): use port 27017 (#54220) 2024-04-02 17:07:02 -07:00
tsconfig.build.json feat: create docker images for new api (#51538) 2023-09-13 02:15:25 +05:30
tsconfig.json refactor(api): import ts-reset in entrypoint (#51677) 2023-09-28 09:40:51 -07:00

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.