Skip to content

CodecoolGlobal/solar-watch-MVP-java-Dyrun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

134 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solar Watch

Table of Contents

About The Project

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.

Features

  • 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

Solar Watch

Built With

  • Backend:
    Spring Boot

  • Frontend:
    React
    NGINX TailwindCSS

  • Database:
    PostgreSQL

  • Containerization:
    Docker

Getting Started

Follow the steps below to run the application locally using Docker.

Prerequisites

➡️ Docker Desktop must be installed and running.
➡️ An OpenWeather API key is required. You can sign up here.

Installation Steps

  1. 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
  1. Rename example.env File

    • In the repository folder you can find the example.env file.
    • Rename the example.env file to .env by simply removing the example part.
  2. Add OpenWeather API Key

    • Add your OpenWeather API key to the API_KEY field in the .env file.
  3. Start the Application with Docker

    • Execute the following command in your terminal to build and start the containers:
      docker compose up --build
  4. Access the Application

  5. 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.

Usage

Retrieving Sunrise and Sunset Times

  1. Register an account or log in if you already have one.

  2. 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.
  3. 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.
  4. Results are displayed

    • The application will return accurate sunrise and sunset times in UTC for the specified city and date.

Acknowledgements

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published