A functional personal project: a simple polls web app built with ASP.NET Core and Blazor WebAssembly. Designed for general users, it allows creating polls, voting anonymously, and managing favorites.
Live demo: https://pollsappblazor.online
- Users can create polls with multiple options.
- Anonymous voting; votes cannot be changed once submitted.
- Polls can have an expiration date.
- Votes visibility options: always visible, visible only after voting, or only after the poll ends.
- Users can mark polls as favorites.
- Admin access for managing polls.
- Front End: Blazor WebAssembly, MudBlazor
- Back End: ASP.NET Core, Entity Framework Core, Swashbuckle (Swagger)
- Database: PostgreSQL
- Communication: Azure Communication Services (registration and reset password mails).
- Hosting: Azure Web App Service (Linux), PostgreSQL database hosted on Aiven.
PollsAppBlazor follows a layered architecture with clear separation of concerns:
Shared <- DataAccess <- Application <- Server -> Client -> Shared
DataAccess:
- Implements repositories that interact with the database using Entity Framework Core.
- Encapsulates LINQ queries and persistence logic.
- Contains migrations.
Application:
- Contains the business logic of the application.
- Uses repositories from the DataAccess layer to implement services.
Server:
- Exposes controllers for the API endpoints.
- Handles authentication, authorization, and policies.
- Provides configuration and dependency injection setup.
- Performs simple validation using built-in data annotations.
Client
- Built with Blazor WebAssembly and styled with MudBlazor.
- Communicates with the Server through HTTP APIs.
- Provides the user interface for creating polls, voting, and managing favorites.
- Defines common DTOs and models used across Client, Server, and Application layers.
- Ensures conistencsy of contracts between frontend and backend.
- Ensure .NET 9+ and PostgreSQL are installed.
- Clone the repository.
- Add your connection string in secrets.json under ConnectionStrings:DefaultConnection:
"ConnectionStrings": {
"DefaultConnection": "Host=localhost;Port=5433;Database=pollsappblazor;Username=...;Password=...;"
}- Run database migrations:
dotnet ef database update --startup-project PollsAppBlazor.Server --project PollsAppBlazor.DataAccess
- Run the app
- Frontend available at http://localhost:7093
- Swagger UI available at http://localhost:7093/swagger (development only)
Notes: The app automatically seeds fake data in the development environment. Emails are sent through Azure Email Communication Service but are printed to the console in development.
- Login:
admin - Password:
P@ssw0rd1sNotS3cur3^:(