A full-stack web application for creating, managing, and organizing notes with categories. Built as a Single Page Application (SPA) with separate frontend and backend services.
- ✅ Create, edit, and delete notes
- ✅ Archive/unarchive notes
- ✅ List active notes
- ✅ List archived notes
- ✅ Add/remove categories to notes
- ✅ Filter notes by category
- ✅ Login screen with JWT authentication
- ✅ Protected routes and API endpoints
- ✅ User session management
- Framework: NestJS 11.0.1
- Language: TypeScript 5.7.3
- Database: PostgreSQL
- ORM: TypeORM 0.3.24
- Authentication: JWT with Passport
- Password Hashing: bcrypt
- Architecture: Layered (Controllers, Services, Repositories)
- Framework: React 19.1.0
- Language: TypeScript 4.9.5
- UI Library: Material-UI (MUI) 7.1.0
- HTTP Client: Axios 1.9.0
- Routing: React Router DOM 7.6.1
- RDBMS: PostgreSQL
- Default Configuration: Check environment variables section
- Node.js: 18.0.0 or higher
- npm: Latest version (comes with Node.js)
- PostgreSQL: Latest stable version
- Operating System: Linux (OK) / macOS (to test)
Username: admin
Password: password
These credentials are automatically created when the application starts for the first time.
Run the deployment script that will automatically install dependencies, set up the database, and start both services:
./deploy.shThis script will:
- Check and install system requirements
- Set up PostgreSQL database and user
- Install backend dependencies
- Install frontend dependencies
- Start both backend and frontend services
If you prefer to set up manually:
# Install Node.js 18+ (if not already installed)
# Ubuntu/Debian:
sudo apt-get update
sudo apt-get install -y nodejs
# macOS:
brew install node
# Install PostgreSQL
# Ubuntu/Debian:
sudo apt-get install -y postgresql postgresql-contrib
# macOS:
brew install postgresql# Start PostgreSQL service
# Ubuntu/Debian:
sudo systemctl start postgresql
sudo systemctl enable postgresql
# macOS:
brew services start postgresql
# Create database and user
sudo -u postgres createuser -s postgres
sudo -u postgres psql -c "ALTER USER postgres PASSWORD '1234';"
sudo -u postgres createdb notesdbcd backend
npm install
npm run start:dev# In a new terminal
cd frontend
npm install
npm start- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
- API Documentation: Available through the NestJS application
GET /notes- Get all active notesGET /notes/archived- Get all archived notesPOST /notes- Create a new notePUT /notes/:id- Update a noteDELETE /notes/:id- Delete a notePATCH /notes/:id/archive- Archive a notePATCH /notes/:id/unarchive- Unarchive a note
GET /categories- Get all categoriesPOST /categories- Create a new categoryPATCH /categories/:id- Update a categoryDELETE /categories/:id- Delete a category
A comprehensive Postman collection is available to test all API endpoints:
Collection File: API REST Ensolvers.postman_collection.json
-
Import the Collection:
- Open Postman
- Click "Import" button
- Select the
API REST Ensolvers.postman_collection.jsonfile from the project root - The collection will be imported with all endpoints ready to use
-
Set Environment Variables:
- Set
baseUrltohttp://localhost:3000 - Set
noteIdandcategoryIdvariables as needed for testing specific endpoints
- Set
-
Available Endpoints in Collection:
- Notes: Create, list active/archived, get by ID, update, archive/unarchive, delete
- Categories: Create, list all, get by ID, update, delete
- Advanced: Create notes with categories, update note categories, filter notes by category
- Pre-configured request bodies with example data
- Environment variables for easy endpoint testing
- Complete coverage of all API endpoints
- Organized by functionality (Notes, Categories, Advanced features)
cd backend
# E2E tests
npm run test:e2e
# Test coverage
npm run test:e2e -- -- coverageThe backend supports the following environment variables:
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASS=1234
DB_NAME=notesdb-
PostgreSQL Connection Error
- Ensure PostgreSQL is running:
sudo systemctl status postgresql - Check database credentials in the backend configuration
- Verify database exists:
psql -U postgres -d notesdb
- Ensure PostgreSQL is running:
-
Port Already in Use
- Backend (3001):
lsof -ti:3001 | xargs kill -9 - Frontend (3000):
lsof -ti:3000 | xargs kill -9
- Backend (3001):
-
Node.js Version Issues
- Ensure Node.js 18+ is installed:
node --version - Use nvm to manage Node.js versions if needed
- Ensure Node.js 18+ is installed:
-
Permission Issues
- Make deploy.sh executable:
chmod +x deploy.sh - Run with appropriate permissions for PostgreSQL setup
- Make deploy.sh executable:
The application follows a clean architecture pattern:
- Frontend: React SPA with Material-UI components
- Backend: NestJS with layered architecture (Controllers → Services → Repositories)
- Database: PostgreSQL with TypeORM for data persistence
- Communication: RESTful API between frontend and backend
This project is private and unlicensed.