Welcome to FlashCards Backend’s documentation!
API Documentation
API Module
Authentication Module
import dependancies
Cards Module
routes.py is a file in cards folder that has all the functions defined that manipulate the cards. All CRUD functions that needs to be performed on cards are defined here.
- src.cards.routes.createcards(deckId)[source]
This method is routed when the user requests to create new cards in a deck. Only the deckid is required to add cards to a deck.
- src.cards.routes.deletecard(id, cardid)[source]
This method is called when the user requests to delete the card. The deckid and the particular cardid is required to delete the card.
Deck Module
routes.py is a file in deck folder that has all the functions defined that manipulate the deck. All CRUD functions are defined here.
- src.deck.routes.get_deck_stats(id)[source]
This method calculates stats of a specific deck by its ID.
- src.deck.routes.get_leaderboard(deckId)[source]
This endpoint fetches the leaderboard data for a specific deck.
- src.deck.routes.get_practice_cards(deck_id, user_id)[source]
Get cards due for review using spaced repetition
- src.deck.routes.get_user_score(deckId, userId)[source]
This endpoint fetches the user’s score for a specific deck. If the user doesn’t exist, return zero for all score values.
- src.deck.routes.getdecks()[source]
Fetch all decks. Shows private decks for authenticated users and public decks for non-authenticated users.
- src.deck.routes.practice_schedule(deck_id, user_id)[source]
Get the practice schedule for future iterations of cards
- src.deck.routes.record_answer(user_id)[source]
Update card progress using SM-2 algorithm with frontend-provided ease
Folders Module
routes.py is a file in the folder folder that has all the functions defined that manipulate folders. All CRUD functions are defined here.
- src.folders.routes.adddecktofolder()[source]
This method allows the user to add a deck to a folder by folderId and deckId.
POST /deck/add-deck payload: { folderId: “string”, deckId: “string” }
- src.folders.routes.createfolder()[source]
POST /folder/create payload: { name: “string”, userId: “string” }
- src.folders.routes.deletefolder(id)[source]
This method is called when the user requests to delete a folder.
DELETE /folder/delete/{id}
- src.folders.routes.get_decks_for_folder(folder_id)[source]
This method is called to fetch all decks for a specific folder.
GET /decks/{folder_id}
- src.folders.routes.getfolder(id)[source]
This method is called when we want to fetch one of the folders by folder ID
GET /folder/{id}
- src.folders.routes.getfolders()[source]
This method is called when we want to fetch all folders for a specific user
GET /folders/all