This is a full-stack note-taking application that allows users to register, login, create, edit, search, and delete notes. The application features a React frontend for the user interface and a Flask backend API for data management.
- User authentication (Register/Login)
- Create and manage personal notes
- Search functionality by note title or ID
- Expand/collapse note content
- Password management with validation
- Responsive design
- API documentation with Swagger UI
- React
- React Router DOM
- Axios for API requests
- Font Awesome for icons
- CSS for styling
- Flask (Python web framework)
- Flask-CORS for cross-origin resource sharing
- Flasgger for API documentation and Swagger UI integration
- Node.js and npm
- Python 3.6 or higher
- pip (Python package installer)
- Clone the repository to your local machine
- Navigate to the backend directory
- Create a virtual environment (recommended) or you can skip to step 5:
python -m venv venv - Activate the virtual environment:
- On Windows:
venv\Scripts\activate - On macOS/Linux:
source venv/bin/activate
- On Windows:
- Install the required dependencies:
pip install flask flask-cors flasgger
- Navigate to the frontend directory
- Install the required npm packages:
npm install - Install additional required packages:
npm install @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons @fortawesome/react-fontawesome axios react-router-dom
- Navigate to the backend directory
- Ensure your virtual environment is activated
- Start the Flask application:
python Notes_app.py - The backend server will run on
http://localhost:5000 - You can access the Swagger UI API documentation at
http://localhost:5000/apidocs/
- Navigate to the frontend directory
- Start the React development server:
npm run dev - The frontend application will run on
http://localhost:3000 - Open your browser and navigate to
http://localhost:3000or click on the link in the terminal
The API is documented using Flasgger, which provides a Swagger UI interface to interact with and test the API endpoints directly from your browser.
- Start the backend server
- Open your browser and navigate to
http://localhost:5000/apidocs/ - The Swagger UI interface will display all available endpoints
- You can expand each endpoint to see details, required parameters, and response formats
- You can also test the API directly from the Swagger UI by providing the required parameters and clicking "Try it out"
The API endpoints are documented in the code using docstrings with YAML syntax for Swagger. Each endpoint includes:
- Tags for categorization
- Parameters (path, query, or body)
- Request schemas
- Response codes and descriptions
The application provides the following RESTful API endpoints:
- URL:
/api/notes - Method:
POST - Request Body:
{ "title": "Note Title", "content": "Note Content" } - Success Response:
201 Created - Error Response:
400 Bad Requestif title or content is missing
- URL:
/api/notes - Method:
GET - Success Response:
200 OKwith array of notes
- URL:
/api/notes/<note_id> - Method:
GET - URL Parameters:
note_id=[integer] - Success Response:
200 OKwith note object - Error Response:
404 Not Foundif note doesn't exist
- URL:
/api/notes/<note_id> - Method:
PUT - URL Parameters:
note_id=[integer] - Request Body:
{ "title": "Updated Title", "content": "Updated Content" } - Success Response:
200 OK - Error Response:
404 Not Foundif note doesn't exist
- URL:
/api/notes/<note_id> - Method:
DELETE - URL Parameters:
note_id=[integer] - Success Response:
200 OKwith confirmation message
- Notes are stored in an in-memory Python array
- Data is non-persistent and will be lost when the server restarts
- Each note has an ID, title, and content
- User authentication data is stored in the browser's localStorage
- This includes user credentials and login status
This project includes unit tests for both the backend (Flask) and frontend (React) components.
- The backend tests use Flask’s built-in
test_clientto verify the core functionality of the API endpoints. - test_app.py To run this -> pytest test_app.py
- Navigate to -> src\Testfiles\Auth_form.test.jsx ans make sure there is a setupTests.js
To run this -> npx vitest
The application uses localStorage for user authentication. User credentials are stored locally and validated on login. In a production environment, this should be replaced with a more secure authentication system.
- Implement server-side user authentication
- Add database integration for persistent storage
- Add categories and tags for notes
- Implement rich text editing