A Flask-based web application designed with a strong focus on security, user experience, and kawaii-inspired design.
It provides:
- User authentication (register, login, logout)
- Password reset via secure email tokens
- REST API endpoints for integration
- Responsive templates with Bootstrap 5, Google Fonts, Font Awesome, Material Icons, and SweetAlert2 flash messages
- Playful animations and interactions for a delightful UI/UX
- Framework: Flask (Python)
- ORM: SQLAlchemy
- Authentication: Flask-Login
- Forms & Validation: WTForms
- Email Service: Flask-Mail
- Token Management: itsdangerous (URLSafeTimedSerializer)
- Migrations: Flask-Migrate
- Frontend: Jinja2 templates with inheritance (
base.html) - Styling: Bootstrap 5, Google Fonts (
Inter,Poppins), Font Awesome, Material Icons - Animations: CSS keyframes + JavaScript interactions
- Flash Messages: SweetAlert2
- Default: SQLite (development)
- Production: PostgreSQL (via
DATABASE_URL) - Migrations: Managed with Flask-Migrate
- User Model:
id(Primary Key)username(Unique, required)email(Unique, required)password_hash(Securely hashed)
- Password Hashing:
generate_password_hashandcheck_password_hash - CSRF Protection:
form.hidden_tag()in all forms - Token-based Reset:
itsdangerous.URLSafeTimedSerializerwith expiration - Secure Headers:
X-Content-Type-Options: nosniffX-Frame-Options: DENYStrict-Transport-Security: max-age=31536000; includeSubDomainsContent-Security-Policy: default-src 'self'
- Error Logging: Email sending errors logged with
app.logger.error
- Index (
/) β Landing page with options to login or register - Register (
/register) β Create account with validation and feedback - Login (
/login) β Authenticate with success/error messages - Logout (
/logout) β End session securely - Reset Request (
/reset_password) β Request password reset via email - Reset Token (
/reset_password/<token>) β Update password securely - Welcome (
/welcome) β Personalized dashboard with kawaii blog section
POST /api/registerβ Create userPOST /api/loginβ Authenticate userPOST /api/reset_passwordβ Request password reset
Example JSON responses:
{ "message": "Account created successfully!" }
{ "message": "Email already registered" }
{ "message": "Invalid email or password." }- Template Inheritance: All pages extend
base.html - Navbar: Dynamic (changes based on login state)
- Cards: Rounded corners, shadows, modern look
- Fonts:
InterandPoppinsvia Google Fonts - Icons: Font Awesome + Material Icons
- Flash Messages: SweetAlert2 with category-based icons (success, error, info, warning)
- Animations:
- CSS: bounce, pulse, spin, glow, rainbow, wiggle, heartbeat, flip, shimmer, swing, fadeGlow, float
- JavaScript: typing effect, icon hover bounce, click spin, article flip
- Platform: Render.com
- WSGI Server: Gunicorn
- Environment Variables:
SECRET_KEYDATABASE_URLMAIL_USERNAMEMAIL_PASSWORD
- Production Notes:
- Debug disabled (
debug=False) - HTTPS enforced with HSTS header
- Logs monitored for email errors
- Debug disabled (
project/ βββ app.py # Main Flask application βββ config.py # Configuration settings βββ forms.py # WTForms definitions βββ models.py # SQLAlchemy models βββ migrations/ # Database migrations βββ templates/ # Jinja2 templates β βββ base.html β βββ index.html β βββ login.html β βββ register.html β βββ reset_request.html β βββ reset_token.html β βββ welcome.html βββ static/ β βββ style.css # Global styles β βββ scripts.js # Kawaii animations
- Clean Code: Clear naming, modular functions
- DRY Principle: Template inheritance avoids duplication
- UX First: Feedback for every user action
- Security First: Hashing, CSRF, secure headers, token expiration
- Deployment Ready: Configurable via environment variables
- Design: Modern, kawaii-inspired, responsive
# Clone repository
git clone https://github.com/your-username/your-repo.git
cd your-repoFollow these steps to clone and run the Flask Coquette System on your machine.
# Clone the repository from GitHub
git clone https://github.com/your-username/flask-coquette-system.gitcd name_of_folder
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
pip install -r requirements.txt
SECRET_KEY=your_secret_key_here
DATABASE_URL=sqlite:///site.db
# DATABASE_URL=postgresql://user:password@localhost/dbname
MAIL_PORT=587
MAIL_USE_TLS=True
MAIL_USERNAME=your_email@gmail.com
MAIL_PASSWORD=your_email_password
flask db init # only first time
flask db migrate # generate migration
flask db upgrade # apply migration
python app.py
The app will be available at: http://127.0.0.1:5000
In production, use Gunicorn as WSGI server.
Configure environment variables in your hosting platform (e.g., Render.com).
Ensure HTTPS is enabled (HSTS header already included).