A .NET 9 web application inspired by Twitter, featuring posts with media, comments, conversations, follows, and real-time notifications. Built with Razor Pages, Keycloak, PostgreSQL, Azurite, SignalR, and Clean Architecture.
-
User Accounts
- Register and log in using Keycloak authentication.
- Edit profile picture.
- Follow other users and see who follows you.
-
Posts
- Create posts with optional images or videos.
- Track views for each post.
- Delete own posts.
- Comment on posts (comments behave similarly to posts).
- Search posts by content criteria.
-
Conversations
- Create conversations by providing:
- Conversation name
- (Optional) profile picture
- Selected users to add
- Conversation creator can:
- Add/remove users
- Update name/profile picture
- Delete the conversation
- Participants can send messages in that conversation and can leave conversations.
- Create conversations by providing:
-
Notifications via SignalR
- New conversation created
- Removed from a conversation
- Updates on a conversation you are part of
- New post by a followed user
- Built with .NET 9
- Presentation layer implemented with Razor Pages
- Docker Compose configured with:
- PostgreSQL as the main database (users, posts, etc.)
- Keycloak as the identity provider
- Separate Keycloak database for storing information (passwords, emails)
- Azurite for blob storage of post images and videos
- JWT-based authentication stored in cookies, with session revocation support via Keycloak admin panel
- HTMX used for improved UX and dynamic form updates
- Option to seed the database with fake data using Bogus
- Project follows Clean Architecture principles
- .NET SDK 9.0.304
- Docker Desktop
- Azure Storage Explorer (for local blob containers)
- Playwright (for functional tests)
-
Clone the repository:
git clone https://github.com/Vandal166/POSTER.git
-
Run Docker Compose:
docker compose up -d
-
Navigate to the web project:
cd src/Web -
Apply EF migrations:
dotnet ef database update
-
Configure Keycloak:
- Access the Keycloak admin panel.
Note If the container fails to start with
connection refused, re-run it (sometimesweb.keycloakstarts beforekeycloak.dbinitializes). - Log in using:
Username: admin Password: admin - Go to Manage Realms → Create realm.
Name itPosterRealmand import the configuration from/keycloak/realm-export.json.
- Access the Keycloak admin panel.
-
Configure client secrets in Keycloak:
-
For client
poster-admin:
Go to Credentials → Regenerate Client Secret.
Copy the secret intoapplication.Development.jsonunderAdminClientSecretsection. -
For client
poster-frontend:
Do the same and copy intoClientSecretsection.
-
-
Set up storage containers with Storage Explorer
- Navigate to Emulator & Attached → Emulator (Default Ports) → Blob Containers
- Create two containers:
imagesandvideos.
-
Run the web application:
dotnet run
Located under the /tests directory:
- Domain.UnitTests → Tests for entities and their business logic.
- Application.UnitTests → Tests for business logic of various services.
- Application.IntegrationTests → Verifies services integrate correctly with the database.
- Web.FunctionalTests → Tests registration, login, and protected pages.
Before running functional tests, configure Playwright:
cd .\tests\Web.FunctionalTests\
powershell bin/Debug/net9.0/playwright.ps1 install- If authentication fails for a container, try switching ports in Docker Compose and update connection strings.
- Images/icons used in the app:
Default Profile Picture avatar Default conversation icon Freepik
