PRN222 Razor Pages project integrated with Google Gemini for document chat and RAG.
C#
0
13 commits
updated Jul 3, 2026
PRN222 Razor Pages Gemini is an ASP.NET Core Razor Pages web application for course document management, document-based chat, RAG retrieval, and Google Gemini integration. The project was built for the PRN222 course and follows a layered architecture so the UI, business logic, data access, and external AI integration stay separated.
App_Data/uploads for uploaded documents and extracted chunk images.The solution uses a 3-layer architecture with a Razor Pages presentation layer:
User / Browser
-> PRN222.Web Razor Pages UI and PageModel request handlers
-> PRN222.BLL Services, workflows, DTOs, RAG, Gemini adapters
-> PRN222.DAL EF Core DbContext, entities, repositories, migrations
-> SQL Server Application data persistence
PRN222.BLL -> Google Gemini API
Key architectural idea:
PRN222.Web handles UI, routing, validation, role authorization, and PageModel coordination.PRN222.BLL contains application workflows and business services such as document processing, chat, retrieval, benchmarking, and Gemini API adapters.PRN222.DAL owns EF Core entities, configuration, migrations, repositories, and the database context.PRN222_Assignment1/
|-- src/
| |-- PRN222.Web/ # Razor Pages presentation layer
| |-- PRN222.BLL/ # Business logic, DTOs, RAG, AI adapters
| |-- PRN222.DAL/ # EF Core data access and migrations
| |-- PRN222.Tests/ # xUnit test project
| `-- PRN222_Assignment1.sln
|-- Walkthrough.md
|-- Report_RAG_vs_Finetuning.md
`-- README.md
| Area | Technology |
|---|---|
| Web application | ASP.NET Core Razor Pages |
| Runtime | .NET 8 |
| Data access | Entity Framework Core |
| Database | SQL Server |
| AI provider | Google Gemini API |
| Testing | xUnit, Moq, FluentAssertions |
| UI | Razor Pages, Bootstrap, custom CSS, JavaScript |
Do not commit real API keys or private connection strings.
Set the SQL Server connection string and Gemini API key through User Secrets, environment variables, or local configuration that is not committed.
Example with .NET User Secrets:
cd src/PRN222.Web
dotnet user-secrets set "ConnectionStrings:DefaultConnection" "Server=(localdb)\\mssqllocaldb;Database=PRN222GeminiDb;Trusted_Connection=True;MultipleActiveResultSets=true"
dotnet user-secrets set "Gemini:ApiKey" "YOUR_GEMINI_API_KEY"
The committed appsettings.json keeps secret values empty by default.
Restore, build, and run from the repository root:
dotnet restore src/PRN222_Assignment1.sln
dotnet build src/PRN222_Assignment1.sln
dotnet run --project src/PRN222.Web/PRN222.Web.csproj
The web app will start on the URL shown by the dotnet run output.
dotnet test src/PRN222_Assignment1.sln
Development seed accounts are configured for local testing in src/PRN222.Web/appsettings.Development.json.
Use them only for local development or classroom demos. Change them before any real deployment.
PRN222 Razor Pages project integrated with Google Gemini for document chat and RAG.
C#
0
13 commits
updated Jul 3, 2026
PRN222 Razor Pages Gemini is an ASP.NET Core Razor Pages web application for course document management, document-based chat, RAG retrieval, and Google Gemini integration. The project was built for the PRN222 course and follows a layered architecture so the UI, business logic, data access, and external AI integration stay separated.
App_Data/uploads for uploaded documents and extracted chunk images.The solution uses a 3-layer architecture with a Razor Pages presentation layer:
User / Browser
-> PRN222.Web Razor Pages UI and PageModel request handlers
-> PRN222.BLL Services, workflows, DTOs, RAG, Gemini adapters
-> PRN222.DAL EF Core DbContext, entities, repositories, migrations
-> SQL Server Application data persistence
PRN222.BLL -> Google Gemini API
Key architectural idea:
PRN222.Web handles UI, routing, validation, role authorization, and PageModel coordination.PRN222.BLL contains application workflows and business services such as document processing, chat, retrieval, benchmarking, and Gemini API adapters.PRN222.DAL owns EF Core entities, configuration, migrations, repositories, and the database context.PRN222_Assignment1/
|-- src/
| |-- PRN222.Web/ # Razor Pages presentation layer
| |-- PRN222.BLL/ # Business logic, DTOs, RAG, AI adapters
| |-- PRN222.DAL/ # EF Core data access and migrations
| |-- PRN222.Tests/ # xUnit test project
| `-- PRN222_Assignment1.sln
|-- Walkthrough.md
|-- Report_RAG_vs_Finetuning.md
`-- README.md
| Area | Technology |
|---|---|
| Web application | ASP.NET Core Razor Pages |
| Runtime | .NET 8 |
| Data access | Entity Framework Core |
| Database | SQL Server |
| AI provider | Google Gemini API |
| Testing | xUnit, Moq, FluentAssertions |
| UI | Razor Pages, Bootstrap, custom CSS, JavaScript |
Do not commit real API keys or private connection strings.
Set the SQL Server connection string and Gemini API key through User Secrets, environment variables, or local configuration that is not committed.
Example with .NET User Secrets:
cd src/PRN222.Web
dotnet user-secrets set "ConnectionStrings:DefaultConnection" "Server=(localdb)\\mssqllocaldb;Database=PRN222GeminiDb;Trusted_Connection=True;MultipleActiveResultSets=true"
dotnet user-secrets set "Gemini:ApiKey" "YOUR_GEMINI_API_KEY"
The committed appsettings.json keeps secret values empty by default.
Restore, build, and run from the repository root:
dotnet restore src/PRN222_Assignment1.sln
dotnet build src/PRN222_Assignment1.sln
dotnet run --project src/PRN222.Web/PRN222.Web.csproj
The web app will start on the URL shown by the dotnet run output.
dotnet test src/PRN222_Assignment1.sln
Development seed accounts are configured for local testing in src/PRN222.Web/appsettings.Development.json.
Use them only for local development or classroom demos. Change them before any real deployment.