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.
To get started with the Task API, ensure you have the following:
- Docker (and Docker Compose)
- Node.js (optional for development)
-
Clone the repository:
git clone [email protected]:danielavilas/tasks-api.git
-
Navigate to the project directory:
cd task-api -
Ensure Docker is installed on your system.
To run the Task API using Docker Compose:
-
Build and start the Docker containers:
docker-compose up --build
-
The API will be accessible at
http://localhost:3000. -
The GraphQL playground interface will be available to test it.
-
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_TOKENto access queries and mutations
- The postgres DB will be available at
5432with useradminand passwordadmin
To run the tests for the Task API:
npm test