Ruby on Rails-based project management system, designed to allow users to manage and track projects and tasks through a simple and intuitive RESTful API interface. It focuses on providing essential functionalities for project and task management, including creation, editing, and viewing, along with secure user authentication.
To get started with Task Manager, clone the repository, install the required gems:
git clone https://github.com/JuliaKovtun/task_manager.git
cd task_manager
bundle install
rails db:migrate
rails db:seedTo run the project use --dev-caching for enabling caching in development environment:
rails s --dev-cachingBy default seeds create the user with an email user@gmail.com and a password 123456. You will need these credentials for authentication.
curl --location --request POST 'http://localhost:3000/users/sign_in' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"user": {
"email": "user@gmail.com",
"password": "123456"
}
}'On success, you will receive auth_token, which you will need to use in headers for the next requests. Example of successful result:
{
"success": true,
"auth_token": "byQt8nESTsfWVd22nEBH",
"email": "user@gmail.com"
}In the next requests you will need to replace generated_token with the one you receive in the response to this request.
Returns one project.
curl --location --request GET 'http://localhost:3000/projects/:id' \
--header 'Accept: application/json' \
--header 'X-User-Email: user@gmail.com' \
--header 'X-User-Token: generated_token'Returns all projects.
curl --location --request GET 'http://localhost:3000/projects/' \
--header 'X-User-Email: user@gmail.com' \
--header 'X-User-Token: generated_token' \
--header 'Accept: application/json'Creates a project.
curl --location --request POST 'http://localhost:3000/projects/' \
--header 'X-User-Email: user@gmail.com' \
--header 'X-User-Token: generated_token' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"project": {
"title": "Project title",
"description": "Project description"
}
}'Updates a project.
curl --location --request PUT 'http://localhost:3000/projects/:id' \
--header 'Accept: application/json' \
--header 'X-User-Email: user@gmail.com' \
--header 'X-User-Token: generated_token' \
--header 'Content-Type: application/json' \
--data '{
"project": {
"title": "Project title",
"description": "Project description"
}
}'Deletes project.
curl --location --request DELETE 'http://localhost:3000/projects/:id' \
--header 'Accept: application/json' \
--header 'X-User-Email: user@gmail.com' \
--header 'X-User-Token: generated_token'Returns one task.
curl --location --request GET 'http://localhost:3000/projects/:project_id/tasks/:id' \
--header 'Accept: application/json' \
--header 'X-User-Email: user@gmail.com' \
--header 'X-User-Token: generated_token'Returns all tasks in project. You can filter tasks by status using url params:
?status=new
?status=in_progress
?status=done
Example request with filter:
curl --location --request GET 'http://localhost:3000/projects/:project_id/tasks?status=in_progress' \
--header 'Accept: application/json' \
--header 'X-User-Email: user@gmail.com' \
--header 'X-User-Token: generated_token'Example request without filter:
curl --location --request GET 'http://localhost:3000/projects/:project_id/tasks' \
--header 'Accept: application/json' \
--header 'X-User-Email: user@gmail.com' \
--header 'X-User-Token: generated_token'Creates a task.
Possible params for task status are: new, in_progress, done.
curl --location --request POST 'http://localhost:3000/projects/:project_id/tasks' \
--header 'Accept: application/json' \
--header 'X-User-Email: user@gmail.com' \
--header 'X-User-Token: generated_token' \
--header 'Content-Type: application/json' \
--data '{
"task": {
"title": "Task title",
"description": "Task description",
"status": "in_progress"
}
}'Updates the task.
curl --location --request PUT 'http://localhost:3000/projects/:project_id/tasks/:id' \
--header 'Accept: application/json' \
--header 'X-User-Token: generated_token' \
--header 'X-User-Email: user@gmail.com' \
--header 'Content-Type: application/json' \
--data '{
"task": {
"title": "Updated task title",
"description": "Updated task description",
"status": "new"
}
}'Deletes the task.
curl --location --request DELETE 'http://localhost:3000/projects/26/tasks/32' \
--header 'Accept: application/json' \
--header 'X-User-Token: generated_token' \
--header 'X-User-Email: user@gmail.com'bundle exec rspec