Quick Start Guide
Get Empire Builder up and running in just a few minutes!
Prerequisites
Before you begin, ensure you have:
Python 3.11 or higher installed
Git for cloning the repository
Internet connection for Supabase integration
A Supabase account (free tier available)
Step 1: Installation
Clone the Repository
git clone https://github.com/logan-code-del/empire-builder-game.git cd empire-builder-game
Install Dependencies
pip install -r requirements.txt
This installs all required packages including Flask, Supabase client, and other dependencies.
Step 2: Supabase Setup
Create a Supabase Project
Go to https://supabase.com
Sign up for a free account
Create a new project
Wait for the project to be ready (usually 1-2 minutes)
Get Your Credentials
From your Supabase dashboard: - Go to Settings → API - Copy your Project URL - Copy your anon/public key - Copy your service_role key
Set Up Database Schema
In your Supabase dashboard: - Go to SQL Editor - Run the schema from
supabase_auth_schema_uuid.sql-- This creates the necessary tables for users, empires, battles, etc. -- The file contains all required table definitions
Step 3: Configuration
Create Environment File
Copy the template and add your credentials:
cp .env.template .env
Edit .env File
Open
.envin your text editor and add your Supabase credentials:# Supabase Configuration SUPABASE_URL=https://your-project-id.supabase.co SUPABASE_ANON_KEY=your-anon-key-here SUPABASE_SERVICE_KEY=your-service-key-here SECRET_KEY=your-flask-secret-key-here
Important: Replace the placeholder values with your actual Supabase credentials.
Step 4: Launch the Game
Start the Server
python app_supabase.pyYou should see output similar to:
Supabase connected successfully * Running on http://127.0.0.1:5000 * Debug mode: on
Open Your Browser
Navigate to: http://localhost:5000
Create Your Account
Click “Register” to create a new account
Fill in username, email, and password
Click “Create Account”
Start Playing!
Log in with your new account
Create your first empire
Begin building and expanding
First Steps in the Game
Once you’re logged in and have created an empire:
Build Your First City - Click “Build City” on the dashboard - Choose a location on the map - Start with basic buildings (houses, farms)
Manage Resources - Monitor your gold, food, and materials - Build resource-generating buildings - Balance production and consumption
Train Units - Build military buildings (barracks, stables) - Train basic units (soldiers, archers) - Prepare for defense and expansion
Explore Multiplayer - View other players on the leaderboard - Send diplomatic messages - Consider forming alliances
Troubleshooting
Common Issues:
- “Supabase connection failed”
Check your internet connection
Verify your Supabase credentials in
.envEnsure your Supabase project is active
- “Registration failed” or 400 errors
Make sure you’ve run the database schema
Check that your service key has proper permissions
Verify Row Level Security policies are set up correctly
- “Port already in use”
Another application is using port 5000
Kill the existing process or change the port:
python app_supabase.py --port 5001
- Import errors
Ensure you’re in the
empiredirectoryReinstall dependencies:
pip install -r requirements.txtCheck Python version:
python --version
- Database connection issues
Verify your
.envfile has the correct credentialsCheck Supabase project status in the dashboard
Ensure your IP is not blocked by Supabase
Getting Help
If you encounter issues:
Check the logs in your terminal for error messages
Review the installation guide for detailed setup instructions
Test your setup using the debug scripts in the project
Report bugs on the project’s GitHub issues page
Next Steps
Now that you have Empire Builder running:
Read the Game Mechanics guide to understand gameplay
Explore the API Reference for advanced features
Check the Development Guide if you want to contribute
Join the community to connect with other players
Congratulations! You’re now ready to build your empire! 🏰