diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000..088c521 --- /dev/null +++ b/README.en.md @@ -0,0 +1,66 @@ +
+ +

+ Lire cette page en français + English, page shown +

+ +MicroCoaster WebApp, the web control application + +
+ +The web application that drives MicroCoaster layouts. It discovers the connected ESP32 modules, shows their state in real time, and lets you build sequences that orchestrate a whole layout. + +Live at **[app.microcoaster.com](https://app.microcoaster.com)**. + +01 Architecture + +The application talks to two worlds that do not have the same needs, so it uses two separate channels. + +Browsers talk to the application over Socket.io, which brings automatic reconnection, a long-polling fallback and one room per user. There they find the connected modules, realtime telemetry, sequence building, accounts and notifications. The ESP32 modules talk over raw WebSocket, in short JSON messages with authentication on connect: Switch Track, Launch Track, Lift Hill, Audio module, Smoke Machine and the simulators. At the centre, the WebApp in Node.js, Express and MySQL is the only one that knows the full state of the layout. + +**Socket.io towards the browsers.** Automatic reconnection, a long-polling fallback, one room per user. It is comfortable on the web side and it tolerates a temperamental network. + +**Raw WebSocket towards the ESP32s.** No extra layer, no transport negotiation: a microcontroller has neither the memory nor the need for a Socket.io client. The modules authenticate on connection, then exchange short JSON messages. + +This is also where the system's authority sits. A module never decides to move on its own: it carries out an order from this application, which is the only one that knows the full state of the layout. + +02 Structure + +Repository tree. api: the event handlers, modules, users, notifications. websocket: the link to the ESP32 modules. bdd: data access, one DAO per entity. routes: the HTTP routes. middleware: authentication and access control. views: the page templates. public: the assets served as they are. locales: the interface translations. sql: the schema and the seed data. esp: the reference firmwares for the modules. sim: the module simulators, to develop without hardware. tests: the automated tests. utils: the shared helpers. + +The `sim/` folder deserves a word: it holds simulators that pass themselves off as real modules. You develop and test the orchestration of a complete layout without having to wire anything at all. + +03 Installation + +```bash +git clone https://github.com/Microcoaster/MicroCoasterWebApp.git +cd MicroCoasterWebApp +npm install +cp .env.example .env +``` + +Fill in `.env`, then create the database: + +```bash +mysql -u root -p < sql/schema.sql +mysql -u root -p < sql/default_data.sql +``` + +04 Development + +```bash +npm start # start +npm test # tests +npx eslint . # static analysis +``` + +The cycle is the organisation's: an issue describes the work, a branch starts from `develop`, a pull request comes back onto it and goes through review before reaching `main`. + +05 Ecosystem + +The modules driven by this application each have their own repository: [Switch Track](https://github.com/Microcoaster/Switch-Track), [Launch Track](https://github.com/Microcoaster/Launch-Track), [Lift Hill](https://github.com/Microcoaster/Lift-Hill), [Audio module](https://github.com/Microcoaster/Module-Audio), [Smoke Machine](https://github.com/Microcoaster/Smoke-Machine). The common base is the [WiFi Manager](https://github.com/Microcoaster/MicroCoaster_WifiManager). + +--- + +MicroCoaster · Authors: Cybertrist, Yamakajump diff --git a/README.md b/README.md index aaa4cff..08c3171 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@
+

+ Français, page affichée + Read this page in English +

+ MicroCoaster WebApp, application web de pilotage
diff --git a/docs/en/banniere.png b/docs/en/banniere.png new file mode 100644 index 0000000..a204920 Binary files /dev/null and b/docs/en/banniere.png differ diff --git a/docs/en/schemas/arborescence.png b/docs/en/schemas/arborescence.png new file mode 100644 index 0000000..8e5b0ec Binary files /dev/null and b/docs/en/schemas/arborescence.png differ diff --git a/docs/en/schemas/architecture.png b/docs/en/schemas/architecture.png new file mode 100644 index 0000000..374f8df Binary files /dev/null and b/docs/en/schemas/architecture.png differ diff --git a/docs/en/sections/s01.png b/docs/en/sections/s01.png new file mode 100644 index 0000000..8f800f6 Binary files /dev/null and b/docs/en/sections/s01.png differ diff --git a/docs/en/sections/s02.png b/docs/en/sections/s02.png new file mode 100644 index 0000000..1f3ee7f Binary files /dev/null and b/docs/en/sections/s02.png differ diff --git a/docs/en/sections/s03.png b/docs/en/sections/s03.png new file mode 100644 index 0000000..b269b82 Binary files /dev/null and b/docs/en/sections/s03.png differ diff --git a/docs/en/sections/s04.png b/docs/en/sections/s04.png new file mode 100644 index 0000000..c500acc Binary files /dev/null and b/docs/en/sections/s04.png differ diff --git a/docs/en/sections/s05.png b/docs/en/sections/s05.png new file mode 100644 index 0000000..79f4181 Binary files /dev/null and b/docs/en/sections/s05.png differ diff --git a/docs/langues/en-off.png b/docs/langues/en-off.png new file mode 100644 index 0000000..77ea9ec Binary files /dev/null and b/docs/langues/en-off.png differ diff --git a/docs/langues/en-on.png b/docs/langues/en-on.png new file mode 100644 index 0000000..c9dbf28 Binary files /dev/null and b/docs/langues/en-on.png differ diff --git a/docs/langues/fr-off.png b/docs/langues/fr-off.png new file mode 100644 index 0000000..41f4335 Binary files /dev/null and b/docs/langues/fr-off.png differ diff --git a/docs/langues/fr-on.png b/docs/langues/fr-on.png new file mode 100644 index 0000000..4e1cb47 Binary files /dev/null and b/docs/langues/fr-on.png differ