A comprehensive note-taking web application built with Flask, featuring full CRUD operations and REST API endpoints.
- Create, Read, Update, Delete (CRUD) operations for notes
- Tagging system for organizing notes
- Search functionality across titles and content
- RESTful API with full CRUD endpoints
- Responsive web interface
- SQLite database for data persistence
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/notes |
Get all notes (supports search and tag filtering) |
| GET | /api/notes/<id> |
Get a specific note by ID |
| POST | /api/notes |
Create a new note |
| PUT | /api/notes/<id> |
Update an existing note |
| DELETE | /api/notes/<id> |
Delete a note |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/tags |
Get all unique tags |
{
"id": 1,
"title": "My Note Title",
"content": "Note content goes here...",
"tags": "work,important,flask",
"created_at": "2024-01-15T10:30:00",
"updated_at": "2024-01-15T14:45:00"
}-
Clone the repository
git clone <repository-url> cd note-taking_flask_app
-
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Initialize database
python -c "from models import Base, engine; Base.metadata.create_all(bind=engine)" -
Run the application
python app.py
- Visit
http://localhost:5000to access the web interface - Use the navigation to access different pages
curl -X POST http://localhost:5000/api/notes \
-H "Content-Type: application/json" \
-d '{
"title": "My First Note",
"content": "This is the content of my first note",
"tags": "personal,important"
}'curl http://localhost:5000/api/notescurl "http://localhost:5000/api/notes?search=flask"curl "http://localhost:5000/api/notes?tag=work"curl -X PUT http://localhost:5000/api/notes/1 \
-H "Content-Type: application/json" \
-d '{
"title": "Updated Note Title",
"content": "Updated content"
}'curl -X DELETE http://localhost:5000/api/notes/1id(INTEGER, PRIMARY KEY)title(VARCHAR(200), NOT NULL)content(TEXT, NOT NULL)tags(VARCHAR(500), NULLABLE)created_at(DATETIME, DEFAULT: current timestamp)updated_at(DATETIME, DEFAULT: current timestamp, ON UPDATE: current timestamp)
note-taking_flask_app/
├── app.py # Main application file
├── api.py # REST API endpoints
├── models.py # Database models
├── forms.py # WTForms definitions
├── config.py # Configuration settings
├── requirements.txt # Python dependencies
├── database.db # SQLite database (created on first run)
├── README.md # This file
├── templates/ # HTML templates
├── static/ # CSS, JS, and image files
└── error.log # Application logs
- Update the database model in
models.py - Add corresponding API endpoints in
api.py - Update the web interface in
app.py - Add appropriate tests
The application includes basic error handling and validation. For comprehensive testing:
- Test all CRUD operations via API
- Verify tag filtering and search functionality
- Check error handling for invalid inputs
- Test database transactions
- Create a Heroku app
- Set environment variables
- Deploy using Git
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "app.py"]- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is open source and available under the MIT License.