Skip to content

Vladipz/Tasker

Repository files navigation

Tasker

Ovarview

Tasker is a simple task manager that allows you to create, edit, and delete tasks. Also you can register and login to save your tasks. The serviceare using JWT for authentication. For development was user .NET 8.0, Entity Framework Core, and SQL Server.

Setup instructions

Prerequisites

  • .NET 8.0
  • A SQL database (SQL Server)
  • EF Core Tools

Cloning the repository

git clone https://github.com/Vladipz/Tasker.git 
cd Tasker

Setup the environment (local)

  1. Configure Application Settings Copy the example configuration file and edit it to set up your environment:
cd .\Tasker.API\
cp appsettings.example.json appsettings.Development.json
cd ..

Edit appsettings.json to include your database connection string and other settings.

  1. Install dependencies
dotnet restore
  1. Apply migrations
dotnet ef database update
  1. Run the application
dotnet run --project .\Tasker.API\

Using docker-compose

To run the app using docker compose:

  1. Clone the repository
git clone https://github.com/Vladipz/Tasker.git 
cd Tasker
  1. Run docker-compose
docker-compose up

That's it, the app is preconfigured in the compose file, so no extra configuration is required. After all of the containers have started, you'll have 3 running containers:

  • ASP .NET Core API on port 5001 (http)
  • MsSql database on port 5002 (http)

API Documentation

Endpoints

Tasks Management

GET /api/tasks

Retrieve a list of tasks.

Query Parameters:

  • priorityQuery: string (optional)
  • statusQuery: string (optional)
  • dueDate: string (date-time) (optional)
  • sortColumn: string (optional)
  • sortOrder: string (optional)
  • page: integer (required)
  • pageSize: integer (required)

Responses:

  • 200 OK: List of tasks returned.
  • 400 Bad Request: Invalid query parameters.

POST /api/tasks

Create a new task.

Request Body:

  • TaskRequest (JSON):
    • title: string (optional)
    • description: string (optional)
    • dueDate: string (date-time) (optional)
    • status: integer (TaskStatusType)
    • priority: integer (TaskPriorityType)

Responses:

  • 200 OK: Task created.
  • 400 Bad Request: Validation error.

GET /api/tasks/{id}

Retrieve a task by its id.

Path Parameters:

  • id: string (uuid) (required)

Responses:

  • 200 OK: Task returned.
  • 404 Not Found: Task not found.
  • 403 Forbidden: Unauthorized. (user try get task that not belongs to him)

PUT /api/tasks/{id}

Update an existing task by its id.

Path Parameters:

  • id: string (uuid) (required)

Request Body:

  • TaskRequest (JSON)

Responses:

  • 200 OK: Task updated.
  • 400 Bad Request: Validation error.
  • 404 Not Found: Task not found.
  • 403 Forbidden: Unauthorized(user try edit task that not belongs to him).

DELETE /api/tasks/{id}

Delete a task by its id.

Path Parameters:

  • id: string (uuid) (required)

Responses:

  • 200 OK: Task deleted.
  • 404 Not Found: Task not found.

Authentication

POST /api/auth/register

Register a new user.

Request Body:

  • RegistrationRequest (JSON):
    • username: string (required)
    • email: string (email) (required)
    • password: string (required)

Password Requirements:

  • Password Requirements:
  • The password cannot be empty.
  • Minimum password length is 8 characters.
  • Maximum password length is 16 characters.
  • Must contain at least one uppercase letter.
  • Must contain at least one lowercase letter.
  • Must contain at least one number.
  • Must contain at least one special character (e.g., !, ?, *, .).

Responses:

  • 200 OK: User registered.
  • 409 Conflict: Username or email already exists.
  • 400 Bad Request: Validation error.(password)

POST /api/auth/login

Login a user.

Request Body:

  • LoginRequest (JSON):
    • username: string (required)
    • password: string (required)

Responses:

  • 200 OK: User logged in.
  • 404 Not Found: User not found.
  • 401 Unauthorized: Invalid password.
  • 400 Bad Request: Validation error or missing fields in settings

Components

Schemas

LoginRequest

  • Properties:
    • username: string (required, minLength: 1)
    • password: string (required, minLength: 1)

RegistrationRequest

  • Properties:
    • username: string (required, minLength: 1)
    • email: string (required, format: email, minLength: 1)
    • password: string (required, minLength: 1)

TaskPriorityType

  • Enum Values: 0, 1, 2, 3

TaskRequest

  • Properties:
    • title: string (nullable, optional)
    • description: string (nullable, optional)
    • dueDate: string (format: date-time, nullable, optional)
    • status: integer (TaskStatusType)
    • priority: integer (TaskPriorityType)

TaskStatusType

  • Enum Values: 0, 1, 2, 3

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors