Skip to content

Commit 84496d6

Browse files
committed
README: Change to reStructuredText.
1 parent 3a8ca3a commit 84496d6

File tree

2 files changed

+52
-46
lines changed

2 files changed

+52
-46
lines changed

README.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

README.rst

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
ESP32-Remote-Access
2+
===================
3+
4+
This repository contains everything needed to build and run the (**WIP**) remote access server for Tinkerforge WARP Chargers, WARP Energy Managers and ESP32-/ESP32-Ethernet-Bricks.
5+
6+
File structure
7+
--------------
8+
9+
``
10+
.
11+
├── backend
12+
├── db_connector
13+
├── docker
14+
├── frontend
15+
└── wg-webclient
16+
``
17+
18+
- ``backend`` The http backend server and relay server between the charger and the users browser
19+
- ``db_connector`` A crate containing the types needed to interface with the database server
20+
- ``docker`` Files to run and build the docker containers
21+
- ``frontend`` Website that is served by the webserver
22+
- ``wg-webclient`` The Wireguard implementation containing also a network stack and Http and Websocket client.
23+
24+
Build
25+
-----
26+
27+
Prerequisites
28+
~~~~~~~~~~~~~
29+
30+
- Rust toolchain: https://www.rust-lang.org/tools/install
31+
- Node: https://nodejs.org/en
32+
- Wasm-pack: https://github.com/rustwasm/wasm-pack
33+
- docker: https://www.docker.com/get-started/
34+
35+
For the production build only docker is needed since everything is build in a container.
36+
37+
Developement build
38+
~~~~~~~~~~~~~~~~~~
39+
40+
1. Create a ``certs`` directory in ``docker/nginx`` and place a X.509 certificate and key in pem format named ``cert.pem`` and ``key.pem`` inside.
41+
2. Fill in the needed variables in the env variables. All needed variables are listed inside the .env.example files.
42+
3. build the wg-package by running ``wasm-pack build`` inside ``wg-webclient``.
43+
4. build the website by running ``npm install && npm run build`` inside ``remote-access-page``.
44+
5. start the webserver + database by running ``docker compose -f docker-compose-dev.yml up --build`` inside ``docker``.
45+
6. start the backend server by running ``cargo run`` inside ``backend``.
46+
47+
Production build
48+
~~~~~~~~~~~~~~~~
49+
50+
1. Ensure that the host is accessible via a Fully Qualified Domain Name, otherwise creating a Lets Encrypt Certificate will fail.
51+
2. Fill in the needed variables in the env file. All needed variables are listed inside the .env.example files.
52+
3. Start everything with ``docker compose up`` inside the ``docker`` directory.

0 commit comments

Comments
 (0)