REST API for the QuestLog app of the same author. This Repo implements the backend, built in Express + MongoDB.
A repository for the front-end code can be found here: front-end code
To set up this back-end in your computer:
- Clone the repo:
git clone.... - Install dependencies:
npm install. - Create the following variables in an
.envfile at the root of the project:- PORT with the port where the server will be running:
PORT:YOUR_PORT - ORIGIN with the location of the front-end app:
ORIGIN:http://my-cool-app.netlify.com - TOKEN_SECRET to sign auth tokens:
TOKEN_SECRET:ilovepotatoes.
- PORT with the port where the server will be running:
- Run the app:
npm run dev.
A working demo of the app can be found here: QuestLog
Authentication Routes (/auth)
POST /auth/signup- User registrationPOST /auth/login- User loginGET /auth/verify- Verify JWT tokenPOST /auth/logout- User logout
User Routes (/api/user)
GET /api/user- Get user infoPOST /api/user/disciplines- Create disciplinesPOST /api/user/sidequests- Create SidequestsPATCH /api/user/disciplines/:disciplineId/complete- Complete DisciplineDELETE /api/user/discipline/:disciplineId- Delete DisciplinePATCH /api/user/sidequests/:sidequestId/complete- Complete Sidequest
Quest Routes (/api/quests)
GET /api/quests- Get QuestsPOST /api/quests- Create QuestPOST /api/quests/:questId/tasks- Create TaskPOST /api/quests/:questId/inventory- Create Inventory ItemPATCH /api/quests/:questId- Update Quest NamePATCH /api/quests/:questId/tasks/:taskId- Complete Task of QuestPATCH /api/quests/:questId/complete- Complete questDETELE /api/quests/:questId- Delete Quest