- Python 3.11+ installed
- Node.js 18+ installed
- pip package manager
- npm package manager
-
Navigate to backend directory
cd backend/notes_project -
Create and activate virtual environment
python3 -m venv venv # On macOS/Linux: source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Python dependencies
pip install -r ../requirements.txt
This installs:
- Django 5.0.1
- djangorestframework 3.14.0
- djangorestframework-simplejwt 5.3.1
- django-cors-headers 4.3.1
-
Create database and run migrations
python manage.py makemigrations python manage.py migrate
-
Seed initial categories
python manage.py seed_categories
This creates 4 categories:
- Random Thoughts (#E8B4A0)
- School (#F4E4C1)
- Personal (#B8D4D1)
- Drama (#D4D8B8)
-
Create admin superuser (optional but recommended)
python manage.py createsuperuser
Follow prompts to set username, email, and password.
-
Start Django development server
python manage.py runserver
✅ Backend should now be running at:
http://localhost:8000✅ Admin panel accessible at:http://localhost:8000/admin✅ API docs at:http://localhost:8000/api/
-
Open a NEW terminal window (keep backend running)
-
Navigate to frontend directory
cd frontend -
Install Node.js dependencies
npm install
This installs:
- React 18.2.0
- React Router v6
- Axios
- Tailwind CSS
- Vite
-
Start React development server
npm run dev
✅ Frontend should now be running at:
http://localhost:5173✅ Browser should auto-open
-
Open browser to
http://localhost:5173 -
Create an account
- Click "Oops! I've never been here before"
- Enter email and password (8+ characters)
- Click "Sign Up"
-
Create your first note
- Click "+ New Note" button
- Select a category
- Add title and content
- Close editor (autosaves automatically)
-
Test features
- Create multiple notes
- Filter by category in sidebar
- Edit existing notes
- View version history (after editing a note)
- Press
Nkey to create new note
Error: "ModuleNotFoundError: No module named 'django'"
- Solution: Make sure virtual environment is activated
- Run:
source venv/bin/activate(orvenv\Scripts\activateon Windows)
Error: "Port 8000 already in use"
- Solution: Kill existing Django process or use different port
- Run:
python manage.py runserver 8001
Error: "No such table: notes_api_category"
- Solution: Run migrations
- Run:
python manage.py migrate
Error: "Cannot find module 'react'"
- Solution: Install dependencies
- Run:
npm install
Error: "Failed to fetch"
- Solution: Make sure backend is running on port 8000
- Check
.envfile has:VITE_API_URL=http://localhost:8000/api
Error: CORS issues
- Solution: Check Django CORS settings in
settings.py - Verify
CORS_ALLOWED_ORIGINSincludeshttp://localhost:5173
Want to reset database?
# Stop Django server (Ctrl+C)
rm db.sqlite3
python manage.py migrate
python manage.py seed_categories
python manage.py createsuperuser # optional
python manage.py runserver-
Terminal 1: Backend (Django)
cd backend/notes_project source venv/bin/activate python manage.py runserver
-
Terminal 2: Frontend (React)
cd frontend npm run dev
- Backend changes: Django auto-reloads on file save
- Frontend changes: Vite hot-reloads on file save
- Model changes: Run
python manage.py makemigrationsthenpython manage.py migrate
Using curl or Postman:
-
Register user
curl -X POST http://localhost:8000/api/auth/register/ \ -H "Content-Type: application/json" \ -d '{"email": "test@example.com", "password": "testpass123"}'
-
Login
curl -X POST http://localhost:8000/api/auth/login/ \ -H "Content-Type: application/json" \ -d '{"email": "test@example.com", "password": "testpass123"}'
Copy the
accesstoken from response. -
Get notes
curl http://localhost:8000/api/notes/ \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
-
Backend:
- Change
SECRET_KEYin settings.py - Set
DEBUG = False - Use PostgreSQL instead of SQLite
- Configure
ALLOWED_HOSTS - Set up proper CORS origins
- Use environment variables for secrets
- Change
-
Frontend:
- Build production bundle:
npm run build - Update
VITE_API_URLto production API URL - Deploy
dist/folder to static hosting
- Build production bundle:
-
Security:
- Use HTTPS for all connections
- Consider httpOnly cookies instead of localStorage for tokens
- Set up rate limiting
- Configure CSP headers
Check the main README.md for:
- Architecture decisions
- API documentation
- Feature list
- Known limitations
You're all set! Start building your notes! 📝