Simple Rails application for managing projects and their tasks with filtering, sorting, and JSON API support.
A lightweight task tracker where users can manage projects and their associated tasks with basic CRUD operations, filtering, sorting, and a simple JSON API.
Key Features: Project management, task tracking with status/priority, overdue detection, filtering/sorting, JSON API endpoints.
Status: Assignment implementation. See docs/requeriments.md for complete specifications.
- Ruby: 3.3.0 or higher
- Rails: 8.0.0 or higher
- PostgreSQL: 15 or higher
- Bundler: 2.3 or higher
git clone [email protected]:sbafsk/task-tracker.git
cd task-trackerbundle installEnsure PostgreSQL is running on your system. The application uses the default PostgreSQL connection settings.
# Create the database
rails db:create
# Run migrations to create tables
rails db:migrate
# (Optional) Load sample data for testing
rails db:seedrails serverThe application will be available at http://localhost:3000
- Project: name (unique), description, has_many tasks
- Task: title, description, status (todo/in_progress/done), priority (1-5), due_date, belongs_to project
- CRUD operations for Projects and Tasks
- Task filtering by status (All, Todo, In Progress, Done)
- Task sorting by priority (high to low) or due date (soonest first)
- Overdue badge when task is past due and not done
- Task counts per project (total and incomplete)
The application provides a RESTful JSON API for accessing task data.
GET /api/projects/:project_id/tasks
Returns a JSON array of tasks for the specified project.
| Parameter | Type | Values | Description |
|---|---|---|---|
status |
string | todo, in_progress, done |
Filter tasks by status |
overdue |
boolean | true, false |
Filter tasks that are overdue |
Parameters can be combined to create complex queries.
[
{
"id": 1,
"title": "Set up CI",
"status": "in_progress",
"priority": 2,
"due_date": "2025-12-05",
"overdue": false
}
]id- Task ID (integer)title- Task title (string)status- Current status:todo,in_progress, ordone(string)priority- Priority level from 1 (highest) to 5 (lowest) (integer)due_date- Due date in ISO 8601 format (string, nullable)overdue- Computed boolean indicating if task is past due and not done (boolean)
# Get all tasks for project 1
curl http://localhost:3000/api/projects/1/tasks
# Get only todo tasks
curl http://localhost:3000/api/projects/1/tasks?status=todo
# Get only overdue tasks
curl http://localhost:3000/api/projects/1/tasks?overdue=true
# Get in-progress tasks that are overdue
curl http://localhost:3000/api/projects/1/tasks?status=in_progress&overdue=true[
{
"id": 1,
"title": "Set up CI pipeline",
"status": "in_progress",
"priority": 2,
"due_date": "2025-12-05",
"overdue": false
},
{
"id": 2,
"title": "Write documentation",
"status": "todo",
"priority": 3,
"due_date": "2025-12-01",
"overdue": true
}
]# Run full test suite
bundle exec rspec
# Run only model tests
bundle exec rspec spec/models
# Run only request tests
bundle exec rspec spec/requests
# Run specific test file
bundle exec rspec spec/models/task_spec.rb
# Run specific test at line number
bundle exec rspec spec/models/task_spec.rb:42The test suite includes 81 examples covering:
- Model validations: status inclusion, priority range, project presence, title presence
- Task#overdue? method: future dates, past dates with different statuses, nil dates
- Task scopes:
.with_status,.overdue,.sorted_by(priority_desc, due_date_asc) - API endpoints: JSON responses, status filtering, overdue filtering, combined filters
All tests pass with 0 failures.
- Development Guide: docs/guides/development.md - Workflow, debugging
- Testing Guide: docs/guides/testing.md - RSpec, factories, coverage
- Deployment Guide: docs/guides/deployment.md - Deploy to Render.com
- Requirements: docs/requeriments.md - Complete assignment specifications
- Documentation Index: docs/index.md - All documentation links
Web UI:
/projects- List all projects/projects/:id- Show project with tasks (supports filtering/sorting)/projects/new- Create project/projects/:id/edit- Edit project/projects/:id/tasks/new- Create task/projects/:id/tasks/:task_id/edit- Edit task
API:
GET /api/projects/:project_id/tasks- List tasks (JSON)
This is a coding assignment implementation. No authentication required. Focus is on demonstrating:
- RESTful design patterns
- ActiveRecord scopes and model logic
- Query parameter filtering
- Test coverage of core business logic
- Clean MVC separation
- Add task search functionality
- Add project categories/tags
- Export tasks to CSV
- Task completion statistics dashboard
- Pagination for large task lists
- API pagination and sorting
- Task comments or notes
- Email notifications for overdue tasks
Version: 1.0.0 | Assignment: Rails Task Tracker