-
Create Task
- Endpoint:
POST /tasks
- Description: Adds a new task with details such as title, description, priority, due date, and category.
- Endpoint:
-
Get All Tasks
- Endpoint:
GET /tasks
- Description: Retrieves all tasks, with optional query parameters to filter by category, priority, or due date.
- Endpoint:
-
Get Task by ID
- Endpoint:
GET /tasks/{taskId}
- Description: Fetches the details of a specific task based on its ID.
- Endpoint:
-
Update Task
- Endpoint:
PUT /tasks/{taskId}
- Description: Updates the attributes of an existing task.
- Endpoint:
-
Delete Task
- Endpoint:
DELETE /tasks/{taskId}
- Description: Removes a task from the database.
- Endpoint:
-
Batch Update Tasks
- Endpoint:
PATCH /tasks/batch
- Description: Allows updating multiple tasks at once, such as changing status or category. It is designed to utilize concurrency for efficient processing.
- Endpoint:
-
Create Category
- Endpoint:
POST /categories
- Description: Creates a new task category with a name and description.
- Endpoint:
-
Get All Categories
- Endpoint:
GET /categories
- Description: Retrieves a list of all categories along with their descriptions.
- Endpoint:
-
Update Category
- Endpoint:
PUT /categories/{categoryId}
- Description: Updates the name or description of an existing category.
- Endpoint:
-
Delete Category
- Endpoint:
DELETE /categories/{categoryId}
- Description: Deletes a specific category. Requires handling tasks that may be associated with the category.
- Endpoint:
- Columns:
id
: Primary key, unique identifier for each task.title
: Title of the task.description
: Detailed description of the task.priority
: Priority level (e.g., High, Medium, Low).due_date
: The due date for the task completion.category_id
: Foreign key linking to the Category table.status
: Current status of the task (e.g., Pending, Completed).
- Columns:
id
: Primary key, unique identifier for each category.name
: Name of the category.description
: Description of what the category is about.
- Framework and Libraries: Choose frameworks and libraries that are idiomatic to the language (Go or Rust) for web server setup, routing, handling requests, and interacting with the database.
- Concurrency: For endpoints like the batch update, leverage the concurrency features of Go (goroutines and channels) or Rust (async/await, threads) to improve performance.
- Security and Validation: Implement necessary validations for input data to prevent SQL injection and ensure data integrity. Use HTTPS to encrypt data in transit.
- Testing: Develop unit and integration tests to cover the functionality of your endpoints and database operations.
- Documentation: Document your API using tools like Swagger or Postman to make it easy for other developers to understand and use your API.
This comprehensive setup offers a solid foundation for learning about web API development, database management, and concurrency in Go or Rust, along with the application of best practices in software development.