Full-stack project task and employee management app with CRUD functionality for projects, tasks, employees, departments, and roles using ASP.NET Core, Angular, Bootstrap, and SQL Server.
Process:
- SQL Server Management Studio
- Connect to Server
- Server Type: Database Engine
- Server Name: localhost
- Authentication: Windows Authentication
- Connect
- Create a new Database
- In the Object Explorer, right-click on Databases and select New Database
- Database Name: TaskTrackrDb
- Configure a User
- Expand the Security node.
- Right-click Logins and select New Login
- In the Login - New dialog:
- Login Name: Enter a username
- Authentication: Choose SQL Server Authentication and set a password.
- In the left panel, go to User Mapping, check your database (TaskTrackrDb), and assign the db_owner role.
- Configure the Connection String in appsettings.json
"DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=TaskTrackrDb;Trusted_Connection=True;"
- Connect to Server
- Create ASP.NET Core API
- Add Required NuGet Packages
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Tools
- Create Models(Department, Role, Employee, Project, ProjectTask) with data annotations.
- Create DTOs to transfer only the required data between the client and server. Also to avoid exposing the navigation properties that cause cycles.
- DTOs allow you to shape the data sent to the client and avoid exposing the navigation properties that cause cycles.
- Create Database Context JanTaskTrackerDbContext
- This serves as a bridge between the application and the database using Entity Framework Core.
- DbContext is used for querying data, tracking changes, saving data and managing relationships.
- Restrict delete behavior to prevent cascading deletes for roles and departments.
- Create Controllers for each Model.
- Configure Program.cs to use connection string to SQL Server
- Create migrations and apply to the database to create tables
- Add Migration: ~
dotnet ef migrations add InitialCreate
- Apply Migration: ~
dotnet ef database update
- Add Migration: ~
- Seed database with dummy data
- Create SeedData.cs.
- Modify Program.cs to call the
SeedData.Initialize
method during application startup. - Add migrations and apply to the database to create tables
- Add Migration: ~
dotnet ef migrations add SeedDataMigration
- Apply Migration: ~
dotnet ef database update
- Add Migration: ~
- Clean and Recreate Database (Development Only)
- ~
dotnet ef database drop
- ~
dotnet ef migrations remove
- ~
dotnet ef migrations add InitialCreate
- ~
dotnet ef database update
- ~
- Test all methods on Swagger.
- Add Required NuGet Packages
- Frontend with Angular and Bootstrap
- Create models(Department, Role, Employee, Project, ProjectTask).
- Create services to handle communication with the database.
- Install Bootstap: ~
npm install bootstrap
- Create components for project-list and user-list.