English
Chatex – a realtime web messenger
Chatex is an open-source web messenger with direct chats, groups and channels, running at chatex.mvano.com. This course builds it step by step, from an empty folder to a deployed server. Along the way it shows how technologies that are usually studied separately come together in one real application: OOP in C# and TypeScript, web APIs, databases, real-time messaging, automated testing, CI/CD and administering an Ubuntu virtual server.
The course is a demo project for “Object-oriented programming in C# (GUI)”. It has no labs: every topic is one stage of the build, and the whole course is also presented in one slide deck.
How to follow this tutorial
The application is built layer by layer, in the order the layers depend on each other: first the database model, then the business logic on top of it, then the HTTP API and SignalR, then the Angular client that calls them, and finally the automated checks and the server. Each layer is finished and tested before the next one starts, so at every checkpoint you have code that builds and works.
- A topic is one stage of the build. Its first page says where the stage fits in the architecture, what must already work, and what will work at the end.
- A chapter is a group of steps. Every step follows the same pattern: Why (the problem and the design choice), Do (the files to create and the commands to run) and Check (how to see that the step worked).
- The checkpoint at the end of each topic lists the commands that must pass, a commit message, common mistakes, self-check questions and exercises that go beyond the reference code.
- The reference code is the Chatex repository at commit
27c83c6. Every listing names its file and is taken from that commit; every code link points to it, so the pages and the code never drift apart. When you get stuck, compare your file with the reference. - Type the code yourself rather than copying whole files: most of the learning happens when the compiler or a test tells you what you missed.
Course outline
Getting started
- Chatex overview: features, architecture, technology stack and the plan of the tutorial
- Tools and the solution skeleton: .NET SDK, shared build settings, central package management, PostgreSQL in Docker and developer commands
Data layer (Chatex.Data)
- The domain model: entities for users, chats, members, messages and attachments
- Entity Framework Core and PostgreSQL: the database context, configurations, interceptors and migrations
- Repositories and Unit of Work: transactions, keyset paging, chat list queries and file storage
- Testing the data layer: xUnit v3, Testcontainers, Respawn and Shouldly
Business layer (Chatex.Core)
- Foundations of the business layer: the Result pattern, errors, validation, options and dependency injection
- Authentication logic: ASP.NET Core Identity, JWT access tokens and rotating refresh tokens
- Profiles and avatars: the profile service, password changes, user search and safe uploads
- Chats and permissions: direct chats, groups, channels, roles, membership and real-time events
- Messages and attachments: uploads, sending, replies, editing, deleting and history pages
Web API (Chatex.Api)
- HTTP API with Minimal APIs: endpoint groups, Problem Details, JWT authentication, the composition root and OpenAPI
- Securing and operating the API: file endpoints, request limits, rate limiting, forwarded headers, health checks and maintenance
- Real time with ASP.NET Core SignalR: a typed hub, groups, presence and typing indicators
Angular client (Chatex.Web)
- The Angular project: standalone components, zoneless change detection, Tailwind CSS and the dev proxy
- The API client and authentication: typed models, HTTP services, a signal-based session, interceptor and guards
- Routing, forms and layout: lazy routes, sign-in and registration forms, the responsive shell
- The chat list: a signal store, avatars, new chats and public chat search
- The conversation: a message store with optimistic sending, history paging, the composer and attachments
- The real-time client: the SignalR connection, typed events, catch-up after reconnects, presence and typing
- Chat info and settings: members and roles, profile, avatar, password and theme
Quality and operations
- Continuous integration with GitHub Actions
- An Ubuntu virtual server: firewall, PostgreSQL, systemd, Nginx and HTTPS
- Continuous deployment: release packages, database migrations, activation with rollback
Before you start
You should be comfortable with C# classes, interfaces, generics, LINQ and async/await. The course “Object-oriented programming in C# (GUI)” covers the background this tutorial builds on: Git, async/await, dependency injection, EF Core, REST APIs and SignalR. TypeScript and Angular are explained as they appear, but basic HTML, CSS and JavaScript help.
Software
| Program | Used for |
|---|---|
| .NET 10 SDK, Visual Studio 2026 or JetBrains Rider | The C# 14 backend |
| Node.js 24 and Visual Studio Code | The Angular 22 client |
| Docker Desktop | PostgreSQL 18 for development and tests |
| PowerShell 7 | The Run.ps1 developer commands |
| Git and a GitHub account | Version control, CI/CD |
| An Ubuntu 26.04 virtual server and a domain | Deployment (topics 23–24) |
Topic 2 shows how to install and check each of them.
Course materials
- Course slides – 65 slides with speaker notes (presenter view
/presenter) - Chatex source code – the GitHub repository, with documentation in the
Docsfolder; the tutorial follows commit27c83c6 - chatex.mvano.com – the running application