The ready to use branch is "release". To run the project docker and docker-compose are needed. First of all you need to enter main-service, importer, event-service, pv-status-checker and front-end folders and do the same steps to install npm dependencies with:
npm install
Before running the project you have to create a .env file for each subproject following the .env.example structure.
Then in the main folder of the project run (the first time adding also --build)
docker compose up
to start all the services (MongoDB and data simulator with Node-RED are remote; API service, front-end, pv-status-checker, event-service and importer are local).
Useful services for the user can be found exposed at the following links:
- API Service is at http://localhost:3000
- Front-End is at http://localhost
In alternative the deployed project front-end can be found at this link and API Service at this link.
The application is composed by 5 microsaervices:
- front-end
- API Service
- importer: has a scheduled activity to import data from URL of every weather station and pv system
- pv-status-checker: checks status of every pv system periodically and changes to "warning" or "ok"
- event-service: check for new events generated and sends them to the Telegram Bot at this link that requires access with the token given to users
The API Service can be used from localhost or remote at this link. Swagger is available at this link to learn the structure of our API. There are 7 resources that can be caught:
- PvInfo: resource for employee or admin about PV Systems installed;
- PvData: resource for employee or admin about production data of the PV Systems;
- WsInfo: resource for employee or admin about Weather Stations used;
- WsData: resource for employee or admin about Weather Data of the Stations;
- User: resource for admin, login and change password to manage users;
- Reports: resource for everyone to get statistics about production on the PV Systems of the owner.
- Events: events generated when a pv system needs maintenance or a peak of production is predicted.
The web-app can be visited from localhost or at this link. The home page is the public statistics page for citizens. The user can login as an employee to view more detailed performance data of the PV Systems or as an admin to have the same functionalities of the employee and to manage users, PV Systems and Weather Stations.