Security Features:
- Added User model with bcrypt password hashing
- Implemented Flask-Login for session management
- Protected all API write operations with @login_required decorator
- Added authentication routes (login/logout)
Admin Dashboard:
- Created comprehensive admin dashboard with statistics
- Profile management interface
- Skills management (add/edit/delete)
- Projects management with full CRUD operations
- Social links management
- Modern responsive UI with Bootstrap 5
New Files:
- models.py: Added User model with bcrypt
- routes/auth.py: Login/logout functionality
- routes/admin.py: Complete admin dashboard with CRUD operations
- templates/auth/login.html: Login page
- templates/admin/base.html: Admin base template
- templates/admin/dashboard.html: Main dashboard
- templates/admin/profile.html: Profile editor
- templates/admin/skills.html: Skills manager
- templates/admin/projects.html: Projects list
- templates/admin/project_form.html: Project editor
- templates/admin/social_links.html: Social links manager
Modified Files:
- app.py: Integrated Flask-Login and bcrypt, registered new blueprints
- requirements.txt: Added Flask-Login, Flask-Bcrypt, bcrypt
- init_db.py: Creates default admin user (admin/admin123)
- routes/api.py: Protected all write operations with authentication
Default Credentials:
- Username: admin
- Password: admin123
- ⚠️ MUST be changed after first login!
Benefits:
- Secure API access with session-based authentication
- User-friendly admin interface for content management
- No need to edit code or database directly
- Bcrypt password hashing for security
- Protected against unauthorized access
38 lines
647 B
Plaintext
38 lines
647 B
Plaintext
# Core Flask Framework
|
|
Flask==3.1.0
|
|
Jinja2==3.1.5
|
|
Werkzeug==3.1.3
|
|
click==8.1.8
|
|
itsdangerous==2.2.0
|
|
MarkupSafe==3.0.2
|
|
blinker==1.9.0
|
|
|
|
# Authentication
|
|
Flask-Login==0.6.3
|
|
Flask-Bcrypt==1.0.1
|
|
bcrypt==4.2.1
|
|
|
|
# Database - Flask-SQLAlchemy and MariaDB/MySQL driver
|
|
Flask-SQLAlchemy==3.1.1
|
|
SQLAlchemy==2.0.36
|
|
PyMySQL==1.1.1
|
|
cryptography==44.0.0
|
|
|
|
# Configuration Management
|
|
pydantic==2.10.4
|
|
pydantic-settings==2.7.1
|
|
pydantic_core==2.27.2
|
|
python-dotenv==1.0.1
|
|
annotated-types==0.7.0
|
|
typing_extensions==4.12.2
|
|
|
|
# Testing
|
|
httpx==0.27.0
|
|
pytest==8.3.4
|
|
|
|
# Documentation
|
|
Sphinx==8.2.3
|
|
|
|
# WSGI Server (Production alternative to Flask dev server)
|
|
gunicorn==23.0.0
|