Sign inSign up

archety/backend-api-employees

By archety

•Updated 11 days ago

ASP.NET Core .NET 10 REST API with EF Core for the Archety Full Stack learning project.

Image
Networking
Languages & frameworks
API management
0

77

archety/backend-api-employees repository overview

⁠Company API – ASP.NET Core .NET 10 + Entity Framework Core

Educational REST API built with ASP.NET Core .NET 10 and Entity Framework Core, designed as the backend of a simple Full Stack application for managing employees and departments.

This project is part of a complete learning path covering:

  • ASP.NET Core .NET 10
  • Entity Framework Core
  • SQL Server
  • Docker
  • Docker Compose
  • Angular
  • Bootstrap
  • Angular Signals

⁠⚠️ Database dependency

This image is designed to work together with the following SQL Server container:

archety/sqlserver-emplyees

https://hub.docker.com/repository/docker/archety/sqlserver-emplyees⁠

The database container automatically initializes the CompanyDB database, which contains the following tables:

  • Department
  • Employee

This REST API uses Entity Framework Core to connect to that database and expose CRUD operations.


⁠Architecture

Angular Frontend
       |
       | HTTP / JSON
       v
ASP.NET Core REST API
       |
       | Entity Framework Core
       v
SQL Server
       |
       v
CompanyDB

When the containers are started through Docker Compose, the backend connects to SQL Server using the Docker service name:

Server=sqlserver,1433

⁠Main technologies

  • .NET 10
  • ASP.NET Core Web API
  • Entity Framework Core
  • Microsoft SQL Server
  • REST
  • LINQ
  • Dependency Injection
  • DTOs
  • Asynchronous programming
  • Docker
  • Docker Compose

⁠API features

The REST API provides CRUD operations for:

⁠Employees
GET     /api/employees
GET     /api/employees/{id}
POST    /api/employees
PUT     /api/employees/{id}
DELETE  /api/employees/{id}
⁠Departments
GET     /api/departments
GET     /api/departments/{id}
POST    /api/departments
PUT     /api/departments/{id}
DELETE  /api/departments/{id}

⁠Entity Framework Core

The project demonstrates the practical use of:

  • DbContext
  • DbSet
  • LINQ
  • Include
  • Navigation properties
  • One-to-Many relationships
  • Change Tracking
  • SaveChangesAsync
  • Asynchronous queries
  • Entity to DTO mapping

The main relationship is:

Department
    1
    |
    |
    N
Employee

⁠Docker usage

Example Docker Compose configuration:

backend:
  image: archety/company-api:latest

  ports:
    - "8080:8080"

  environment:
    ASPNETCORE_URLS: "http://+:8080"

    ConnectionStrings__CompanyDB: "Server=sqlserver,1433;Database=CompanyDB;User Id=sa;Password=YOUR_PASSWORD;TrustServerCertificate=True;"

  depends_on:
    - sqlserver

The SQL Server service must be available on the same Docker network.


⁠Example request

GET /api/employees

Example response:

{
  "id": 1,
  "firstName": "Luca",
  "lastName": "Rossi",
  "employeeRole": "Software Engineer",
  "employeeCode": "EMP-001",
  "departmentRef": 1,
  "departmentName": "Engineering"
}

⁠Educational project

This image was created mainly for educational purposes.

The goal is to demonstrate, step by step, how to build a real Full Stack application starting from the database and ending with the frontend.

The project shows the full data flow:

Angular
   ↓
REST API
   ↓
Controller
   ↓
DTO
   ↓
Entity Framework Core
   ↓
SQL Server

⁠🎓 Complete YouTube course

The complete project is explained inside the free Full Stack course available on the Archety YouTube channel:

https://www.youtube.com/playlist?list=PLoZNHBEyxFQF_WPhyI1dBR6H3dBkOUqwO⁠

The course covers:

  • SQL Server with Docker
  • Dockerfile and Docker Compose
  • ASP.NET Core
  • REST APIs
  • Entity Framework Core
  • DTOs
  • Dependency Injection
  • CRUD operations
  • Error handling
  • Angular
  • Bootstrap
  • Angular Signals
  • Reactive Forms
  • Frontend / Backend integration
  • Full Stack containerization

SQL Server database image used by this project:

https://hub.docker.com/repository/docker/archety/sqlserver-emplyees⁠

This REST API directly depends on the database structure provided by that image.


⁠Archety

Archety is a technical education project focused on practical software development, DevOps and modern development technologies.

🌐 Website
https://www.archety.dev⁠

▶️ YouTube Channel
https://www.youtube.com/@archetydev⁠

🎓 Full Stack Course
https://www.youtube.com/playlist?list=PLoZNHBEyxFQF_WPhyI1dBR6H3dBkOUqwO⁠


⁠License

This project is provided for educational purposes.

You are free to use, study and modify the source code for learning and experimentation.

Please provide appropriate attribution when redistributing substantial portions of the project.


⁠Author

Archety

Software Development, DevOps and Technical Training.

https://www.archety.dev⁠

Tag summary

Content type

Image

Digest

sha256:899bd9a9c…

Size

118.2 MB

Last updated

11 days ago

docker pull archety/backend-api-employees