A digital history project exploring LGBTQ+ spaces through historical travel guides, built with Flask and SQLite.
- Interactive map visualization using Leaflet.js
- SQLite database for storing location and article data
- RESTful API endpoints for data access
- Responsive Bootstrap-based UI
- Content management for articles and research
- Python 3.8+ (or Python 3)
- Node.js 16+ and npm
- pip (usually comes with Python)
# Make the setup script executable
chmod +x setup.sh
# Run the setup script
./setup.sh- Clone the repository and navigate to the project directory:
cd MGG-Site- Install Python dependencies:
pip3 install -r requirements.txt- Install Node.js dependencies:
npm install- Build Tailwind CSS:
npm run build- Initialize the database:
python3 init_db.py- Run the application:
python3 app.pyThe main application will be available at http://localhost:5001
python3 app.pyAccess at: http://localhost:5001
The app runs in debug mode by default, so it will auto-reload when you make changes to Python files.
For development with CSS watching:
npm run buildThis will watch your template files and rebuild the CSS automatically.
For production builds:
npm run build-prodThis creates a minified, optimized CSS file.
Development tools are available in the utilities/ directory:
cd utilities
python utility_app.pyAccess utility tools at: http://localhost:5002
Important: Utility tools are for local development only. Do not deploy them to production.
MGG-Site/
├── app.py # Main Flask application
├── models.py # Database models
├── routes/ # Route blueprints
│ ├── __init__.py
│ ├── main.py # Main page routes
│ └── api.py # API endpoints
├── templates/ # HTML templates
│ ├── base.html # Base template
│ ├── index.html # Home page
│ └── map.html # Map page
├── static/ # Static assets
│ ├── css/
│ │ ├── input.css # Tailwind input
│ │ └── style.css # Compiled CSS
│ └── js/
│ ├── main.js # General JavaScript
│ ├── map.js # Map functionality
│ ├── viz.js # Visualizations
│ └── amenities.js
├── utilities/ # Development tools (NOT for production)
│ ├── utility_app.py # Utility Flask app (port 5002)
│ ├── templates/ # Utility templates
│ ├── add_amenity.py # Utility scripts
│ └── README.md # Utility documentation
├── content/ # Markdown content
│ └── markdown/ # Article files
├── data/ # Data files
├── routes/ # Route blueprints
│ ├── main.py # Main routes
│ └── api.py # API endpoints
├── mgg.db # Database file
├── models.py # Database models
├── requirements.txt # Python dependencies
└── package.json # Node.js dependencies
Note: The
utilities/directory contains development tools for data management. These should NOT be deployed to production. Keep them local for development use only.
- Stores information about LGBTQ+ spaces from historical guides
- Includes coordinates, categories, years, and descriptions
- Supports filtering by location, time period, and type
- Manages research articles and content
- Supports markdown content and metadata
- Includes publication status and author information
GET /api/locations- Get all locationsGET /api/locations/<id>- Get specific locationGET /api/articles- Get all articlesGET /api/articles/<id>- Get specific article
Create new route files in the routes/ directory and register them in app.py.
Use Flask-Migrate for database schema changes:
flask db init
flask db migrate -m "Description of changes"
flask db upgradeThe site uses Tailwind CSS with DaisyUI for styling.
- Source CSS:
static/css/input.css - Compiled CSS:
static/css/style.css - To rebuild CSS:
npm run build-prod(production) ornpm run build(dev with watch)
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is part of the Mapping the Gay Guides digital history initiative.