- API Routes
- Command to install dependencies
- Command to run the API
- Account registered
- Technologies used
- Docs I've been using
- Frontend commands for ANFECA project (React Native + Expo)
- Useful Git commands
| Purpose | Method | Route | Consumes | Returns |
|---|---|---|---|---|
| Login | POST | /api/auth/login |
JSON object { email, password } |
Access token and refresh token |
| Register | POST | /api/auth/register |
JSON object { name, lastName, email, password } |
Success message, JSON Guardian and Account objects |
| Send verification code | POST | /api/auth/verification-code |
JSON object { email } |
Success message |
| Verify code | POST | /api/auth/verification-code/verify |
JSON object { email, code } |
Success message |
| Refresh access token | POST | /api/auth/token/refresh |
JSON object { refreshToken } |
New access token |
| Validate email | POST | /api/auth/validation/email |
JSON object { email } |
Success message or invalid email message |
| Validate password | POST | /api/auth/validation/password |
JSON object { password } |
Success message or invalid password message |
| Purpose | Method | Route | Consumes | Returns |
|---|---|---|---|---|
| Delete account | DELETE | /api/account/ |
Nothing | Success message |
| Switch profile | POST | /api/account/profiles/switch |
JSON { targetProfile: "guardian", password } or { targetProfile: "kid" } |
Success message, new access token and new fresh token |
| Get current profile info | GET | /api/account/profiles/ |
Nothing | Message stating the current profile and JSON guardian or kid object |
| Get profiles names | GET | /api/account/profiles/names |
Nothing | JSON object { guardian, kid } |
Get current profile info
Get profiles' names
| Purpose | Method | Route | Consumes | Returns |
|---|---|---|---|---|
| Create kid profile | POST | /api/kids/ |
JSON Object { name } |
JSON Kid profile object |
| get coins | GET | /api/kids/coins |
Nothing | { coins } |
| get streak | GET | /api/kids/streak |
Nothing | { streak } |
| Purpose | Method | Route | Consumes | Returns |
|---|---|---|---|---|
| Get all banks | GET | /api/banks/ |
Nothing | Success message, Array of JSON banks objects |
| Create a bank | POST | /api/banks/ |
JSON Object { name } |
Success message, JSON bank object |
| Get a bank | GET | /api/banks/:bankId |
Nothing | Success message, JSON bank object |
| Edit a bank | PUT | /api/banks/:bankId |
{ fields that are updated } | Success message, JSON updated bank |
| Delete a bank | DELETE | /api/banks/:bankId |
Nothing | Success message |
| Get all questions | GET | /api/banks/:bankId/questions/ |
Nothing | Success message, Array of JSON question object |
| Create a question | POST | /api/banks/:bankId/questions/ |
JSON Object { textQuestion, answers, priority } |
Success message, JSON question object |
| Get a question | GET | /api/banks/:bankId/questions/:questionId |
Nothing | Success message, JSON question object |
| Edit a question | PUT | /api/banks/:bankId/questions/:questionId |
{ fields that are updated } | Success message, JSON updated question |
| Delete a question | DELETE | /api/banks/:bankId/questions/:questionId |
Nothing | Success message |
| Start study session | GET | /api/banks/:bankId/flashcards/study-session |
Nothing | {sessionId front, back} |
| Get the following flashcard | POST | /api/banks/:bankId/flashcards/study-session/:studySessionId/:flashcardId |
{ feedback } | Flashcard JSON object with id, front and back; or message "Study session complete!" |
-
:bankIdis the questions bank ID -
answersin JSON Object must be an array of objects, max of 4 answers, at least one correct and one incorrect -
feedbackmust be a number from 1 to 4. E.g. { "feedback": 4 } -
start study session returns this
| Purpose | Method | Route | Consumes | Returns |
|---|---|---|---|---|
| Fetch questions | GET | /api/game/:bankId/start-game |
Nothing | { sessionId, questions } |
| Send game result | POST | /api/game/:bankId/:gameSessionId/result |
{ "questions": [{"question", "answeredCorrectly"}], "individualCoins" } | Success message, earned coins |
- fetch questions returns this
questionsis the array with the 5 questions that will be displayed in the game- The request for
/api/game/:bankId/:gameSessionId/resultmust be like this:
typeis an enum[once, forever, custom], if the user selectscustomthen the front must sendredemptionLimit
npm i bcrypt cors dotenv express jsonwebtoken mongodb mongoose sib-api-v3-sdk joi luxon cron
npm i --save-dev chai@^4.3.7 chai-http@^4.3.0 chai-as-promised@^8.0.1 mocha@^11.1.0 sinon@^20.0.0 cross-env@^7.0.3 sinon
node back/src/server.js
zuzzet.hs14@gmail.com Hola123*
- Node.js
- Express
- MongoDB + Mongoose
- JWT
- joi
- Brevo API
- Mongoose
- Nodemailer
- Brevo
- Express
- crypto
- express-rate-limit
- JSON Web Token
- Auth0
- JWT & Refresh tokens
- refresh tokens
- REST API URI Naming Conventions
- HTTP response codes in RESTful APIs
- joi
npm install npm install lucide-react-native npm install axios npx expo install expo-secure-store
git checkout origin/rama -- carpeta/
git fetch origin
git branch -r
git ls-tree --name-only origin/rama
git restore .
git clean -fd
git restore --staged directorio/archivo
git push -u origin rama-prueba
git merge nombre-rama
git push origin nombre-rama
git checkout -b nueva-rama origin/rama-remota
git branch -d nombre-rama # Usa -D si no está fusionada
git push origin --delete nombre-de-la-rama
git config --global core.editor "code --wait"
git commit --edit
git diff rama-1..rama-2 --name-status












