Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 2.23 KB

api-todo-list.md

File metadata and controls

46 lines (32 loc) · 2.23 KB

Backend Challenge - Simple TODO List API

Introduction

The "Simple TODO List API" challenge is designed to build a RESTful API that allows users to manage a list of tasks.

Objectives

  • Set up a web server capable of handling API requests.
  • Implement endpoints for creating, reading, updating, and deleting tasks.
  • Store tasks persistently (e.g., in-memory, database).
  • Understand HTTP methods (GET, POST, PUT, DELETE) and status codes.

Instructions

  1. Objective: Develop a RESTful API that manages a TODO list of tasks.

  2. Environment Setup: Choose your preferred programming language (e.g., JavaScript, Python, Java, C#) and set up the necessary environment.

  3. Implementation Details:

    • Define endpoints (/tasks) for handling CRUD operations:
      • GET /tasks: Retrieve all tasks.
      • POST /tasks: Create a new task.
      • GET /tasks/{id}: Retrieve a specific task by ID.
      • PUT /tasks/{id}: Update an existing task.
      • DELETE /tasks/{id}: Delete a task by ID.
    • Implement logic to interact with task data (e.g., store tasks in memory, use a database).
    • Return task data as JSON in responses.
  4. Testing: Test your API using a HTTP client (e.g., Postman, curl).

    • Send requests to each endpoint (/tasks) with appropriate data payloads (e.g., JSON for creating/updating tasks).
    • Verify that the responses contain the expected task data and that status codes are appropriate (e.g., 200 OK, 404 Not Found).

Possible Improvements

  • Authentication: Add user authentication to secure the API endpoints.
  • Pagination: Implement pagination for GET /tasks endpoint to handle large datasets.
  • Validation: Validate input data to ensure task properties meet expected criteria (e.g., task description length).
  • Error Handling: Enhance error messages and responses for better user experience.
  • Sorting and Filtering: Add capabilities to sort and filter tasks based on different criteria (e.g., due date, status).

Conclusion

By completing this challenge, you will gain practical experience in developing a basic TODO list API and learn essential practices for backend development. Explore additional improvements and challenges to further enhance your skills.

Happy coding!