Skip to content

macery12/M12Hosting

Repository files navigation

M12hosting

A lightweight, self-hosted billing and order management site built for JexPanel hosting services.
Designed as a personal project to make affordable, community‑focused servers accessible without the complexity of big hosting platforms.


🌐 Overview

M12hosting is a Flask-based web app that handles:

  • Browsing and ordering hosting plans (Minecraft Vanilla, CurseForge modpacks, and Discord bots)
  • Manual order review and approval via admin panel
  • Customer order tracking
  • Contact page for pre‑sales/support inquiries

The app uses:

  • Flask 3.x
  • Flask‑SQLAlchemy
  • Flask‑WTF (CSRF‑protected forms)
  • Flask‑Limiter (rate limiting)
  • SQLite by default (PostgreSQL supported via DATABASE_URL)
  • Redis (for rate‑limit storage)
  • Docker Compose (optional containerized setup)

🧩 Features

Feature Description
Billing System Displays categorized plans from a billables.json source file.
Manual Approval Workflow Orders are created and manually approved in the admin panel before payment.
Public Pages Home, Billing, Checkout, Order Status, Contact.
Admin Tools View recent orders, update order status, sync billables.json into the database.
CSRF + Rate Limiting All forms and sensitive routes are protected.
Dark Theme UI Clean, responsive, card‑based layout with purple/black neon styling.

⚙️ Tech Stack

  • Language: Python 3.11+
  • Framework: Flask 3.x
  • Database: SQLite (default) or PostgreSQL (via DATABASE_URL)
  • Cache / Rate Storage: Redis
  • Frontend: HTML5, CSS3, Jinja2 templates
  • Runtime (optional): Docker + Gunicorn

📂 Project Structure

M12hosting/
├── app.py
├── billables.json
├── requirements.txt
├── example.env
├── .env
├── docker-compose.yml
├── Dockerfile
├── static/
│   ├── styles.css
│   └── icon.png
└── templates/
    ├── base.html
    ├── index.html
    ├── billing.html
    ├── checkout.html
    ├── order.html
    ├── admin.html
    └── contact.html

⚡ Quick Start (Local)

  1. Install dependencies
pip install -r requirements.txt
  1. Create .env
cp example.env .env

Edit values as needed. If DATABASE_URL is empty, the app uses a Windows‑safe SQLite path ./data/app.db.

  1. Run
python app.py

Visit: http://localhost:${PORT:-5000}

Tip: The app auto‑creates tables on start. /billing will sync billables.json into the DB when you trigger the admin sync or run the CLI/route you’ve wired for syncing.


🐳 Optional: Docker

Build & run:

docker compose up --build

If you’re using PostgreSQL in Compose, ensure DATABASE_URL matches your driver (e.g., postgresql+psycopg2://user:pass@db:5432/m12hosting).


💾 Data Flow

  • billables.json is the source of truth for plans, Exported From Jexpanel
  • A sync step imports/updates plans into the database (idempotent).
  • Orders and statuses are stored in SQLite/PostgreSQL.
  • Admin manages approvals in /billables (Basic Auth).

🎨 Design Notes

  • Theme: Dark (purple/black base, neon blue accents)
  • Cards: Equal‑height grid, price centered, CTA pinned to bottom
  • Mobile: Fully responsive, sticky category chips on billing
  • Smooth scroll: Anchor links like /billing#curseforge-modded

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published