Demo 1: AI-Assisted Pizza Management System Build
Build a complete five-table Pizza Management System with employee authentication, dynamic dashboard, dual navigation systems, and modal-based CRUD operations using AI assistance and production deployment to Heroku.
Demo Objectives
- Set up project with template implementing five related database tables
- Design and implement customer, pizza, order, order_detail, and employee tables with relationships
- Use Claude AI for schema deployment, blueprint creation, and authentication setup
- Build employee authentication system with Flask-Login and session management
- Create dynamic dashboard with sales metrics and dual navigation systems
- Implement 7% sales tax calculations and order total management
- Deploy and test complete multi-table application in production
Step-by-Step Demonstration
Step 1: Objective
Create a comprehensive Pizza Management System with five related database tables using a Flask template and Claude AI assistance. Build customer, pizza, order, order_detail, and employee tables with foreign key relationships, implement employee authentication with Flask-Login, create a dynamic dashboard with sales metrics, implement dual navigation systems, build modal-based CRUD operations with sales tax calculations, and deploy to production with comprehensive testing.
Step 2: Project Setup with Template Repository
- Create new repository from CRUD template (private repository)
- Repository naming:
M5-demo01or similar descriptive name - Create matching Heroku app and connect to GitHub for auto-deployment
- Add JawsDB MySQL add-on to Heroku app (Kitefin Shared - Free)
- Copy JawsDB connection string for environment configuration
Step 3: Local Development Environment Setup
- Clone repository locally and open in Cursor IDE
- Create virtual environment:
python -m venv venv - Activate virtual environment:
venv\Scripts\activate - Install dependencies:
pip install -r requirements.txt - Use Claude AI to parse JawsDB credentials and create .env file
- Configure Heroku config variables with database credentials (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME, DB_PORT)
- Start Claude Code assistant in separate terminal for AI assistance
Step 4: Five-Table Database Schema Design and Deployment
- Design five-table schema: customer (customer_id, name, phone, email), pizza (pizza_id, name, size, price, cost), order (order_id, customer_id, date), order_detail (order_detail_id, order_id, pizza_id, quantity), employee (user_id, username, first_name, last_name, password)
- Use Claude AI to generate schema.sql with CREATE TABLE statements and foreign key constraints
- Use Claude AI to generate seed.sql with realistic sample data for all tables
- Command Claude to create database tables automatically (creates create_tables.py script)
- Allow AI to self-correct errors (Unicode, syntax, constraint ordering - typically 3-4 iterations)
- Verify data population with AI-generated verify_data.py script
- Confirm all five tables created with proper relationships
Step 5: Flask Blueprints Creation with Modal CRUD Operations
- Use Claude AI to create Pizzas blueprint with modal-based add/edit/delete operations
- Use Claude AI to create Customers blueprint with modal CRUD operations
- Create combined Orders/Order_Details blueprint (parent-child relationship in single blueprint)
- Implement dropdown selections for foreign key relationships (customer dropdown, pizza dropdown)
- Fix modal jumping issues by moving modals outside table loops
- Generate HTML templates with Bootstrap 5 styling and responsive design
- Update navigation system and register all blueprints in app.py
- Remove example files from template (examples.py, examples.html)
Step 6: Employee Authentication System Implementation
- Use Claude AI to implement Flask-Login authentication system using employee table
- Create auth blueprint with login/logout routes
- Implement password hashing with werkzeug.security
- Configure index.html as login page with prefilled credentials for testing
- Create dashboard as post-login landing page
- Add @login_required decorators to protect all routes
- Implement cache control headers to prevent back button after logout
- Test login/logout flow and session management
Step 7: Dynamic Dashboard and Navigation Systems
- Create dual navigation: authenticated users (Dashboard, Pizzas, Customers, Orders, Admin User, Logout) and public users (Home, About)
- Build dynamic dashboard with database-driven metrics: customer count, pizza options count, total orders, total sales for year
- Implement recent orders table with customer names and order totals using SQL JOINs
- Create employee profile page accessible from Admin User link
- Add professional footer with company information
- Ensure consistent container width across header, content, and footer
- Make logo clickable linking to dashboard
Step 8: Order Calculations with Sales Tax
- Implement server-side order total calculations (not template-based)
- Add 7% sales tax to all order totals
- Use Decimal type for accurate money calculations
- Display subtotal, tax, and total on order details page
- Ensure order list page shows totals with tax included
- Verify totals match across order details and order list views
- Test adding items updates totals correctly with tax recalculation
Step 9: Testing and Debugging
- Resolve port conflicts if needed (change Flask port to 5010)
- Use Claude AI for error debugging (paste error messages for quick fixes)
- Test all CRUD operations: Customers (add, edit, delete), Pizzas (add, edit, delete), Orders (create, view details, add items)
- Verify modal functionality (no jumping, proper display)
- Test dropdown selections populate correctly for foreign keys
- Verify login/logout flow and session security
- Test back button prevention after logout
- Verify dashboard metrics pull accurate data from database
Step 10: Code Cleanup and Organization
- Remove temporary development files: create_tables.py, verify_data.py, update_passwords.py
- Keep schema.sql and seed.sql for reference
- Remove old login.html if replaced by index.html
- Verify all example template files are removed
- Ensure .gitignore excludes .env and venv files
- Check navigation menu only includes production links
Step 11: Production Deployment and Verification
- Use Claude AI to commit and push all changes to GitHub
- Monitor Heroku Activity tab for auto-deployment progress
- Wait for build to complete (status: Succeeded)
- Test production application thoroughly: login page with prefilled credentials, authentication flow, all CRUD operations, dashboard metrics, sales tax calculations, navigation systems
- Verify database connections work in production environment
- Add bamarshall06 as collaborator on GitHub repository
- Share Heroku project with bryan.marshall@gcsu.edu
Step 12: Demo Completion Checklist
Before submitting, ensure your application meets all requirements:
🚀 Project Setup
- Repository created from template (private)
- Heroku app created and connected to GitHub with auto-deploy
- JawsDB MySQL add-on provisioned on Heroku
- Local development environment set up with virtual environment
- Environment variables configured in .env and Heroku config vars
🗄️ Five-Table Database Schema
- Customer table created with primary key
- Pizza table created with product information
- Order table created with foreign key to customer
- Order_detail table created with foreign keys to order and pizza
- Employee table created for authentication
- Foreign key constraints properly configured
- Realistic seed data populated for all tables
⚙️ Flask Application Architecture
- Customers blueprint created with modal CRUD operations
- Pizzas blueprint created with modal CRUD operations
- Orders/Order_details combined blueprint created
- Authentication blueprint with login/logout routes
- Dashboard route with dynamic metrics
- Employee profile page created
- HTML templates include dropdown selections for relationships
- Modals placed outside loops (no jumping)
- Navigation updated with all links
- Example files removed and codebase cleaned
🔐 Authentication & Security
- Flask-Login configured with LoginManager
- Password hashing implemented with werkzeug.security
- Login page (index.html) with prefilled test credentials
- Dashboard created as post-login landing page
- @login_required decorators on all protected routes
- Cache control headers prevent back button after logout
- Session management works correctly
- Logout clears session properly
📊 Dashboard & Navigation
- Dual navigation systems (authenticated/public)
- Dashboard shows customer count from database
- Dashboard shows pizza options count
- Dashboard shows total orders count
- Dashboard shows total sales for year with tax
- Recent orders table with customer names and totals
- Employee profile page accessible from Admin User link
- Footer implemented professionally
- Container widths consistent across pages
- Logo clickable linking to dashboard
💰 Order Management & Calculations
- Orders list shows all orders with customer names
- Order details view shows items with quantities and prices
- Can add items to existing orders
- 7% sales tax calculated on all orders
- Decimal type used for accurate money calculations
- Subtotal, tax, and total displayed on order details
- Order totals match between details and list views
- Adding items updates totals with tax correctly
✅ CRUD Operations
- Customers: Create, Read, Update, Delete with modals
- Pizzas: Create, Read, Update, Delete with modals
- Orders: Create with customer dropdown
- Order Details: Add items with pizza dropdown
- Dropdowns show all available options
- Modal placement prevents jumping issues
- All forms validate properly
🚀 Production Deployment
- Environment variables configured in Heroku
- Application deployed successfully to Heroku
- All functionality works in production
- Database connections work in live environment
- Login page loads with prefilled credentials
- Dashboard metrics display correctly
- All CRUD operations functional
- Sales tax calculations accurate
- No errors or broken features in production
📤 Collaboration & Sharing
- GitHub repository includes all code
- bamarshall06 added as collaborator on GitHub
- bryan.marshall@gcsu.edu added as collaborator on Heroku
- Temporary files cleaned up (create_tables.py, verify_data.py)
- Schema.sql and seed.sql kept for reference
Step 13: 📋 Submission Instructions
Submit the following in GeorgiaView:
Required Submission Items:
- Heroku Project Name - Submit ONLY the project name (e.g., "m5-demo01"), not the full URL
- PDF Reflection - Write a short reflection (1-2 paragraphs) covering:
- Your experience implementing a five-table database system with customer, pizza, order, order_detail, and employee tables
- How Claude AI helped with schema generation, blueprint creation, authentication setup, and debugging
- Challenges you encountered with modal jumping, sales tax calculations, or authentication implementation
- Key insights about Flask-Login, session management, and dual navigation systems
- What you learned about AI-assisted development, dashboard metrics, and production deployment
- Understanding of parent-child table relationships (orders/order_details) and server-side calculations
⚠️ Important Notes:
- Do NOT submit URLs - only the Heroku project name
- Ensure collaborator access is granted before submission
- Test all functionality thoroughly in production
- Verify login credentials are prefilled for easy testing
- Confirm sales tax calculations are accurate (7%)
- Ensure dashboard metrics pull real data from database
- Double-check that your PDF reflection addresses all required points