Prerequisites
Before you begin, ensure you have the following installed:.NET 9 SDK
Required for building and running the application
PostgreSQL
Database server for data persistence
Docker (Optional)
For containerized deployment
This guide will get you running locally in development mode. For production deployment, see the Docker Deployment Guide.
Getting Started
Set up PostgreSQL
Ensure PostgreSQL is running on your system. The default configuration expects:
- Host:
localhost - Port:
5432 - Username:
postgres - Password:
postgres - Database:
realtime_chat_db
If your PostgreSQL setup differs, you’ll need to update the connection string in
appsettings.json.Configure the application
Navigate to the API project directory:The default
appsettings.json configuration:For development, you can use
appsettings.Development.json to override settings without modifying the base configuration.Run database migrations
Apply the Entity Framework migrations to set up the database schema:This creates all necessary tables including:
- Chat rooms and participants
- Messages with full-text search indexes
- User authentication tables
Start the application
Run the API server:The API will start on
https://localhost:5001 (or the port specified in your launch settings).You should see output similar to:Your First Query
Once the application is running, try executing your first GraphQL query:Fetch All Chat Rooms
Fetch Messages from a Chat Room
Send a Message
Subscribe to Message Updates
To receive real-time updates when messages are added, edited, or deleted:eventType values:
ADDED- New message sentUPDATED- Message editedDELETED- Message removed
Exploring the API
The GraphQL IDE provides:- Schema Explorer: Browse all available queries, mutations, and subscriptions
- Documentation: Auto-generated docs for all types and operations
- Query History: Access previously executed queries
- Variables Panel: Test queries with different input values
Use the Schema tab in Banana Cake Pop to explore the complete API surface, including all available fields and their types.
Next Steps
Installation Guide
Learn about detailed configuration options and environment setup
Authentication
Set up Google OAuth and user authentication
API Reference
Explore the complete GraphQL API documentation
Docker Deployment
Deploy RealtimeChat using Docker containers
Troubleshooting
Database Connection Failed
If you see connection errors, verify:- PostgreSQL is running:
pg_isready - Database exists:
psql -U postgres -l | grep realtime_chat_db - Connection string in
appsettings.jsonmatches your PostgreSQL setup