An open API service indexing awesome lists of open source software.

https://github.com/timothyjan/pplpro

Employee Management System with Angular (frontend), C# .NET MVC (backend), and SQL (database)
https://github.com/timothyjan/pplpro

Last synced: about 1 year ago
JSON representation

Employee Management System with Angular (frontend), C# .NET MVC (backend), and SQL (database)

Awesome Lists containing this project

README

          

# PplPro
Full-stack Employee Management System using ASP.NET Core, Angular, Bootstrap, and Azure SQL, implementing DTOs for data transfer, repository patterns for data access, and RESTful APIs for efficient employee, department, and role management, successfully deployed to Azure.

Process:


  • Set up Azure SQL Database

    • Create SQL database and choose pricing(free or basic lol).

    • Configure firewall settings(add local machine's IP address)

    • Get Connection String.



  • Create ASP.NET Core API Project

    • Create Project.

    • Add Required NuGet Packages

      • Microsoft.EntityFrameworkCore

      • Microsoft.EntityFrameworkCore.SqlServer

      • Microsoft.EntityFrameworkCore.Tools

      • Swashbuckle.AspNetCore



    • Define Models(Department, Role, Employee) and Data Transfer Objects (DTOs).

      • DTOs allow you to shape the data sent to the client and avoid exposing the navigation properties that cause cycles.



    • Create Database Context Setup

      • DbContext is used for querying data, tracking changes, saving data and managing relationships.

      • Restrict delete behavior to prevent cascading deletes for roles and departments.



    • Set up model repository for each model (DepartmentRepository, RoleRepository, EmployeeRepository)

      • Repository layer is a design pattern that abstracts and centralizes data access logic, providing a clean separation between the data layer and the business logic, improving maintainability, flexibility, and testability.



    • Create Controllers for each Model.

    • Set Up Environment Variables, specifically the connection string.

    • Configure Program.cs to use connection string from environmental variables.

    • Run Database Migrations.

      • Tools -> NuGet Package Manager -> Package Manager Console.

      • ~Add-Migration InitialCreate too add initial migrations. Generate a migration file in a folder called Migrations. The file contains the SQL schema changes required to create tables and relationships based on your models.

      • ~Update-Database will use the connection string in appsettings.json to connect to the Azure SQL Database and apply the schema changes defined in the migration.



    • Initialize the Database with Sample Data. Create a SeedData.cs.

    • Configure Program.cs to use SeedData.



  • Design frontend and set Up Angular Frontend to Communicate with the API.

    • Install dependencies

      • Bootstrap



    • Create Models (Department, Role, Employee)

    • Generate components(Create and List) and services for Department, Role, Employee.

    • Configure Angular Environment Variables for development and production using environment.

    • Set up HTTP Interactions, connecting Angular to ASP.NET Core API.

    • Enable CORS in ASP.NET Core.

    • Build Angular for production

      • ~ng build --configuration production



    • Create wwwroot folder and add teh created production browser files (favicon.io, index.html, main, polyfills, and styles) from the dist folder.

    • Configure Program.cs to UseDefaultFiles and UseStaticFiles.



  • Deploy to Azure App Service

    • Create an Azure App Service.

    • Set Environment Variables in Azure.

    • Modify Program.cs to Support Swagger

    • Publish



  • Deal with many deployment issues such as Swagger.