MailMap is a web application that allows users to submit content (text and images) via email or through the web interface. The content is displayed on an interactive map based on the location coordinates attached to the content.
- Content submission via email with image attachments
- Automatic extraction of GPS coordinates from image EXIF data
- Interactive map display of all published content
- Voting system (like/dislike) for content
- Content reporting system for inappropriate content
- Moderation system for reported content
- Administrative panel for content moderation
- Anonymous authentication for users
- Backend: Flask (Python)
- Database: Firestore (Firebase)
- Storage: Firebase Storage
- Authentication: Firebase Authentication
- Maps: Google Maps API (with Beta Advanced Markers)
- Email Processing: Postmark webhook
The application requires the following environment variables:
INBOUND_URL_TOKEN
- Secret token for Postmark webhookFIREBASE_STORAGE_BUCKET
- Firebase Storage bucket nameGOOGLE_APPLICATION_CREDENTIALS
- Path to Firebase service account key (in production)FLASK_SECRET_KEY
- Secret key for Flask sessions (required for admin panel)
The diagram below illustrates the main components and data flow of the application:
---
title: Application Architecture
---
graph LR
A["User Sends Email <br/> (with photo & GPS)"] --> B(("Postmark <br/> Inbound Email Service"));
subgraph "Backend Infrastructure"
direction LR
B -- "JSON Webhook (POST)" --> C{"Flask Web Application <br/> (GCP Server: Nginx, Gunicorn <br/> Handles all backend logic)"};
C -- "Uploads Image to" --> D[("Firebase Cloud Storage <br/> Image Hosting")];
C -- "Saves Post Metadata to" --> E[("Firebase Firestore <br/> Post Database")];
C -- "Initiates Email Notification via" --> ExtSMTP((Email Sending Service <br/> e.g., Postmark SMTP));
end
subgraph "Frontend (User's Browser)"
direction LR
H{"Client Web Browser<br/>(HTML, CSS, JavaScript)"}
E -- "Provides Post Data to" --> H;
D -- "Provides Images to" --> H;
H -- "Renders Map using" --> I((Google Maps API));
H -- "API Calls (likes, reports) to" --> C;
end
classDef default fill:#2C3E50,stroke:#ECF0F1,stroke-width:2px,color:#ECF0F1;
classDef input fill:#8E44AD,stroke:#9B59B6,stroke-width:2px,color:#FFFFFF;
classDef service fill:#2980B9,stroke:#3498DB,stroke-width:2px,color:#FFFFFF;
classDef app fill:#27AE60,stroke:#2ECC71,stroke-width:2px,color:#FFFFFF;
classDef storage fill:#F39C12,stroke:#F1C40F,stroke-width:2px,color:#000000;
classDef frontend fill:#E74C3C,stroke:#C0392B,stroke-width:2px,color:#FFFFFF;
class A input;
class B,ExtSMTP service;
class C,I app;
class D,E storage;
class H frontend;
- Clone the repository
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables
- Run the application:
python app.py
The application is designed to be deployed to Google Cloud Run or similar serverless platforms.
/webhook/postmark
- Webhook for Postmark email processing/api/content/<content_id>/vote
- API for voting on content/api/content/<content_id>/report
- API for reporting content/api/content/create
- API for creating new content
/admin/login
- Admin login page/admin/dashboard
- Admin dashboard/admin/api/content/<content_id>/approve
- API for approving content/admin/api/content/<content_id>/reject
- API for rejecting content
This project is licensed under the MIT License - see the LICENSE file for details. MailMap is a web application that allows users to submit content with geographical coordinates via email. The submitted content is displayed on an interactive map.
- Email submission with image attachments
- Automatic extraction of GPS coordinates from image EXIF data
- Manual coordinate specification in email subject
- Interactive map display of all published content
- Google Cloud integration (Firebase, Cloud Run, Cloud Storage)
- Python 3.10+
- Google Cloud account with Firebase project
- Firebase service account key
- Clone the repository
- Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
cp .env.example .env # Edit .env with your configuration
python app.py
The application will be available at http://localhost:8080
The application is configured for deployment to Google Cloud Run using GitHub Actions.
GCP_SA_KEY
: Google Cloud service account key with permissions for Cloud Run, Cloud Build, and FirebaseGCP_PROJECT_ID
: Your Google Cloud project IDINBOUND_URL_TOKEN
: Secret token for email webhook authenticationFIREBASE_STORAGE_BUCKET
: Firebase storage bucket name
gcloud builds submit --tag gcr.io/PROJECT_ID/mailmap-app
gcloud run deploy mailmap --image gcr.io/PROJECT_ID/mailmap-app --platform managed --region us-central1 --allow-unauthenticated
Premananda ([email protected])
This project is licensed under the MIT License - see the LICENSE file for details