A Notion-like web application built with Python 3.11, JavaScript, and SQLite.
- User Authentication: Secure registration and login with JWT tokens
- Document Management: Create, edit, and organize documents in folders
- Content Blocks: Create different types of content blocks (paragraphs, headings, lists, code)
- Block Type Switching: Right-click on any block to change its type
- Auto-save: Content is automatically saved as you type
- Hierarchical Navigation: Organize documents in folders with multiple levels of nesting
- Python 3.11 or higher
- pip (Python package manager)
-
Clone the repository or extract the files
-
Install Python dependencies:
pip install -r requirements.txt- Initialize the database and create seed data:
python seed_data.py- Start the Flask backend server:
python backend/app.py- Open your web browser and navigate to:
http://localhost:5000
- Log in with the test credentials:
- Username:
testuser - Password:
password123
- Username:
.
├── backend/
│ ├── models/ # Data models (User, Document, Folder, Block)
│ ├── repositories/ # Database access layer
│ ├── services/ # Business logic
│ ├── routes/ # API endpoints
│ ├── middleware/ # Authentication middleware
│ ├── utils/ # Utility functions (security)
│ ├── database.py # Database connection and initialization
│ └── app.py # Flask application entry point
├── frontend/
│ ├── html/ # HTML pages (login, register, app)
│ ├── css/ # Stylesheets
│ └── js/ # JavaScript modules
├── requirements.txt # Python dependencies
├── seed_data.py # Database seeding script
└── README.md # This file
- Click "New Document" in the sidebar
- Enter a document title
- Click on the document to open it in the editor
- Click "New Folder" in the sidebar
- Enter a folder name
- Drag documents into folders (or create documents directly in folders)
- Add Block: Click the "+ Add Block" button at the bottom of the document
- Edit Block: Click on any block and start typing
- Change Block Type: Right-click on a block and select a new type
- Delete Block: Hover over a block and click the "Delete" button
- Paragraph: Regular text
- Heading 1: Large heading
- Heading 2: Medium heading
- Heading 3: Small heading
- Bullet List: Unordered list item
- Numbered List: Ordered list item
- Code Block: Monospace code formatting
POST /api/auth/register- Register new userPOST /api/auth/login- Login userPOST /api/auth/logout- Logout user
GET /api/documents- Get all documents and foldersPOST /api/documents- Create new documentPUT /api/documents/<id>- Update documentDELETE /api/documents/<id>- Delete document
POST /api/folders- Create new folderDELETE /api/folders/<id>- Delete folder
GET /api/documents/<id>/blocks- Get document blocksPOST /api/blocks- Create new blockPUT /api/blocks/<id>- Update blockDELETE /api/blocks/<id>- Delete blockPUT /api/documents/<id>/blocks/reorder- Reorder blocks
- Password hashing with bcrypt (cost factor 12)
- JWT token-based authentication
- Input sanitization to prevent XSS attacks
- Parameterized SQL queries to prevent SQL injection
- Authorization checks on all protected endpoints
- CORS configuration
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
The application uses:
- Backend: Flask 3.0.0, Flask-CORS, PyJWT, bcrypt
- Frontend: Vanilla JavaScript (ES6+), HTML5, CSS3
- Database: SQLite 3
This project is for educational purposes.
