Skip to content

danielavilas/tasks-api

Repository files navigation

Task API

Welcome to the Task API! This API is currently in development and continuous improvement. Our primary focus here is to showcase the resolvers responsible for visualizing tasks for authenticated users who have the necessary permissions.

This README will guide you through setting up and using the API.

Table of Contents

Requirements

To get started with the Task API, ensure you have the following:

  • Docker (and Docker Compose)
  • Node.js (optional for development)

Installation

  1. Clone the repository:

    git clone [email protected]:danielavilas/tasks-api.git
  2. Navigate to the project directory:

    cd task-api
  3. Ensure Docker is installed on your system.

Usage

To run the Task API using Docker Compose:

  1. Build and start the Docker containers:

    docker-compose up --build
  2. The API will be accessible at http://localhost:3000.

  3. The GraphQL playground interface will be available to test it.

  4. The migrations will create 10 tasks and 2 users with the same password for tests (Test123!):

    • daniel (has access to all 10 tasks)
    • avila (has access to all DONE tasks)
    • To authenticate a user and obtain an access token, use the following mutation:
mutation Login($username: String!, $password: String!) {
  login(username: $username, password: $password) {
    accessToken
  }
}
  • Use Authorization: YOUR_ACCESS_TOKEN to access queries and mutations
  1. The postgres DB will be available at 5432 with user admin and password admin

Testing

To run the tests for the Task API:

npm test

About

Simple api for tasks management

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published