Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Backend Task Manager

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.

Features

  • 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.

Technologies

  • Docker
  • Apollo Server
  • MySQL
  • GraphQL
  • Sequelize

Installation

1. Clone the Repository

Clone this repository to your local machine:

git clone https://github.com/Satriadi93/backend-task-manager.git
cd server

2. Run with Docker

Make sure you have Docker installed on your system. Then, run the following command to build and run the Docker containers:

docker-compose up --build

3. Configuration

Make 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=3000

4. GraphQL API

Once the application is running, you can access the GraphQL Playground at http://localhost:3000/ to test the API.

Endpoints

  • Register:
mutation Mutation($username: String!, $password: String!) {
  register(username: $username, password: $password) {
    message
  }
}

``` * Login: ```bash mutation Mutation($username: String!, $password: String!) { login(username: $username, password: $password) } ``` if invalid username or pw

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
      }
    }

Task CRUD Operations:

Before login

After login
  • 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
  }
}

About

Backend Task Manager is a task management app using Apollo Server and GraphQL, dockerized for CRUD operations. Users can register, login, and manage tasks. Built with Docker, Apollo, and MySQL, it's ideal for scalable backend development.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages