A Flask application that visualizes web development concepts through an interactive house metaphor with toggleable SVG layers. Features automatic GitHub Pages deployment for sharing your visualization online!
- Docker
- Docker Compose
- Git (for version control and GitHub Pages deployment)
-
Create a
.envfile in the root directory with your GitHub information:# GitHub Pages Configuration GITHUB_USERNAME="TortoiseWolfe" REPO_NAME="The_House_that_Code_Built" GITHUB_PAGES_URL="https://${GITHUB_USERNAME}.github.io/${REPO_NAME}" # Flask configuration FLASK_APP=House_Code/app.py FLASK_ENV=development FLASK_DEBUG=1⚠️ This is important for proper GitHub Pages deployment later! -
Run the setup script to create the project structure:
bash FirstFlask.shThis will create a
House_Codedirectory with all necessary files. -
Navigate to the generated project directory:
cd House_Code -
Start the application with Docker:
docker-compose up -
Access the application in your browser at:
http://localhost:5000⚠️ Note: Make sure to uselocalhost:5000and not any IP address shown in Docker logs. -
To stop the application:
- Press
Ctrl+Cin the terminal where docker-compose is running - Or run:
docker-compose downfrom another terminal
- Press
The project includes automatic GitHub Pages deployment using GitHub Actions:
-
First, make sure your
.envfile in the root directory has the correct GitHub information:GITHUB_USERNAME="TortoiseWolfe" REPO_NAME="The_House_that_Code_Built" -
Push your repository to GitHub:
# Initialize git repository if needed git init git add . git commit -m "Initial commit" # Add GitHub remote git remote add origin https://github.com/TortoiseWolfe/The_House_that_Code_Built.git # Push to GitHub git push -u origin main
-
Enable GitHub Pages in your repository settings:
- Go to your GitHub repository
- Click on "Settings" tab
- Navigate to "Pages" in the left sidebar
- Under "Build and deployment" section, select:
- Source: "GitHub Actions"
- Click "Save"
-
Your site will be automatically deployed each time you push to the main branch!
- You can view the deployment status in the "Actions" tab of your repository
- Once deployed, your site will be available at the URL specified in your
.envfile:https://TortoiseWolfe.github.io/The_House_that_Code_Built
If you encounter issues with GitHub Pages deployment:
- Check the Actions tab in your GitHub repository to see detailed logs
- Ensure your repository has proper permissions configured:
- Go to Settings → Actions → General → Workflow permissions
- Select "Read and write permissions"
- Check "Allow GitHub Actions to create and approve pull requests"
- The FirstFlask.sh script automatically detects CI environments and skips Docker operations
- If you see exit code 127 errors, this usually indicates "command not found" and may be related to Docker commands trying to run in GitHub Actions
The project creates these key files and directories:
.env- Configuration file for GitHub Pages deploymentHouse_Code/- Main project directoryapp.py- Main Flask applicationtemplates/index.html- HTML template with interactive controlsstatic/svg/- Directory for SVG assetsDockerfile&docker-compose.yml- Docker configuration.github/workflows/github-pages.yml- GitHub Actions workflow for automatic deployment
- Interactive SVG layer toggling
- Preset chapter views for different web development concepts
- Three-column responsive layout:
- Left column: Chapter preset buttons (25%)
- Center column: SVG visualization (55%)
- Right column: Layer toggle controls (20%)
- Adaptive design for desktop, tablet, and mobile
- Dark/light mode with persistent user preference
- Tom Waits soundtrack integration
- Docker containerization for easy development
- Automatic GitHub Pages deployment
- Environment variable configuration
- Accessible design with ARIA attributes and keyboard navigation
The application visualizes web development concepts using these interactive SVG layers:
- Environment Layer - The background setting for our house
- House Structure - The basic house outline and foundation
- HTML Tags Layer - Visualizes HTML elements as the blueprint
- Structure Layer - Shows the HTML structural framing
- CSS Design Layer - Represents styling and visual design
- JavaScript Layer - Demonstrates interactive elements
- Backend Systems Layer - Illustrates server-side components
Each layer can be toggled on/off in the interactive interface to understand how different technologies combine to create a complete web application.
- Flask - Python web framework for the application backend
- Docker - Containerization for consistent development environment
- GitHub Actions - Automatic deployment to GitHub Pages
- SVG - Vector graphics for interactive visualization layers
- JavaScript - Client-side interactivity for toggling layers
- CSS - Styling and responsive design
The FirstFlask.sh script now includes automatic detection of CI environments:
- Skips Docker operations when running in GitHub Actions
- Adds error handling for Docker commands
- Creates static files for GitHub Pages deployment
- Provides fallback behaviors for template rendering
