Skip to content

Commit 94e1dd1

Browse files
committed
Enhance documentation for ContosoDashboard application structure and features
1 parent 16ded66 commit 94e1dd1

1 file changed

Lines changed: 81 additions & 57 deletions

File tree

Instructions/Labs/LAB_AK_13_implement-spec-driven-development.md

Lines changed: 81 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,14 @@ GitHub Importer allows you to create a complete copy of an existing repository i
239239
240240
1. Explore the repository structure to familiarize yourself with the existing application:
241241
242-
- `Models/` - Contains 7 entity classes (User, TaskItem, Project, etc.)
243-
- `Data/` - ApplicationDbContext with EF Core configuration
244-
- `Services/` - 5 service implementations for business logic
245-
- `Pages/` - 7 Blazor pages (Dashboard, Tasks, Projects, Team, Notifications, Profile, ProjectDetails)
246-
- `Shared/` - Layout components and navigation
247-
- `README.md` and `PROJECT_SUMMARY.md` - Application documentation
242+
- `ContosoDashboard/` - The main application folder
243+
- `ContosoDashboard/Models/` - 7 entity classes (User, TaskItem, Project, ProjectMember, TaskComment, Notification, Announcement)
244+
- `ContosoDashboard/Data/` - ApplicationDbContext with EF Core configuration and seed data
245+
- `ContosoDashboard/Services/` - 6 service implementations for business logic (TaskService, ProjectService, UserService, NotificationService, DashboardService, CustomAuthenticationStateProvider)
246+
- `ContosoDashboard/Pages/` - 11 Blazor/Razor pages (Index, Tasks, Projects, ProjectDetails, Team, Notifications, Profile, Login, Logout, _Host)
247+
- `ContosoDashboard/Shared/` - Layout components (MainLayout, NavMenu, RedirectToLogin)
248+
- `StakeholderDocs/` - Business requirements documentation
249+
- `README.md` - Application documentation with authentication details
248250
249251
### Step 2: Clone the repository and initialize GitHub Spec Kit
250252
@@ -318,12 +320,10 @@ Now you'll clone your imported repository and initialize it with GitHub Spec Kit
318320
plan.md
319321
tasks.md
320322
.github/
321-
Models/
322-
Data/
323-
Services/
324-
Pages/
325-
Shared/
326-
(... other existing files ...)
323+
ContosoDashboard/
324+
StakeholderDocs/
325+
README.md
326+
LICENSE-CODE
327327
```
328328
329329
### Step 3: Commit and push Spec Kit initialization
@@ -367,28 +367,32 @@ Open the project in VS Code to familiarize yourself with the existing applicatio
367367
1. Wait for VS Code to fully load the project. Explore the EXPLORER view to see the existing application structure:
368368
369369
```plaintext
370-
CONTOSODASHBOARD
370+
CONTOSODASHBOARD (root)
371371
├── .github/
372-
│ └── prompts/ (Spec Kit commands)
373-
├── constitution.md (Spec Kit file)
374-
├── spec.md (Spec Kit file)
375-
├── plan.md (Spec Kit file)
376-
├── tasks.md (Spec Kit file)
377-
├── Models/ (Existing: User, TaskItem, Project, etc.)
378-
├── Data/ (Existing: ApplicationDbContext)
379-
├── Services/ (Existing: TaskService, ProjectService, etc.)
380-
├── Pages/ (Existing: Index, Tasks, Projects, etc.)
381-
├── Shared/ (Existing: MainLayout, NavMenu)
382-
├── Program.cs (Existing: App configuration)
383-
├── README.md (Existing: Documentation)
384-
└── (other application files)
372+
│ └── prompts/ (Spec Kit commands)
373+
├── constitution.md (Spec Kit file)
374+
├── spec.md (Spec Kit file)
375+
├── plan.md (Spec Kit file)
376+
├── tasks.md (Spec Kit file)
377+
├── ContosoDashboard/ (Main application folder)
378+
│ ├── Models/ (User, TaskItem, Project, ProjectMember, TaskComment, Notification, Announcement)
379+
│ ├── Data/ (ApplicationDbContext.cs)
380+
│ ├── Services/ (TaskService, ProjectService, UserService, NotificationService, DashboardService, CustomAuthenticationStateProvider)
381+
│ ├── Pages/ (Index, Tasks, Projects, ProjectDetails, Team, Notifications, Profile, Login, Logout, _Host)
382+
│ ├── Shared/ (MainLayout, NavMenu, RedirectToLogin)
383+
│ ├── wwwroot/ (Static files, CSS)
384+
│ ├── Program.cs (App configuration)
385+
│ └── ContosoDashboard.csproj (Project file)
386+
├── StakeholderDocs/ (Business requirements)
387+
├── README.md (Application documentation)
388+
└── LICENSE-CODE
385389
```
386390
387391
1. Review the existing application documentation:
388392
389-
- Open `README.md` to understand the current application features
390-
- Open `PROJECT_SUMMARY.md` to see the technical implementation details
391-
- Browse the `Models/` folder to see the existing data entities
393+
- Open `README.md` to understand the current application features, mock authentication system, and security implementation
394+
- Browse the `ContosoDashboard/Models/` folder to see the existing data entities (7 entity models)
395+
- Review the `StakeholderDocs/` folder for business requirements documentation
392396
393397
1. Open the Copilot Chat view:
394398
@@ -419,12 +423,19 @@ Open the project in VS Code to familiarize yourself with the existing applicatio
419423
420424
**Understanding the Setup**: You now have a working ContosoDashboard application with GitHub Spec Kit initialized. The existing application provides:
421425
422-
- User authentication and role-based access control (Employee, Team Lead, Project Manager, Administrator)
423-
- Task management with status tracking and assignments
424-
- Project management with team members and progress tracking
425-
- Team collaboration features
426-
- Notification system
427-
- User profile management
426+
- Mock authentication system for training (cookie-based with user selection login - no password required)
427+
- Role-based access control with 4 roles: Employee, Team Lead, Project Manager, Administrator
428+
- Claims-based authorization with `[Authorize]` attributes on all protected pages
429+
- Service-level security to prevent IDOR vulnerabilities
430+
- Task management with status tracking, priorities, and assignments (via TaskService)
431+
- Project management with team members, progress tracking, and completion percentages (via ProjectService)
432+
- Team directory with department filtering and status indicators (via UserService)
433+
- Notification center with read/unread status and priority badges (via NotificationService)
434+
- Dashboard home page with personalized summary cards (via DashboardService)
435+
- User profile management with availability status and notification preferences
436+
- 7 entity models: User, TaskItem, Project, ProjectMember, TaskComment, Notification, Announcement
437+
- 6 business services with authorization checks
438+
- 11 Blazor/Razor pages including Login.cshtml and Logout.cshtml for authentication
428439
429440
You'll use GitHub Spec Kit to plan and implement the new document upload and management feature as an addition to these existing capabilities. The spec-driven approach ensures the new feature integrates seamlessly with the existing architecture while maintaining code quality and security standards.
430441
@@ -477,32 +488,39 @@ Use the `/speckit.constitution` command to create the project's governing princi
477488
478489
**Existing Application Context:**
479490
- ContosoDashboard is a working ASP.NET Core 8.0 Blazor Server application
480-
- Current features: task management, project tracking, team collaboration, notifications, user profiles
481-
- Uses Entity Framework Core 8 with SQL Server LocalDB
491+
- Current features: mock authentication (cookie-based user selection), task management, project tracking with team members, team directory, notifications center, user profiles, dashboard with summary cards
492+
- Application structure: ContosoDashboard/ folder contains Models/, Data/, Services/, Pages/, Shared/, wwwroot/
493+
- Uses Entity Framework Core 8 with SQL Server
482494
- Implements role-based access (Employee, Team Lead, Project Manager, Administrator)
483-
- Already has 7 entity models, 5 services, and complete UI pages
495+
- Already has 7 entity models (User, TaskItem, Project, ProjectMember, TaskComment, Notification, Announcement)
496+
- Already has 6 services (TaskService, ProjectService, UserService, NotificationService, DashboardService, CustomAuthenticationStateProvider)
497+
- Already has 11 pages including Login/Logout pages for authentication
484498
485499
**Technology Stack (Must Match Existing):**
486500
- Backend: ASP.NET Core 8.0 with Entity Framework Core 8
487-
- UI: Blazor Server with Bootstrap 5.3
501+
- UI: Blazor Server with Bootstrap 5.3 and Bootstrap Icons
488502
- Cloud: Microsoft Azure (App Service, SQL Database, Blob Storage, Key Vault)
489-
- Authentication: Microsoft Entra ID (infrastructure already in place)
503+
- Authentication: Cookie-based for training (Microsoft Entra ID infrastructure ready)
490504
- Development: .NET 8.0 SDK
491505
492506
**Architecture Principles (Must Follow Existing Patterns):**
493-
- Repository pattern for data access (match existing services)
494-
- Service layer for business logic (follow TaskService, ProjectService patterns)
507+
- Service layer pattern for business logic with authorization checks (follow TaskService, ProjectService patterns)
508+
- All data access through Entity Framework Core DbContext (ApplicationDbContext)
495509
- Dependency Injection (already configured in Program.cs)
496510
- Async/await for all I/O operations (existing standard)
497-
- Entity models in Models/ folder with proper relationships
511+
- Entity models in ContosoDashboard/Models/ folder with proper relationships
512+
- Services in ContosoDashboard/Services/ folder with IDOR protection
513+
- Pages in ContosoDashboard/Pages/ folder with [Authorize] attributes
514+
- Integration with MainLayout.razor and NavMenu.razor in ContosoDashboard/Shared/
498515
499516
**Security:**
500517
- TLS 1.3 encryption for data in transit
501518
- Encryption at rest for all stored data
502519
- Role-based access control (RBAC) matching existing roles
520+
- Service-level authorization checks to prevent IDOR vulnerabilities
503521
- Virus scanning for uploaded files
504522
- Store sensitive configuration in Azure Key Vault
505-
- Follow existing authentication patterns
523+
- Follow existing authentication patterns (cookie-based claims identity)
506524
507525
**Performance:**
508526
- Page loads under 2 seconds (match existing pages)
@@ -515,6 +533,7 @@ Use the `/speckit.constitution` command to create the project's governing princi
515533
- XML documentation for public APIs
516534
- WCAG 2.1 Level AA accessibility
517535
- Code style consistent with existing codebase
536+
- Bootstrap 5.3 classes for UI consistency
518537
- Integration with existing navigation and layout components
519538
```
520539
@@ -592,11 +611,9 @@ In this task, you use GitHub Copilot's `/speckit.specify` command to generate a
592611
593612
Use the following steps to complete this task:
594613
595-
1. Review the high-level requirements document located in the lab materials:
614+
1. Review the high-level requirements document:
596615
597-
Navigate to the following folder: spec-driven-development
598-
599-
1. Open the upload-manage-docs-feature-requirements-simplified.md file in Visual Studio Code or a text editor.
616+
In Visual Studio Code, open the `StakeholderDocs/document-upload-and-management-feature.md` file from your ContosoDashboard project.
600617
601618
1. Take 1-2 minutes to read through the requirements document, paying particular attention to:
602619
@@ -977,11 +994,11 @@ Use the following steps to complete this task:
977994
978995
1. **Create the Document entity model:**
979996
980-
In Visual Studio Code, create a new file in the existing `Models/` folder: `Models/Document.cs`
997+
In Visual Studio Code, create a new file in the existing `ContosoDashboard/Models/` folder: `ContosoDashboard/Models/Document.cs`
981998
982-
The Document entity will follow the same pattern as existing entities (User, TaskItem, Project, etc.) in the Models folder.
999+
The Document entity will follow the same pattern as existing entities (User, TaskItem, Project, ProjectMember, TaskComment, Notification, Announcement) in the ContosoDashboard/Models/ folder.
9831000
984-
1. Create the `Models/Document.cs` file and use GitHub Copilot to generate the entity:
1001+
1. Create the `ContosoDashboard/Models/Document.cs` file and use GitHub Copilot to generate the entity:
9851002
9861003
Type the following comment in the file:
9871004
@@ -996,9 +1013,9 @@ Use the following steps to complete this task:
9961013
9971014
1. **Implement the document upload service:**
9981015
999-
Create a new file in the existing `Services/` folder: `Services/DocumentService.cs`
1016+
Create a new file in the existing `ContosoDashboard/Services/` folder: `ContosoDashboard/Services/DocumentService.cs`
10001017
1001-
This service will follow the same pattern as existing services (TaskService, ProjectService, etc.).
1018+
This service will follow the same pattern as existing services (TaskService, ProjectService, UserService, NotificationService, DashboardService) with authorization checks to prevent IDOR vulnerabilities.
10021019
10031020
```csharp
10041021
// DocumentService for business logic
@@ -1016,7 +1033,7 @@ Use the following steps to complete this task:
10161033
10171034
1. **Create the upload API endpoint:**
10181035
1019-
If using Blazor Server (like the existing ContosoDashboard), you may create a code-behind file for a page. If adding Web API support, create `Controllers/DocumentsController.cs`:
1036+
For the Blazor Server architecture used in ContosoDashboard, you'll implement upload functionality in the page's code-behind or inline code. If you choose to add Web API support for file uploads, create `ContosoDashboard/Controllers/DocumentsController.cs`:
10201037
10211038
```csharp
10221039
// DocumentsController API endpoints
@@ -1029,11 +1046,18 @@ Use the following steps to complete this task:
10291046
// Include XML documentation comments for Swagger
10301047
```
10311048
1032-
1. **Create the upload UI component (Blazor example):**
1049+
1. **Create the upload UI component (Blazor page):**
1050+
1051+
Create a new file in the existing `ContosoDashboard/Pages/` folder: `ContosoDashboard/Pages/Documents.razor`
10331052
1034-
Create a new file in the existing `Pages/` folder: `Pages/Documents.razor`
1053+
This page will follow the same pattern as existing pages (Tasks.razor, Projects.razor, ProjectDetails.razor, Team.razor, Notifications.razor, Profile.razor) and integrate with the existing MainLayout.razor and NavMenu.razor in the ContosoDashboard/Shared/ folder.
10351054
1036-
This page will follow the same pattern as existing pages (Tasks.razor, Projects.razor, etc.) and integrate with the existing MainLayout and NavMenu.
1055+
Don't forget to:
1056+
- Add `@page "/documents"` directive at the top
1057+
- Add `@attribute [Authorize]` for authentication enforcement
1058+
- Inject DocumentService using `@inject`
1059+
- Use Bootstrap 5.3 classes for consistent styling
1060+
- Add navigation link to ContosoDashboard/Shared/NavMenu.razor
10371061
10381062
```razor
10391063
@* Document Upload Page *@

0 commit comments

Comments
 (0)