This is a full-stack Notes application developed with NestJS for the backend and Angular for the frontend. It allows users to:
- Create, read, update, and delete notes.
- Organize notes by categories.
- Archive notes.
- Backend: A REST API built with NestJS and PostgreSQL to handle CRUD operations for notes.
- Frontend: A single-page application (SPA) built with Angular that allows users to interact with the Notes API.
- User Stories:
- Users can create, update, archive, and delete notes.
- Notes are displayed in lists based on their status (active or archived).
- Notes can be organized by categories.
-
Frontend:
- Angular v19
- Angular CLI
- Reactive Forms
-
Backend:
- NestJS v10.4.9
- PostgreSQL (database)
- TypeORM (ORM)
-
Development Tools:
- Node.js v18.19.1
- npm v10.5.0
- Node.js v18.19.1
- npm v10.5.0
- PostgreSQL
- NestJS v10.4.9
- Angular v19
- TypeORM
-
Clone the repository:
git clone https://github.com/ensolvers-github-challenges/Muzaber-96fe1f cd ToDoChallenge
-
Ensure you have Node.js, npm, and PostgreSQL installed.
-
Configure the database:
- Create a database in PostgreSQL.
- Update the
ormconfig.json
file in the backend with your PostgreSQL credentials.
To run the application, simply execute the start.sh
script:
./start.sh
This script will:
- Configure the database using TypeORM.
- Install dependencies for both the backend and frontend.
- Start the backend (NestJS) and frontend (Angular) servers.
Follow these steps to set up the project locally:
git clone https://github.com/ensolvers-github-challenges/Muzaber-96fe1f
cd ToDoChallenge
Navigate to the backend folder and install the dependencies:
cd backend
npm install
Configure environment variables for NestJS:
Create a .env
file in the root of the backend folder with the following content:
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=your-username
DB_PASSWORD=your-password
DB_DATABASE=notes_db
Navigate to the frontend folder and install the dependencies:
cd frontend
npm install
Start the backend (NestJS):
cd backend
npm run start:dev
The backend will be available at http://localhost:3000.
Start the frontend (Angular):
cd frontend
ng serve
The frontend will be available at http://localhost:4200.
Once both the frontend and backend are running:
Open the browser and navigate to http://localhost:4200. You should be able to create, update, delete, and archive notes.
The backend exposes RESTful endpoints to perform CRUD operations on notes. CORS is enabled to allow requests from the frontend (Angular).
POST /notes
: Create a new note.GET /notes
: Get all active notes.PATCH /notes/:id
: Update a note by ID.DELETE /notes/:id
: Delete a note by ID.GET /notes/archived
: Get archived notes.
This project is licensed under the MIT License - see the LICENSE file for details.