Base scripts and templates added

This commit is contained in:
Hamit Şimşek
2025-05-30 00:07:07 +03:00
parent 73d497d4c3
commit ebd7dcc23b
28 changed files with 2579 additions and 0 deletions

5
app/main/__init__.py Normal file
View File

@@ -0,0 +1,5 @@
from flask import Blueprint
bp = Blueprint('main', __name__)
from app.main import routes

36
app/main/routes.py Normal file
View File

@@ -0,0 +1,36 @@
from flask import render_template
from flask_login import login_required, current_user
from app.main import bp
@bp.route('/')
@bp.route('/index')
def index():
"""
Home page - shows different content for authenticated vs anonymous users.
Security: No sensitive data exposed to anonymous users.
"""
return render_template('index.html', title='Home')
@bp.route('/dashboard')
@login_required
def dashboard():
"""
Protected dashboard for authenticated users.
Security: Requires valid login session with 2FA verification.
"""
return render_template('dashboard.html', title='Dashboard', user=current_user)
@bp.route('/profile')
@login_required
def profile():
"""
User profile page with 2FA management.
Security: Requires valid login session.
"""
return render_template('profile.html', title='Profile', user=current_user)