Say goodbye to boring memorization - Codi's flashcard-based platform makes learning to code a fun and seamless experience with progress tracking to keep you motivated.
π Live Version | Live API | Codi Client Repo
- π Codi-API
- Say goodbye to boring memorization - Codi's flashcard-based platform makes learning to code a fun and seamless experience with progress tracking to keep you motivated.
- Table of Content
- π Features
- π Getting Started
- β« Endpoints
- 𧱠Main Structure
- π¦ Tech Stack (Dependencies)
- π¨ contributors
β οΈ Disclaimer
-
Topic management: users can manage their topics through the topics endpoints.
-
Flashcard management: users can manage flashcards for a specific topic through the cards endpoints.
-
Flashcard quiz: the quiz endpoint provides a random set of flashcards for the user to answer in a quiz session.
-
Analytics
- Topic statistics: users can retrieve statistics for a specific topic, such as the total number of flashcards, the number of flashcards in each status, and the number of flashcard reviews grouped by date.
-
Security:
- The API requires authentication through Auth0 to access any of its endpoints.
- Users can only access topics and flashcards they own.
-
Connect to your postgres server
-
Clone it
git clone https://github.com/PavelKotlov/codi-api
-
Navigate to the repo
cd codi-api
-
Install all the depndencies
npm install
-
Sign up with Auth0. Create an API follow the prompts and ensure to allow
Allow Offline
Access.β οΈ Alternativly if you will connect a front end application also do the following: Addhttp://localhost:[PORT]
link to Allowed Callback URLs, Allowed Logout URLs, and Allowed Web Origins. Addhttps://[app-name.us].auth0.com/authorize
to Application Login URI. -
Create a .env file according to the template below
DATABASE_URL= OPENAI_API_KEY= AUTH0_AUDIENCE= AUTH0_ISSUER_BASE_URL=
-
Create a databse for the project
CREATE DATABASE codi;
-
Run migrations and seed the database
npx prisma migrate reset
-
Run the server
npm start
- Base URL : http://127.0.0.1:8080
Http method | path | Description |
---|---|---|
GET |
/api/topics |
Gets all the topics for the authorized user |
POST |
/api/topics |
Creat a new topic for the authorized user |
GET |
/api/topics/:id |
Gets a specific topic for the authorized user |
DELETE |
/api/topics/:id |
Deletes a specific topic for the authorized user |
PATCH |
/api/topics/id |
Edits a specific topic for the authorized user |
GET |
/api/topics/:id/stats |
Gets reviews per day, card counts, and graph informartion of a specific topic for the authorized user |
GET |
/api/topics/:id/cards/quiz |
Gets the cards due for a quiz for a specific topic for the authorized user |
GET |
/api/topics/:id/cards |
Gets all the cards for a specific topic for the authorized user |
DELETE |
/api/topics/:id/cards/:card_id |
Deletes a card from a specific topic for the authorized user |
GET |
/api/topics/:id/cards/:card_id |
Gets a specific card for a specific topic for the authorized user |
POST |
/api/topics/:id/cards |
Adds a card to a specific topic for the authorized user |
PATCH |
/api/topics/:id/cards/:card_id |
Edits a card for a specific topic for the authorized user |
βββ db # functions that interact with the db to retrieve stats data
βββ helpers # helper functions
βββ prisma # database
β βββ migrations # database migrations
β βββ seeds # database seeds
ββββ routes # app routes
ββββ knexfile.js
ββββ package-lock.json
ββββ package.json
ββββ README.md
ββββ server.js # the server: the main driver of the app includes all the routes and server configs
- PavelKotlov @PavelKotlov
- Juliana Mochizuki @jkmochizuki
- Shorouk Abdelaziz @ShoroukAziz
- This is a project for LHL web development bootcamp and is not meant for production use