The purpose of this project is to create a simple ads list app that allows users to list and create/update Ads.
The project is structured as follows:
The backend is a .NET 8 Web API structured as follows:
- Api: Contains the endpoints definitions, middleware and an Http file which can be used to test the endpoints.
- Application: Contains the models, business logic, repositories and services.
- Contracts: Contains the interfaces for the endpoints (requests and responses). These items were moved to a separate project so that, if necessary, they might be distributed to API consumers (e.g. by creating a Nuget package).
The frontend is a .NET 8 Blazor Web App with both the Server and Client projects. It follows the Blazor Web App template structure, with a server project serving as the entry point of the application and server-side rendered components (both static and interactive) and a client project containing the components and pages rendered in the client side (WebAssembly).
The shared project contains items shared by both the backend and frontend projects.
-
Clone this repository or download a ZIP archive of the repository.
-
The default and fallback URLs for the two apps are:
VooltChallenge.Api
app (BackendUrl
):https://localhost:7292
(fallback:https://localhost:5276
)VooltChallenge.Ui
app (FrontendUrl
):https://localhost:7192
(fallback:https://localhost:5176
)
You can use the existing URLs or update them in the
appsettings.json
files:appsettings.json
file in the root of theVooltChallenge.Api
app.VooltChallenge.Ui/appsettings.json
file in theVooltChallenge.Ui
app.VooltChallenge.Ui.Client/wwwroot/appsettings.json
file in theVooltChallenge.Ui.Client
app.
-
If you plan to run the apps using the .NET CLI with
dotnet run
, note that first launch profile in the launch settings file is used to run an app, which is the insecurehttp
profile (HTTP protocol). To run the apps securely (HTTPS protocol), take either of the following approaches:- Pass the launch profile option to the command when running the apps:
dotnet run -lp https
. - In the launch settings files (
Properties/launchSettings.json
) of both projects, rotate thehttps
profiles to the top, placing them above thehttp
profiles.
If you use Visual Studio to run the apps, Visual Studio automatically uses the
https
launch profile. No action is required to run the apps securely when using Visual Studio. - Pass the launch profile option to the command when running the apps:
-
Run the
VooltChallenge.Api
andVooltChallenge.Ui
apps. -
Navigate to the
VooltChallenge.Ui
app at theFrontendUrl
.
- .NET 8 (C# 12)
- Minimal Apis with output caching middleware
- EF Core 8 (In-Memory Database)
- Blazor
- FluentValidation
- Fluent UI
- Bogus (for generating fake data)
- Add a real database (e.g. SQL Server or PostgreSQL)
- Add authentication and authorization
- Add logging
- Add a delete endpoint
- Add filtering, sorting and pagination for the list endpoint (and implement it in the frontend)
- Add tests (unit, integration, architectural)
- Create a CI/CD pipeline (e.g. GitHub Actions or Azure DevOps)
- As this is a simple project, the backend was structured as using n-tier architecture. However, for larger applications, it would be advisable to refactor it to use another architectural style, such as Clean Architecture or Vertical Slices