Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 0 additions & 19 deletions .github/workflows/main.yml

This file was deleted.

100 changes: 93 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,105 @@

Chronos is a boiling/cooling water system working on Raspberry Pi. Chronos has a web interface to control the system and tracking for the state.

![Alt text](http://i.imgur.com/8II1ydG.png "A screenshot of the Chronos web interface")
![Alt text](https://cdn-images-1.medium.com/v2/resize:fit:800/1*Yk7RuJxn_PqkQ146k9tRug.png "A screenshot of the Chronos web interface")
## Frontend and Backend Separation

### Overview

The Chronos project has been refactored to separate the frontend and backend components. The backend operates as a standalone service providing APIs, while the frontend is handled separately.

### New Project Structure

The **Chronos2** folder contains both the **server** (backend) and **client** (frontend). The **client** is built with **React**. The project is configured to run both components **simultaneously** using a single Docker command.

### Summary of set up ###

#### Installation with Docker ####
This repository consists of a docker container that has all the dependencies and simulators built-in. Just run using these two commands:
```
sudo docker-compose up --build -d chronos
sudo docker restart chronos
sudo docker restart chronosBackend
```


> **Important:**
> <span style="color:red;">**The backend service must be restarted manually using:**</span>
> ```bash
> sudo docker restart chronosBackend
> ```
> **Make sure to wait until the restart completes to ensure everything runs correctly.**




### API Endpoints

The backend provides the following API endpoints:

#### Base URL
- **Base URL**: `http://<backend-server-url>:80`

#### Endpoints

- **Get System Data**:
- **URL**: `/`
- **Method**: `GET`
- **Description**: Retrieves the current system data, including temperature settings and mode status.
- **Response**: JSON object containing system data.

- **Get Rendered Season Templates**:
- **URL**: `/season_templates`
- **Method**: `GET`
- **Description**: Retrieves data for rendering season templates.
- **Response**: JSON object with system results, activity stream, and efficiency details.

- **Download Log**:
- **URL**: `/download_log`
- **Method**: `GET`
- **Description**: Downloads the system log as a CSV file.
- **Response**: CSV file download.

- **Update Settings**:
- **URL**: `/update_settings`
- **Method**: `POST`
- **Description**: Updates system settings based on provided form data.
- **Request Body**: Form data with settings to update.
- **Response**: JSON object with the updated form data.

- **Switch Mode**:
- **URL**: `/switch_mode`
- **Method**: `POST`
- **Description**: Switches the system mode between winter and summer.
- **Request Body**: Form data with the new mode (`TO_WINTER` or `TO_SUMMER`).
- **Response**: JSON object with error status and mode switch lockout time.

- **Update Device State**:
- **URL**: `/update_state`
- **Method**: `POST`
- **Description**: Updates the state of a specific device based on provided form data.
- **Request Body**: Form data with device number and manual override value.
- **Response**: Empty response.

- **Winter Mode Data**:
- **URL**: `/winter`
- **Method**: `GET`
- **Description**: Retrieves data specific to the winter mode.
- **Response**: JSON object with system data.

- **Summer Mode Data**:
- **URL**: `/summer`
- **Method**: `GET`
- **Description**: Retrieves data specific to the summer mode.
- **Response**: JSON object with system data.

- **Chart Data**:
- **URL**: `/chart_data`
- **Method**: `GET`
- **Description**: Retrieves data for charts.
- **Response**: JSON object containing chart data.



### SIMULATORS

Chronos talks to the following components on the RPI.
Expand Down Expand Up @@ -112,8 +202,4 @@ https://docs.github.com/en/actions/hosting-your-own-runners/adding-self-hosted-r

- Install docker.io and docker-compose on the Runner
- sudo apt update
- sudo apt install docker.io docker-compose -y




- sudo apt install docker.io docker-compose -y
33 changes: 0 additions & 33 deletions chronos/static/css/main.css

This file was deleted.

Loading