A small notes app with:
- User login (username + password). The default user is
admin. - List personal notes
- Create, edit, delete notes
Frontend: React + TypeScript + Vite (lives in frontend/)
Backend: Flask + SQLAlchemy + JWT (lives in backend/)
Database: SQLite by default - override with a connection string
- Python 3.11.13
- Node 18+
- Git recommended
From the project root:
./run.shThis will:
Create/activate a Python venv in backend/.venv
Install backend dependencies
Start the Flask API at http://127.0.0.1:5000
Install frontend dependencies
Start the Vite dev server at http://127.0.0.1:5173
Stop with Ctrl+C.
cd backend
python -m venv .venv
source .venv/bin/activate
.\.venv\Scripts\Activate.ps1
Then run:
pip install -r requirements.txt
cp .env.example .env
python manage.py initdb --database-url sqlite:///./notes.db --seed-username admin --seed-password password
python wsgi.py
GET http://127.0.0.1:5000/health
You have two options.
cd backend
python manage.py initdb --database-url sqlite:///./notes.db --seed-username admin --seed-password password
Seeds a default user admin with password password.
The schema lives in backend/schema.sql.
SQLite:
cd backend
sqlite3 notes.db < schema.sql
Postgres:
psql "$DATABASE_URL" -f backend/schema.sql
You must manually insert the admin user if you use schema.sql directly.
cd frontend
npm install
npm run dev
Make sure your .env in frontend/ points to the backend:
VITE_API_BASE=http://127.0.0.1:5000
Body: { "username": string, "password": string } Returns: { token, user: { id, username } } Use Authorization: Bearer header for the calls below.
List notes for the authenticated user.
Body: { "title": string, "content": string } Create a note.
Body: { "title"?: string, "content"?: string } Update a note.
Delete a note.
401 errors → Make sure you send Authorization: Bearer header after login.
CORS errors → Confirm backend is running at VITE_API_BASE and Flask CORS is enabled.
DB missing → Run manage.py initdb or apply schema.sql and seed the admin user.