Skip to content

Commit a6337b3

Browse files
committed
🧹 Cleanup: Removed Initial EF Core Migration Files
- 🗑️ Deleted auto-generated Entity Framework Core migration files - 🔄 Resetting migration history for a fresh start with DB schema management - Updated documentation project description
1 parent 74ccfb9 commit a6337b3

4 files changed

Lines changed: 208 additions & 2 deletions

File tree

Infrastructure/Migrations/20250608114228_InitialMigration.Designer.cs

Lines changed: 53 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using Microsoft.EntityFrameworkCore.Migrations;
3+
4+
#nullable disable
5+
6+
namespace Infrastructure.Migrations
7+
{
8+
/// <inheritdoc />
9+
public partial class InitialMigration : Migration
10+
{
11+
/// <inheritdoc />
12+
protected override void Up(MigrationBuilder migrationBuilder)
13+
{
14+
migrationBuilder.CreateTable(
15+
name: "Location",
16+
columns: table => new
17+
{
18+
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
19+
StreetName = table.Column<string>(type: "nvarchar(250)", nullable: false),
20+
City = table.Column<string>(type: "nvarchar(100)", nullable: false),
21+
State = table.Column<string>(type: "nvarchar(250)", nullable: false)
22+
},
23+
constraints: table =>
24+
{
25+
table.PrimaryKey("PK_Location", x => x.Id);
26+
});
27+
}
28+
29+
/// <inheritdoc />
30+
protected override void Down(MigrationBuilder migrationBuilder)
31+
{
32+
migrationBuilder.DropTable(
33+
name: "Location");
34+
}
35+
}
36+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// <auto-generated />
2+
using System;
3+
using Infrastructure.Contexts;
4+
using Microsoft.EntityFrameworkCore;
5+
using Microsoft.EntityFrameworkCore.Infrastructure;
6+
using Microsoft.EntityFrameworkCore.Metadata;
7+
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
8+
9+
#nullable disable
10+
11+
namespace Infrastructure.Migrations
12+
{
13+
[DbContext(typeof(DataContext))]
14+
partial class DataContextModelSnapshot : ModelSnapshot
15+
{
16+
protected override void BuildModel(ModelBuilder modelBuilder)
17+
{
18+
#pragma warning disable 612, 618
19+
modelBuilder
20+
.HasAnnotation("ProductVersion", "9.0.5")
21+
.HasAnnotation("Relational:MaxIdentifierLength", 128);
22+
23+
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
24+
25+
modelBuilder.Entity("Infrastructure.Entities.LocationEntity", b =>
26+
{
27+
b.Property<Guid>("Id")
28+
.ValueGeneratedOnAdd()
29+
.HasColumnType("uniqueidentifier");
30+
31+
b.Property<string>("City")
32+
.IsRequired()
33+
.HasColumnType("nvarchar(100)");
34+
35+
b.Property<string>("State")
36+
.IsRequired()
37+
.HasColumnType("nvarchar(250)");
38+
39+
b.Property<string>("StreetName")
40+
.IsRequired()
41+
.HasColumnType("nvarchar(250)");
42+
43+
b.HasKey("Id");
44+
45+
b.ToTable("Location");
46+
});
47+
#pragma warning restore 612, 618
48+
}
49+
}
50+
}

README.md

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,70 @@
1-
# NexusPoint
21

3-
Location service for our Khala Event app.
2+
# 🚀 Project Description
3+
4+
**NexusPoint** is a backend service designed to manage location data for an application named "Khala Event". Built with .NET 9, it functions as a RESTful API that exposes endpoints for retrieving location information. The project is structured following **Clean Architecture** principles, ensuring a clear separation of concerns between the API interface, business logic, and data access layers.
5+
6+
The application connects to an **Azure SQL** database for data persistence and leverages other Azure services for robust cloud-native operation. It integrates with **Azure Key Vault** to securely manage secrets like database connection strings and uses **Azure Blob Storage** for file storage needs. The API is well-documented using **Swagger (OpenAPI)** and **Scalar**, providing an interactive way to explore and test the endpoints.
7+
8+
---
9+
10+
## ⚙️ How It Works
11+
12+
The NexusPoint service is built on a layered architecture that ensures scalability and maintainability. The data flows through distinct layers, each with a specific responsibility.
13+
14+
### 1. API Layer (Presentation)
15+
16+
* **Entry Point**: A request starts at the `LocationController`, which handles incoming HTTP GET requests for a specific location, identified by a GUID.
17+
* **Request Handling**: The controller validates the incoming GUID. It then calls the `ILocationService` to process the request.
18+
* **Response Generation**: Upon receiving a result from the service layer, it uses the `ApiResponseHelper` to format a standardized JSON response, whether it's a success (200 OK) or an error (e.g., 404 Not Found, 500 Internal Server Error).
19+
20+
### 2. Core Layer (Application & Domain Logic)
21+
22+
* **Service (`LocationService`)**: This is the core of the business logic. It receives the request from the controller and orchestrates the data retrieval by calling the `ILocationRepository`.
23+
* **Error & Result Handling**: It uses a `RepositoryResult` pattern to handle different outcomes from the repository—such as a successful data retrieval, a "not found" scenario, or a database connection error—without throwing exceptions for expected conditions.
24+
* **Data Transfer Objects (DTOs)**: The service uses the `ILocationDtoFactory` to convert the internal domain model (`Location`) into a `LocationDisplay` DTO. This ensures that only necessary data is exposed to the client.
25+
* **Domain Models**: The `Domain` folder contains the pure data structures of the application, like `Location` and `Error`, with no dependencies on other layers.
26+
27+
### 3. Infrastructure Layer (Data Access & External Services)
28+
29+
* **Repository (`LocationRepository`)**: This class implements the `ILocationRepository` interface and inherits from a generic `BaseRepository`. It is responsible for all database interactions.
30+
* **Entity Framework Core**: The repository uses `DataContext` to query the database. It translates domain-level queries into SQL queries that Entity Framework Core can execute against the Azure SQL database.
31+
* **Factories (`LocationFactory`)**: The `LocationFactory` handles the mapping between the `Location` domain model and the `LocationEntity` database entity, keeping the core logic completely decoupled from the database schema.
32+
* **Dependency Injection**: The entire system is wired together using .NET's built-in dependency injection. The `Core` and `Infrastructure` layers register their services (`AddCoreServices`, `AddInfrastructure`) in the main `Program.cs` file, allowing components like controllers and services to receive their dependencies automatically.
33+
34+
### 4. CI/CD Pipeline
35+
36+
* A **GitHub Actions** workflow is defined in `main_nexuspoint.yml`.
37+
* When code is pushed to the `main` branch, it automatically triggers a build process on an `ubuntu-latest` runner.
38+
* The workflow builds the .NET application, publishes the artifacts, and then deploys them to an **Azure Web App** named "Nexuspoint" in the "Production" slot.
39+
40+
---
41+
42+
## 🛠️ Tech Stack
43+
44+
### Backend
45+
46+
* **Framework**: ASP.NET Core
47+
* **Language**: C#
48+
* **.NET Version**: 9.0
49+
50+
### Database
51+
52+
* **ORM**: Entity Framework Core
53+
* **Database**: Azure SQL
54+
55+
### API & Documentation
56+
57+
* **API Type**: RESTful Web API
58+
* **Documentation**: Swagger (OpenAPI) & Scalar
59+
60+
### Cloud & DevOps
61+
62+
* **Hosting**: Azure Web Apps
63+
* **Secrets Management**: Azure Key Vault
64+
* **File Storage**: Azure Blob Storage
65+
* **CI/CD**: GitHub Actions
66+
67+
### Architecture
68+
69+
* **Pattern**: Clean Architecture (Onion Architecture)
70+
* **Key Principles**: Dependency Injection, Repository Pattern, Factory Pattern

0 commit comments

Comments
 (0)