freeCodeCamp/api
Shaun Hamilton 133f07becd
chore(api): refactor schemas into individual files (#54350)
2024-04-11 14:45:56 +02:00
..
__mocks__ feat(api): add POST /exam-challenge-completed (#52395) 2023-12-27 20:40:30 +05:30
prisma fix(api): add msUsername index to prisma (#54187) 2024-04-02 09:15:01 -07:00
src chore(api): refactor schemas into individual files (#54350) 2024-04-11 14:45:56 +02:00
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
README.md fix(api): use port 27017 (#54220) 2024-04-02 17:07:02 -07:00
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 feat(api): use jwt_access_token (in development) (#53997) 2024-03-20 13:47:12 +02:00
package.json feat(api): add PUT /certificate/verify (#51507) 2024-02-28 16:01:35 +00: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

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.