A full-stack notes application built with Django REST Framework (backend) and React (frontend).
- User Authentication: Secure registration and login with JWT tokens
- CRUD Operations: Create, Read, Update, and Delete notes
- User-specific Notes: Each user can only see and manage their own notes
- Auto Token Refresh: Automatic token refresh on expiry
- Modern UI: Clean and responsive user interface
- Python 3.8 or higher
- Node.js 16 or higher
- npm or yarn
cd backend# Windows
python -m venv venv
venv\Scripts\activate
# macOS/Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtThe .env file is already created with SQLite configuration. For production or if you want to use PostgreSQL:
# Database Configuration
DB_NAME=your_database_name
DB_USER=your_database_user
DB_PWD=your_database_password
DB_HOST=localhost
DB_PORT=5432
# Django Secret Key
SECRET_KEY=your-secret-key-herepython manage.py makemigrations
python manage.py migratepython manage.py createsuperuserpython manage.py runserverThe backend will be available at http://127.0.0.1:8000
cd frontendnpm installThe .env file is already configured. Update if needed:
VITE_API_URL=http://127.0.0.1:8000npm run devThe frontend will be available at http://localhost:5173
- Navigate to
http://localhost:5173/register - Enter a username and password
- Click "Register"
- Navigate to
http://localhost:5173/login - Enter your credentials
- Click "Login"
- After logging in, you'll see the home page
- Scroll to the "Create a Note" form
- Enter a title and content
- Click "Create Note"
- Click the "Edit" button on any note
- The form will populate with the note's content
- Make your changes and click "Update Note"
- Click the "Delete" button on any note
- Confirm the deletion
- Click the "Logout" button in the top-right corner
POST /api/user/register/- Register a new userPOST /api/token/- Login and get access/refresh tokensPOST /api/token/refresh/- Refresh access token
GET /api/notes/- List all notes for authenticated userPOST /api/notes/- Create a new notePUT /api/notes/update/<id>/- Update a specific noteDELETE /api/notes/delete/<id>/- Delete a specific note
- Django 5.1
- Django REST Framework
- djangorestframework-simplejwt (JWT authentication)
- django-cors-headers (CORS support)
- PostgreSQL/SQLite (database)
- React 18
- Vite
- React Router DOM
- Axios
- jwt-decode
Port already in use:
python manage.py runserver 8001Database connection errors:
- Ensure PostgreSQL is running (if using PostgreSQL)
- Verify database credentials in
.env - For development, the app uses SQLite by default
Migration errors:
python manage.py migrate --run-syncdbPort already in use:
npm run dev -- --port 5174API connection errors:
- Verify backend is running on
http://127.0.0.1:8000 - Check CORS settings in backend
- Ensure
.envhas correct API URL
Module not found errors:
rm -rf node_modules package-lock.json
npm install- Backend admin panel:
http://127.0.0.1:8000/admin/ - Check browser console for frontend errors
- Check terminal for backend errors
- JWT tokens expire after 30 minutes (configurable in settings.py)
- Set
DEBUG = Falsein settings.py - Set proper
ALLOWED_HOSTS - Use environment variables for sensitive data
- Use PostgreSQL database
- Configure static files serving
- Use a production WSGI server (gunicorn, uWSGI)
- Build the production bundle:
npm run build- Serve the
distfolder using a web server - Update
VITE_API_URLto production backend URL
This project is open source and available under the MIT License.