{"id":22080338,"url":"https://github.com/theakashshukla/todo-api","last_synced_at":"2026-04-02T04:45:22.018Z","repository":{"id":202665802,"uuid":"707863191","full_name":"theakashshukla/todo-api","owner":"theakashshukla","description":"Todo API - ORM, JWT, Postgres","archived":false,"fork":false,"pushed_at":"2023-10-20T21:44:36.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T04:22:18.360Z","etag":null,"topics":["docker","expressjs","jwt","nodejs","orm","orm-framework","postgresql"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theakashshukla.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-20T20:47:07.000Z","updated_at":"2023-11-05T02:05:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"09235f96-f215-484e-bbdf-769fec38e99e","html_url":"https://github.com/theakashshukla/todo-api","commit_stats":null,"previous_names":["theakashshukla/todo-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theakashshukla%2Ftodo-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theakashshukla%2Ftodo-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theakashshukla%2Ftodo-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theakashshukla%2Ftodo-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theakashshukla","download_url":"https://codeload.github.com/theakashshukla/todo-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245168817,"owners_count":20571799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","expressjs","jwt","nodejs","orm","orm-framework","postgresql"],"created_at":"2024-11-30T23:13:50.762Z","updated_at":"2025-12-30T19:27:15.403Z","avatar_url":"https://github.com/theakashshukla.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TODO API\n\nA simple TODO API built with Node.js, Express, and PostgreSQL.\n\n## Table of Contents\n\n- [Features](#features)\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n- [Usage](#usage)\n  - [Authentication](#authentication)\n- [API Endpoints](#api-endpoints)\n  - [User Routes](#user-routes)\n  - [TODO Routes](#todo-routes)\n- [Docker Compose](#docker-compose)\n\n## Features\n\n- User registration and authentication.\n- Create, update, delete, and list TODO items.\n- Persistent data storage using PostgreSQL.\n- Docker Compose setup for local development.\n\n## Getting Started\n\n### Prerequisites\n\nBefore you begin, ensure you have met the following requirements:\n\n- Node.js and npm installed.\n- Docker and Docker Compose installed if you plan to use the provided Docker setup.\n- PostgreSQL or a Dockerized PostgreSQL instance.\n\n### Installation\n\n1. Clone the repository:\n\n```shell\ngit clone https://github.com/theakashshukla/todo-api.git\n``` \n\n2. Change to the project directory:\n```shell\ncd todo-api\n```\n\n3. Install project dependencies:\n\n```shell\nnpm install\n```\n\n5. Create a `.env` file in the project root and configure your environment variables. Here's an example:\n```shell\nPORT=3000\nPOSTGRES_URL=postgres://postgres:your_password@db:5432/your_database\nJWT_SECRET=your_secret_key\n```\n\n6. Start the application:\n```shell\nnpm start\n```\n\n## Usage\n\n- Access the application at `http://localhost:3000`.\n\n### Authentication\n\n- Register a new user by sending a POST request to `/api/auth/register`.\n- Obtain a JWT token by sending a POST request to `/api/auth/login` with your user credentials.\n- Use the JWT token in the `Authorization` header of your requests to protected routes.\n\n## API Endpoints\n\n### User Routes\n\n- **POST /api/auth/register**: Register a new user.\n\n```json\n{\n \"username\": \"newuser\",\n \"email\": \"newuser@example.com\",\n \"password\": \"password\"\n}\n```\nPOST /api/auth/login: Authenticate a user and get a JWT token.\n```json\n{\n  \"email\": \"newuser@example.com\",\n  \"password\": \"password\"\n}\n```\n## TODO Routes\n### POST /api/todos: Create a new TODO item.\n```json\n{\n  \"title\": \"New Task\",\n  \"description\": \"A description of the task\",\n  \"completed\": false\n}\n```\n### GET /api/todos: Get all TODO items.\n\n### GET /api/todos/:id: Get a specific TODO item.\n\n### PUT /api/todos/:id: Update a TODO item.\n\n```json\n{\n  \"title\": \"Updated Task\",\n  \"description\": \"Updated description\",\n  \"completed\": true\n}\n```\n#### DELETE /api/todos/:id: Delete a TODO item.\n\n### Docker Compose\nYou can run this application using Docker Compose. Make sure you have Docker and Docker Compose installed, then use the provided docker-compose.yml to set up the application and PostgreSQL database.\n\nSave the docker-compose.yml file to your project directory.\n\nUpdate the .env file with the PostgreSQL configuration.\n\nRun the application:\n\n```shell\ndocker-compose up\n```\nThe application should be accessible at http://localhost:3000.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheakashshukla%2Ftodo-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheakashshukla%2Ftodo-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheakashshukla%2Ftodo-api/lists"}