This project was generated with ❤.
-
Clone repository -
$ git clone https://github.com/Fn-studyo/talentQL-task.git
-
Install dependencies -
$ cd talent
-
Install dependencies -
$ npm install
-
Create a new file
.env
if it doesn't exist and copy the contents of.env.example
into it to be able to run your server on production environment.
Make sure you have mysql or postgresql installed, you could use any database of your choice
-
Initialize Prisma -
$ npx prisma init
-
Connect to your db by providing the appropriate credentials, check .env.example for a similar example
-
Migrate the Database -
$ prisma migrate dev --name init
- Start up prisma studio - Run
$ npx prisma studio
-
Start up the server - Run
$ npm start
|$ npm run dev
-
Server should be running on http://localhost:2020/ by default
- Start up
$ npm run test
-
Via Postman Collection (https://documenter.getpostman.com/view/11039127/TzeTJpNs)
-
Via Swagger, viewing the api locally (http://localhost:3000/api-docs)
Routes | Description | Auth roles |
---|---|---|
[POST] /api/auth/signup | Create a new account | none |
[POST] /api/auth/login | User sign in | none |
[POST] /api/auth/logout | Logout a user | User |
[POST] /api/auth/request-email-verification | Resend verfication email | none |
[POST] /api/auth/verify-email | Email verification | none |
[POST] /api/auth/request-password-reset | Sends a request password email | none |
[POST] /api/auth/reset-password | Reset password form handler | none |
[PUT] /api/users | Update a user | User |
[GET] /api/posts/create | Create a post | User |
[GET] /api/posts/publish/:bookId | Publish a book | User |
[GET] /api/user | Get users details | User |
[DELETE] /api/user | Delete a user | User |