Skip to content

prvics/solarwatch-cc-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SolarWatch Project

SolarWatch is a full-stack web application designed to provide sunrise and sunset data for specific cities. The project includes a C# ASP.NET Core backend, React.js frontend, and is fully containerized using Docker. The backend uses Entity Framework with a database for data persistence.

Features

  • 🌅 Retrieve sunrise and sunset times for cities.
  • 🌍 Manage city data (CRUD operations).
  • 🛠 Authentication system with JWT support.
  • 💻 Responsive React.js frontend for a seamless user experience.
  • 🐳 Containerized with Docker for easy deployment.

Tech Stack

  • C#
  • ASP.NET Core
  • Entity Framework
  • MSSQL
  • JWT
  • NUnit
  • Moq
  • React
  • JavaScript
  • Axios
  • CSS3
  • Docker
  • GitHub

Backend

  • C# with ASP.NET Core for the REST API.
  • Entity Framework Core for database operations.
  • MSSQL.
  • Authentication using JWT Tokens.
  • Unit and Integration Tests with NUnit and Moq.

Frontend

  • React.js with modern JavaScript (ES6+).
  • Axios for API requests.
  • Responsive design using CSS

Tools

  • Docker for containerization.
  • GitHub for version control and repository hosting.

Prerequisites

Before running the application, ensure the following are installed:

  • Docker
  • Node.js
  • .NET SDK

Setup

Clone the Repository

Backend

  • cd backend

Restore dependencies and run migrations:

  • dotnet restore
  • dotnet ef database update

Run the API:

  • dotnet run

Frontend

  • cd frontend

Install dependencies:

  • npm i

Start the React application:

  • npm start

To run fully Dockerized

Run

  • cd Solarwatch

Run and Build the Containers:

Stop

  • cd Solarwatch

Stop the Containers:

  • docker-compose down

TroubleShoot

  • cd Solarwatch

If something doesn’t work:

  • Check logs: Use docker-compose logs to see what’s happening in the containers.

  • Restart with clean build: Run:

docker-compose down -v docker-compose up --build


API Endpoints

Authentication

  • POST /api/Auth/Register - Register a new user

  • POST /api/Auth/Login - Login and retrieve a token

  • POST /api/Auth/Register - Register a new user

  • POST /api/Auth/Login - Login and retrieve a token

City Management

  • GET /api/SolarWatch/cities - Get all cities
  • GET /api/SolarWatch/cities/{id} - Get a city by ID
  • POST /api/SolarWatch/cities - Create a new city
  • PUT /api/SolarWatch/cities/{id} - Update an existing city
  • DELETE /api/SolarWatch/cities/{id} - Delete a city

Sunrise and Sunset Management

  • GET /api/SolarWatch/sunrise-sunsets/{id} - Get sunrise and sunset data by ID
  • POST /api/SolarWatch/sunrise-sunsets - Create new sunrise and sunset data
  • PUT /api/SolarWatch/sunrise-sunsets/{id} - Update sunrise and sunset data
  • DELETE /api/SolarWatch/sunrise-sunsets/{id} - Delete sunrise and sunset data

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages