freeCodeCamp/api
Oliver Eyton-Williams 7345989917
refactor(api): import add-donation schema (#55876)
2024-08-19 13:30:02 +02:00
..
__mocks__ refactor(api): more, smaller tests (#54671) 2024-05-20 11:18:14 -07:00
prisma fix(api): UserRateLimit schema (#55663) 2024-08-08 23:03:49 +05:30
src refactor(api): import add-donation schema (#55876) 2024-08-19 13:30:02 +02:00
tools
.gitignore
README.md
jest.config.ts
jest.utils.test.ts test: minor fix to how cookies are passed around (#55259) 2024-06-21 08:36:46 -07:00
jest.utils.ts refactor: simplified and documented test helpers (#55493) 2024-07-12 16:23:37 -07:00
package.json feat(api): implement authorization code flow in the new api (#55413) 2024-07-24 20:08:10 +03:00
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.