SolarWatch is a full-stack web application developed using Java Spring Boot. It allows users to register or login, select a city from a predefined list, and choose a past date. The application then provides the sunrise and sunset times for that specific date and location. This tool is perfect for those who need historical solar data for various purposes.
- User Registration: Users can create an account and log in securely.
- City Selection: Users can select a city from a list of predefined locations.
- Date Selection: Users can choose a past date to retrieve sunrise and sunset times.
- Data Retrieval: The system displays the sunrise and sunset times for the selected city and date.
- React.js: A JavaScript library for building user interfaces.
- Java Spring: A comprehensive framework for building enterprise-level applications.
- Spring Data JPA: For managing data persistence with PostgreSQL in a seamless and efficient manner.
- Java Security: Ensures secure user authentication and authorization.
- Docker Compose: Facilitates the setup and orchestration of the development environment.
- PostgreSQL: A relational database system used to store user data, city information, and historical solar data.
Before you begin, ensure you have the following installed:
- Node.js (for frontend)
- Java JDK (for backend)
- Docker and Docker Compose (for containerization)
- PostgreSQL (if not using Docker)
-
Clone the Repository:
git clone https://github.com/CodecoolGlobal/solarwatch-new-features-general-zsbrigi cd solarWatch
-
Frontend Setup:
Navigate to the
frontend
directory:cd frontend_solarwatch npm install npm start
This will start the React development server on
http://localhost:3000
. -
Backend Setup:
Navigate to the
backend
directory:cd backend_solarwatch ./mvnw clean install
You can start the Spring Boot application using:
./mvnw spring-boot:run
The backend will run on
http://localhost:8080
. -
Database Setup:
If you are using Docker Compose, simply run:
docker-compose up
This will set up the PostgreSQL database automatically.
If you prefer to set up PostgreSQL manually, ensure that your
application.properties
orapplication.yml
file is configured with the correct database credentials. -
Accessing the Application:
Once both frontend and backend are running, you can access the application via your web browser at
http://localhost:3000
.
- Register: Create an account using the registration form.
- Login: Log in with your credentials.
- Select a City and Date: Choose a city from the list and a past date to retrieve the sunrise and sunset times.
- View Results: The application will display the sunrise and sunset times for the selected city and date.