freeCodeCamp/api
Oliver Eyton-Williams 838f30e2be
Some checks failed
i18n - Build Validation / Validate i18n Builds (20.x) (push) Has been cancelled
CI - Node.js / Lint (20.x) (push) Has been cancelled
i18n - Download Client UI / Client (push) Has been cancelled
CI - Node.js / Build (20.x) (push) Has been cancelled
CI - Node.js / Test (20.x) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (20.x) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 20.x) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 20.x) (push) Has been cancelled
feat(api): update mobile-login to match api-server (#55863)
2024-09-03 20:38:50 -05: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 feat(api): update mobile-login to match api-server (#55863) 2024-09-03 20:38:50 -05: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
jest.config.ts test: speed up api tests (#53969) 2024-03-09 10:36:19 +05:30
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
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.