This repository holds back-end of the Note App. It's front-end available at the link.
The Notes App is an application that allows users to manage their notes effectively. Users can add, edit, and delete notes. Additionally, notes can be archived and unarchived for better organization.
- TypeScript
- Express
- Docker
- PostgreSQL
Before running the application, ensure you have the following prerequisites installed on your system:
- Node.js
- Docker
- Clone project from repository
git clone https://github.com/marharita08/notes-express
. - Navigate to project folder
cd notes-express
. - Install the necessary npm packages
npm install
. - Build the application
npm run build
. - Update
.env
if it is necessary. - Run the application
docker-compose up
. - Install and run front-end.
The API receives data in the request body in JSON format.
- POST /notes - create new note. Required request body fields:
- name;
- category_id (available categories: Task (id:1), Idea (id:2), Random Thought(id:3));
- content.
- DELETE /notes/:id - delete note by id. Request body should be empty.
- PATCH /notes/:id - update note. Required request body fields:
- name;
- category_id (available categories: Task (id:1), Idea (id:2), Random Thought(id:3));
- content;
- PATCH /notes/archive/:id - archive/unarchive note. Required request body fields:
- archived (true or false);
- GET /notes/:id - retrieve note by id. Request body should be empty.
- GET /notes - get all notes. Request body should be empty.
- GET /notes/stats - get aggregated data statistics. Request body should be empty.
- GET /notes/active - get active (not archived) notes. Request body should be empty.
- GET /notes/archived - get archived notes. Request body should be empty.
- GET /categories - get all categories. Request body should be empty.