ToDo-APIs

Todo API in TypeScript

A simple RESTful Todo API built with TypeScript and Express. This application provides endpoints for creating, reading, updating, and deleting Todo items. For simplicity, it uses an in-memory store (an array) to keep track of todos.

Table of Contents

Overview

This project is a minimal Todo API written in a single TypeScript file (app.ts). It uses Express for handling HTTP requests, body-parser for parsing JSON request bodies, and uuid for generating unique identifiers. The API supports full CRUD (Create, Read, Update, Delete) operations on Todo items.

Features

Project Structure

todo-api/
├── app.ts            # Main application file with the full API implementation
├── package.json      # Project metadata and dependencies
├── tsconfig.json     # TypeScript compiler configuration
└── .gitignore        # Files/folders to ignore in Git

Tech Stack

Installation

  1. Clone the Repository

    git clone https://github.com/your-username/todo-api.git
    cd todo-api
    
  2. Install Dependencies

    Make sure you have Node.js installed. Then run:

    npm install
    

Configuration

This project uses default settings and does not require additional configuration. The server runs on port 3000 by default. You can change the port by setting the PORT environment variable.

Usage

Running the Application

For development, you can use ts-node to run the app without compiling:

npm start

This will start the server on http://localhost:3000.

API Endpoints

The following endpoints are available:

Development

For local development, use ts-node to run the TypeScript application without compiling:

npm start

If you prefer compiling to JavaScript, run:

npm run build

Then execute the compiled JavaScript from the dist folder:

node dist/app.js

Build & Deployment

Testing

You can use tools like Postman or curl to test the API endpoints. Automated testing can be added using frameworks such as Mocha or Jest if required.

Troubleshooting

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a feature branch (e.g., git checkout -b feature/my-new-feature).
  3. Commit your changes with clear commit messages.
  4. Push your branch to your fork and create a pull request.
  5. Follow any additional guidelines provided in the repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Enjoy using the Todo API, and feel free to extend it with persistent storage, authentication, and more advanced features!