A full-stack notes application with React frontend and Flask backend, featuring user authentication and note management capabilities.
This is a complete notes application that allows users to:
- Authentication: Register, login, and logout with JWT token-based authentication
- Note Management: Create, read, update, and delete personal notes
- Frontend: React with TypeScript, using React Router for navigation
- Backend: Flask REST API with SQLAlchemy ORM
- Database: SQLite (default) with support for other databases
- Authentication: JWT tokens with 24-hour expiration
notes_project/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API service functions
│ │ ├── types/ # TypeScript type definitions
│ │ └── App.tsx # Main application component
│ ├── package.json # Frontend dependencies
│ └── README.md # Frontend-specific documentation
├── server/ # Flask backend
│ ├── app.py # Main Flask application
│ ├── models/ # Database models
│ │ ├── user.py # User model with authentication
│ │ └── note.py # Note model
│ ├── requirements.txt # Python dependencies
│ └── instance/ # Database files (auto-generated)
└── README.md # This file
- Node.js (v14 or higher)
- Python (v3.7 or higher)
- pip (Python package manager)
- Navigate to the server directory:
cd server- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install Python dependencies:
pip install -r requirements.txt-
Update the .env file with your local database credentials
-
Run the Flask server:
python app.pyThe backend will start on http://localhost:3001
- Navigate to the client directory:
cd client- Install Node.js dependencies:
npm install- Start the React development server:
npm startThe frontend will start on http://localhost:3000
POST /login- User loginPOST /logout- User logout (requires token)GET /- Home route with token validation
GET /notes- Get all notes for authenticated userPOST /notes- Create a new notePUT /notes/<id>- Update an existing noteDELETE /notes/<id>- Delete a note
Since the application doesn't include a registration endpoint, users must be added manually to the database.
id(Integer, Primary Key) - Unique user identifieremail(String, Unique) - User's email addresspassword(String) - User's password (stored as plain text)token(String, Nullable) - Current JWT tokentoken_expires_at(DateTime, Nullable) - Token expiration time
id(Integer, Primary Key) - Unique note identifiertitle(String) - Note titlecontent(Text) - Note contentuser_id(Integer, Foreign Key) - Reference to user who owns the notecreated_at(DateTime) - Note creation timestampupdated_at(DateTime) - Note last update timestamp


