Skip to content

.NET 9 web application inspired by Twitter. Built with Razor Pages, Keycloak, PostgreSQL, Azurite, SignalR, and Clean Architecture.

License

Notifications You must be signed in to change notification settings

Vandal166/POSTER

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

POSTER

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.


Features

  • 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.
  • Notifications via SignalR

    • New conversation created
    • Removed from a conversation
    • Updates on a conversation you are part of
    • New post by a followed user

    Showcase


Technical Overview

  • 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

Requirements


Setup and Run

  1. Clone the repository:

    git clone https://github.com/Vandal166/POSTER.git
  2. Run Docker Compose:

    docker compose up -d
  3. Navigate to the web project:

    cd src/Web
  4. Apply EF migrations:

    dotnet ef database update
  5. Configure Keycloak:

    • Access the Keycloak admin panel.

      Note If the container fails to start with connection refused, re-run it (sometimes web.keycloak starts before keycloak.db initializes).

    • Log in using:
      Username: admin
      Password: admin
      
    • Go to Manage Realms → Create realm.
      Name it PosterRealm and import the configuration from /keycloak/realm-export.json.
  6. Configure client secrets in Keycloak:

    • For client poster-admin:
      Go to Credentials → Regenerate Client Secret.
      Copy the secret into application.Development.json under AdminClientSecret section.

    • For client poster-frontend:
      Do the same and copy into ClientSecret section.

  7. Set up storage containers with Storage Explorer

    • Navigate to Emulator & Attached → Emulator (Default Ports) → Blob Containers
    • Create two containers: images and videos.
  8. Run the web application:

    dotnet run

Tests

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

Notes

About

.NET 9 web application inspired by Twitter. Built with Razor Pages, Keycloak, PostgreSQL, Azurite, SignalR, and Clean Architecture.

Topics

Resources

License

Stars

Watchers

Forks