This repository contains the backend code for a To-Do notes web application developed using Node.js and Express.
The application provides the following APIs:
- Create a new to-do note
- Get the existing to-do notes list with pagination
- Update an existing to-do note
- Upload an image (optional) to be stored with a note
- Delete an existing to-do note
- Node.js
- Express.js
- PostgreSQL (RDBMS)
- Joi (for request input validation)
- Multer (for handling file uploads)
To run the application on your local machine, follow these steps:
- Clone this repository to your local machine:
git clone https://github.com/sahanilxm/ToDo_Backend.git
- Navigate to the project directory:
cd todo_backend
- Install the dependencies:
npm install
-
Set up your PostgreSQL database.
-
Create a
.env
file in the root directory and update the following information:
PORT = 'portnumber'
USER = 'your_db_user'
PASS = 'your_db_password'
HOST = 'localhost'
DB = 'your_db_name'
-
Execute the SQL file models/note.schema.sql in your PostgreSQL database management tool (e.g., pgAdmin, psql) to create the necessary database and tables.
-
Start the server:
npm start