This project consists of a RESTful API for managing Aclima nodes and sensors, built with FastAPI and DuckDB, and a Vue.js frontend for interacting with the API.
- Python 3.7+
- pip
- Docker (optional)
-
Clone the repository:
git clone https://github.com/derrickjnet/aclima.git cd aclima
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
Start the FastAPI server:
uvicorn main:app --reload
-
Build the Docker image:
docker build -t aclima-api .
-
Run the Docker container:
docker run -p 8000:8000 aclima-api
The API and web interface will be available at http://localhost:8000
GET /
: Serve the main HTML pageGET /sensors
: List all sensorsGET /sensors/{sensor_id}
: Get a specific sensorPOST /sensors
: Create a new sensorGET /nodes
: List all nodesGET /nodes/{node_id}
: Get a specific nodePOST /nodes
: Create a new nodeGET /nodes/{node_id}/sensors
: Get sensors connected to a specific nodePOST /connect_sensor_to_node
: Connect a sensor to a nodeGET /counts
: Get counts of sensors and nodes
- Dashboard displaying count of sensors and nodes
- View list of sensors and nodes
- Fetch updated lists of sensors and nodes
- The database is stored in
aclima.db
in the project root directory. - DuckDB is used as the database engine, providing fast in-process analytics.
- The frontend uses Vue.js 2.6 and is embedded in the HTML template served by FastAPI.
- Bootstrap is used for styling the web interface.