SolarWatch is a web application that delivers accurate sunrise and sunset times in UTC for any city and date. To optimize efficiency, it employs a caching mechanism that first checks the local database for requested data. If the information is unavailable locally, SolarWatch retrieves it from an external API, stores it in the database, and uses the cached data for future requests.
-
Retrieve daily sunrise and sunset timings for specified locations and dates
-
Data caching through a database system to minimize external API requests
-
Secure authentication using JSON Web Tokens (JWT) with role-based permissions
-
Containerization via Docker Compose for simplified deployment processes
-
Continuous integration (CI) pipeline implementing GitHub Actions for automated testing protocols and code quality assurance
Follow the steps below to run the application locally using Docker.
➡️ Docker Desktop must be installed and running.
➡️ An OpenWeather API key is required. You can sign up here.
- Clone the Repository
- Open a terminal and navigate to the directory where you want to store the project. Then run:
git clone https://github.com/CodecoolGlobal/solar-watch-MVP-java-Dyrun.git
cd solar-watch-MVP-java-Dyrun-
Rename
example.envFile- In the repository folder you can find the
example.envfile. - Rename the
example.envfile to.envby simply removing theexamplepart.
- In the repository folder you can find the
-
Add OpenWeather API Key
- Add your OpenWeather API key to the API_KEY field in the
.envfile.
- Add your OpenWeather API key to the API_KEY field in the
-
Start the Application with Docker
- Execute the following command in your terminal to build and start the containers:
docker compose up --build
- Execute the following command in your terminal to build and start the containers:
-
Access the Application
- Open your browser and visit:
http://localhost:3000
- Open your browser and visit:
-
Stopping the Application
-
In your terminal press
Ctrl + C -
If you want to stop and remove the containers, but keep the database data for future runs, execute:
docker compose down
In this case, the database will persist between runs, and your data will still be available next time you start the application.
-
If you want to stop, remove the containers and delete the database data, execute:
docker compose down -v
In this case, the database and all stored data will be completely removed.
-
-
Register an account or log in if you already have one.
-
Search for a City
- The default value is Budapest.
- To search for a different city enter the name of a city in the search field.
- Click on the Get sunrise and sunset button.
-
Select a Date
- The default value is the current date.
- To choose a different date, use the date selector next to the input field before submitting your search.
-
Results are displayed
- The application will return accurate sunrise and sunset times in UTC for the specified city and date.
- Sunrise-Sunset-API for the sunrise and sunset times
- OpenWeatherMaps for latitude and longitude data for the cities
- Best-README-Template for the readme structure
- Shields.io for the badges
