Bosques de Agua App Control is a web application for controlling and monitoring appliances.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
-
Clone the repository:
git clone git@github.com:masch/bda-app-control.git
-
Set up the database:
This project uses a PostgreSQL database. You can use the following
podmancommands to start a PostgreSQL container:-
Pull and init database container:
make db-init
-
Test the database connection:
podman exec -it bda-db psql -U tabaquillo -d bosque -
Reset the database (optional):
podman stop bda-db && \ podman rm bda-db && \ podman volume rm bda-pgdata
-
-
Set up the environment variables:
Create a
.envfile in the root of the project with the following content using.env.templatefile as a template:DB_HOST= DB_NAME= DB_USERNAME= DB_PASSWORD= VERSION= -
Open Ports in Firewall (for Hotspot/LAN access):
On some Linux distributions like Fedora, you may need to configure the firewall to allow access to the application from other devices on the network. If you are running the application on a machine that is also acting as a Wi-Fi hotspot, you'll need to open port 4000 in the appropriate firewall zone.
The following command will add a permanent rule to the
nm-sharedzone to allow TCP traffic on port 4000 and then reload the firewall to apply the change:sudo firewall-cmd --permanent --zone=nm-shared --add-port=4000/tcp && \ sudo firewall-cmd --reload--permanent: Ensures the firewall rule persists after a reboot.--zone=nm-shared: Specifies that the rule applies to thenm-sharedzone, which is often used for network connections shared via NetworkManager (like a hotspot).--add-port=4000/tcp: Opens port 4000 for TCP traffic.firewall-cmd --reload: Applies the new firewall rules immediately.
To run the web server, execute the following command from the root of the project:
go run ./cmd/webThe application will be available at http://localhost:4000/bosquesdeagua.
- Go
- PostgreSQL
- bun - SQL-first Golang ORM
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
This project is licensed under the MIT License - see the LICENSE file for details.