Welcome to SolarWatch, a web application that provides users with weather-related features, including sunrise and sunset timings, today's weather forecast, and a history of their searches. This project demonstrates a full-stack web application built using modern technologies.
Solarwatch.mp4
-
User Registration & Login:
- Secure user registration and authentication using ASP.NET Identity.
- Logged-in users can access their search history.
-
Sunrise & Sunset Information:
- Search for sunrise and sunset times for any city by name.
- Select a specific date for detailed sunrise and sunset information.
-
Today's Weather Forecast:
- View the current day's weather forecast for the searched city.
-
Search History:
- Logged-in users can view their past searches for easy reference.
- C# ASP.NET Core: Handles API requests and user authentication.
- Entity Framework Core: ORM for SQL database operations.
- React: For building an interactive and responsive user interface.
- CSS: Basic styling for a clean and functional design.
- SQL Server: Stores user data, search history, and other relevant data.
- Dockerized application for streamlined deployment and local setup.
This project includes automated tests that are run on every push and pull request using GitHub Actions. These tests help ensure code quality and catch potential issues early in the development process.
The test workflows are configured in the Github Actions tab.
- Docker installed on your machine.
- Git for cloning the repository.
- Clone the Repository:
git clone https://github.com/pixhy/solarwatch-api-csharp-
Build and Start the Application (using Docker Compose):
- Add docker to your services
- Run docker-compose up in the
docker-compose.ymlfile.
-
Configuration settings:
An empty configuration file appsettings_empty.json is provided in the project. Copy its contents to appsettings.json.
Ensure the following settings are configured in appsettings.json:
-
DefaultConnection: Connection string for your SQL Server. If you are using Docker Compose, use the connection string from the sampleappsettings_empty.jsonfile. -
The connection string has to use the same password that is set in the compose file as SA_PASSWORD!
-
OpenWeatherMapAPIKey: API key for OpenWeatherMapAPI for getting geolocations. -
WeatherAPIKey: API key for the weather forecast.
- Frontend setup:
- Navigate to the frontend folder:
cd \Solarwatch\Frontend
- Install dependencies:
npm install
- Start the React development server:
npm run dev
Solarwatch/
│
├── Backend/ # ASP.NET Core project
│ ├── Controllers/ # API controllers
│ ├── Models/ # Entity Framework models
│ ├── Authentication/ # Service for Authentication
│ ├── Contracts/ # Contracts for AuthController
│ ├── Data/ # Docker Migration & list of countries
│ ├── DbContext/ # Database Context
│ ├── Services/ # Services&Interfaces used by Controllers
│ └── Dockerfile # Dockerfile for backend
│
├── Frontend/ # React project
│ └── src/
│ ├── components/ # Reusable React components
│ └── assets/ # Pictures for website
│
├── docker-compose.yml # Docker Compose configuration
└── README.md # Project documentation
Tables
- AspNetUsers
- AspNetUserRoles
- Cities
- SunriseAndSunsets
- UserHistoryEntries