HEMS Simulation Portal

This repository contains a self‑contained web application for the

Views1
PublishedJan 14, 2026

Loading actions...

5 minBeginnerpromptSingle file

Skill content

Main instructions and any bundled files for this skill.

markdown

HEMS Simulation Portal

This repository contains a self‑contained web application for the HEMS Simulation portal. It is inspired by the existing site at helicoptersim.org but redesigned to be fully editable by administrators and to expose working plugin endpoints for both Microsoft Flight Simulator (MSFS) and X‑Plane.

Features

  • Landing page – Presents a hero section, pricing plans and a grid of core features. All text on the public site can be edited from the admin panel without touching any code.
  • Admin interface – Password‑protected pages allow an administrator to update site settings (hero title, call‑to‑action text, plan names/prices), modify the list of core features, and browse incoming telemetry from simulator plugins. The default password is admin123 (you should change this immediately).
  • Plugin API – Flight simulator plugins can POST JSON telemetry data to /api/plugins/msfs or /api/plugins/xplane. Incoming altitude, speed, fuel and engine status values are stored in a SQLite database and displayed both on the landing page and in the admin panel.
  • Sample plugins – Two example scripts (plugins/msfs_plugin.py and plugins/xplane_plugin.py) simulate sending random telemetry data to the server. These serve as a starting point for real simulator integrations.

Getting started

This project has no external dependencies beyond the Python packages already available in this environment. It uses FastAPI and Jinja2 for the web layer and the built‑in sqlite3 module for persistence.

Running the server

  1. Open a terminal and change into the project directory:

    cd hems_app
    
  2. Start the development server using uvicorn:

    uvicorn main:app --reload --port 8000
    

    The --reload flag enables automatic reloading when you edit templates or Python code.

  3. Visit http://localhost:8000/ in your browser to see the landing page. Click the Admin link in the top right and log in with the default password admin123 to access the admin dashboard. From there you can edit the content and change the password.

Changing the admin password

  1. Log in to the admin dashboard at /admin/login using the current password.
  2. Navigate to Edit Site Settings.
  3. Enter a new password in the New Password field and click Save Changes. Leaving the field blank will keep the existing password.

Sending telemetry from simulator plugins

Two sample plugins are included under the plugins/ directory. They generate random flight data and send it to the server every five seconds. You can run them as follows (replace localhost:8000 with your server’s address if different):

python plugins/msfs_plugin.py http://localhost:8000
python plugins/xplane_plugin.py http://localhost:8000

Each script will output a message whenever data is sent. On the landing page you will see the most recent telemetry in the Recent Simulator Data section, and the full history is available from the admin panel under View Plugin Data.

Customisation

  • Styling: All of the CSS for the site lives in static/style.css. Modify this file to change colours, layout spacing, or any other visual aspect.
  • Navigation: The navigation bar at the top of every page is defined in templates/base.html. You can adjust the menu items there or link them to real pages when you implement additional functionality.

Deploying

This application is intended as a starting point. For production deployments you should run behind a proper ASGI server such as uvicorn or hypercorn and configure HTTPS termination. The database (db.sqlite3) will be created automatically; if you wish to start over with a clean database you may delete this file before launching the server.

License

This project is provided as‑is without any warranty. You are free to modify and distribute it for your own use.

Share: