Backend Task Manager is an application that uses Docker, Apollo Server, and GraphQL to manage tasks. This app supports CRUD operations to manage tasks, along with register and login functionality for users.
- User Register and Login: Users can create an account and log in to access the app.
- Task CRUD: Users can create, read, update, and delete tasks.
- Apollo Server with GraphQL: Uses Apollo Server for GraphQL API.
- Dockerized: This app runs inside Docker.
- Docker
- Apollo Server
- MySQL
- GraphQL
- Sequelize
Clone this repository to your local machine:
git clone https://github.com/Satriadi93/backend-task-manager.gitcd serverMake sure you have Docker installed on your system. Then, run the following command to build and run the Docker containers:
docker-compose up --buildMake sure the .env file is configured correctly (for example, to set up the database connection and app port).
.env Example:
DB_HOST=db_host
DB_USER=root
DB_PASSWORD=your_password
DB_NAME=task_manager
PORT=3000Once the application is running, you can access the GraphQL Playground at http://localhost:3000/ to test the API.
- Register:
mutation Mutation($username: String!, $password: String!) {
register(username: $username, password: $password) {
message
}
}After logging in, you will receive a token. This token is used as the Authentication header: Bearer <token> to access the application's CRUD functionality.
- Logout
mutation Mutation { logout { message } }
- Create Task:
mutation createTask($title: String!, $taskDuedate: String!, $taskStatus: String!, $description: String!) {
createTask(title: $title, task_duedate: $taskDuedate, task_status: $taskStatus, description: $description) {
message
}
}- Get All Tasks:
query getAllTask {
getTasks {
task_id
title
task_duedate
description
user_id
}
}- Get Task by ID:
query getTaskById($taskId: ID!) {
getTaskDetail(task_id: $taskId) {
task_id
title
task_duedate
description
user_id
}
}- Get Task by title
query Query($title: String!) { tasksByTitle(title: $title) { title task_duedate task_status user_id } }
- Update Task:
mutation {
updateTask(task_id: "task-id", title: "Updated Task Title", task_duedate: "2025-02-01", task_status: "In Progress", description: "Updated Description") {
message
}
}- Delete Task:
mutation {
deleteTask(task_id: "task-id") {
message
}
}







