A progressive Node.js framework for building efficient and scalable server-side applications.
This is a project to build an API system for managing tasks among team members, encompassing APIs for user registration, login authentication, and task creation. Users can create tasks and assign them to other members who can participate in those tasks with roles such as Owner, Editor, and Viewer. Each role will have different permissions for interacting with the tasks
-
Clone this repo
-
Open repo with terminal or cmd
-
Start environment with Docker Compose
npm run start-docker-dev
- Migration database
docker exec -it training_phuongvt_nodejs-app-1 sh
npm run migration:up
- Starts GraphQL server at: http://localhost:3000/graphql
Create new user
mutation {createUser(userData: { userName: "userName", password: "password", name: "name", email:"[email protected]" }) { data{ userId name userName email } } }
Login
mutation { login(userData: { userName: "userName", password: "password", }) { data{ auth{ accessToken refreshToken } user{ userId userName name email } } } }
Refresh token
{ getAccessToken( refreshToken:"Refresh_token" ) { auth{ accessToken refreshToken } } }
Create new task
mutation { createTask(taskData:{ title: "Sample Task 2" description: "This is a sample task" priority: High start: "2023-01-10" end: "2023-02-20" }) { data { taskId title priority status } } }
Assign task
mutation assignTask($AssignTaskInput:AssignTaskInput! ){ assignTask(assignData: $AssignTaskInput) { data{ task{ taskId title description priority status start end } members{ userId name roleCode } } } }
#1 Excute container
docker exec -it training_phuongvt_nodejs-app-1 sh
#1.1 e2e tests
$ npm run test
#1 Excute container
docker exec -it training_phuongvt_nodejs-app-1 sh
#1.1 Generate a migration
MIGRATIONNAME=<migration name> npm run migration:generate
#1.2 Run migration
npm run migration:up
#1.3 Revert migration
npm run migration:down