A simple and flexible Todo API built with Express.js and PostgreSQL, using Sequelize as the ORM.
- CRUD operations for managing todo items.
- Sequelize ORM for database interactions.
- Express.js for handling HTTP requests and routing.
- PostgreSQL as the database.
- Well-organized project structure for easy maintenance.
Make sure you have the following installed:
- Node.js (at least version 12)
- PostgreSQL
-
Clone the repository:
git clone https://github.com/emreozturanli/express-todo.git
-
Navigate to the project directory:
cd express-todo
-
Install dependencies:
npm install
-
Create a PostgreSQL database for the project.
-
Copy the
.env.example
file to a new file named.env
and update the database connection details:DATABASE_URL=postgresql://username:password@localhost:5432/your_database
Start the server:
npm run dev
The API will be available at http://localhost:8000
by default.
GET /todos
: Get all todos.GET /todos/:id
: Get a specific todo.POST /todos
: Create a new todo.PUT /todos/:id
: Update a todo.DELETE /todos/:id
: Delete a todo.
This project uses Sequelize as the ORM. You can find the database models in the models
directory.
Feel free to contribute by opening issues or creating pull requests.
Feel free to customize the sections and add any other relevant information specific to your project.