Rails Task Management API: README

Overview

This Rails Task Management API provides a robust solution for managing tasks, users, and their assignments. Designed with simplicity and scalability in mind, it offers a comprehensive set of features suitable for a wide range of task management needs.

Setup

To get started with the Rails Task Management API, follow these steps:

  1. Clone the repository:

    git clone https://github.com/SyedAman/TasksAPI.git
  2. Navigate to the project directory:

    cd TasksAPI
  3. Install dependencies:

    bundle install
  4. Set up the database:

    rails db:create db:migrate db:seed
  5. Start the Rails server:

    rails server

Now, the API should be up and running on http://localhost:3000.

Testing

The API uses RSpec for testing. Tests are located in the spec directory, with subdirectories for models, requests, and services. To run the tests, execute:

rspec

This will run the entire test suite and output the results.

API Endpoints

The API provides the following endpoints:

  • Users:

    • GET /api/users: List all users.
    • POST /api/users: Create a new user.
    • GET /api/users/:id: Show a single user.
    • PUT /api/users/:id: Update a user.
    • DELETE /api/users/:id: Delete a user.
  • Tasks:

    • GET /api/tasks: List all tasks.
    • POST /api/tasks: Create a new task.
    • GET /api/tasks/:id: Show a single task.
    • PUT /api/tasks/:id: Update a task.
    • DELETE /api/tasks/:id: Delete a task.
    • POST /api/tasks/:id/assign: Assign a task to a user.
    • PUT /api/tasks/:id/progress: Update task progress.
  • Statistics and Filters:

    • GET /api/tasks/overdue: List all overdue tasks.
    • GET /api/tasks/status/:status: List tasks by status (pending, completed, etc.).
    • GET /api/tasks/completed: List tasks completed within a certain date range.
    • GET /api/tasks/statistics: Get statistical data of tasks.

Each endpoint supports standard RESTful actions and returns JSON responses.

Room for Improvement

While the API covers basic task management functionality, there are several areas where it could be enhanced:

  • API Versioning: Implementing versioning can help manage changes more effectively and maintain compatibility.
  • Authentication and Authorization: Adding user authentication and role-based access control would enhance security.
  • Performance Optimization: Implementing caching and query optimization could improve response times and reduce server load.
  • Real-time Updates: Utilizing ActionCable for WebSocket connections could allow real-time updates for task changes.
  • Comprehensive Testing: Expanding the test suite to cover edge cases and failure scenarios would improve reliability.

These enhancements would provide a more robust and user-friendly API, catering to a broader range of task management needs.