Skip to content

AmuletOfNight/SharpTalk

Repository files navigation

SharpTalk

A modern, real-time team collaboration platform built with .NET, designed to facilitate seamless communication through persistent chat rooms, direct messages, and private groups. Inspired by Slack and Discord, SharpTalk provides a clean, intuitive interface for team collaboration.

๐ŸŒŸ Project Overview

SharpTalk is a multi-tenant collaboration tool organized around Workspaces, where teams can communicate through Channels, share files, and collaborate in real-time. The platform supports:

  • Multi-Workspace Architecture: Users can belong to multiple independent workspaces
  • Real-Time Communication: Instant message delivery using SignalR WebSockets
  • Role-Based Access Control: Owner, Admin, and Member roles with appropriate permissions
  • Rich Messaging: Support for markdown, reactions, and message threading
  • File Sharing: Drag-and-drop file uploads with cloud storage integration
  • Presence Tracking: Online/offline status and typing indicators

๐Ÿ›  Tech Stack

Backend

  • Framework: ASP.NET Core 10 Web API
  • Real-Time: SignalR (WebSocket-based communication)
  • Database: PostgreSQL 15
  • ORM: Entity Framework Core
  • Authentication: JWT (JSON Web Tokens)
  • Caching/PubSub: Redis (for presence tracking and SignalR scale-out)
  • File Storage: Local storage (with Azure Blob Storage planned)

Frontend

  • Framework: Blazor WebAssembly
  • State Management: Blazored.LocalStorage
  • Authentication: ASP.NET Core Authentication State Provider
  • Styling: Vanilla CSS with premium dark mode and glassmorphism design

Infrastructure

  • Containerization: Docker & Docker Compose
  • Database: PostgreSQL 15 (Docker container)
  • Cache: Redis (Docker container)

๐Ÿ“‹ Features

โœ… Currently Implemented

Phase 1: Foundation (MVP)

Authentication & Identity

  • โœ… User registration with email/password
  • โœ… User login with JWT token generation
  • โœ… Secure API endpoints with JWT authentication
  • โœ… Custom authentication state provider for Blazor
  • โœ… Case-insensitive email handling
  • โœ… Automatic redirection for invalid sessions

Workspace Management

  • โœ… Create and delete workspaces
  • โœ… Rename workspaces and update descriptions
  • โœ… Invite users and manage members
  • โœ… Leave workspace functionality
  • โœ… Workspace settings modal

Channel Management

  • โœ… Create, list, and manage channels
  • โœ… Public and private channel support
  • โœ… Channel member tracking

Real-Time Messaging

  • โœ… SignalR hub configuration with Redis backplane
  • โœ… Instant message delivery and broadcasting
  • โœ… Connection management and auto-reconnect

Phase 2: Enhanced UX (Partial)

Direct Messaging

  • โœ… 1:1 private conversations (Global DMs)
  • โœ… Group Direct Messages (Support for multiple members)
  • โœ… Unified DM list across workspaces

Presence & Activity

  • โœ… Real-time Online/Offline status tracking
  • โœ… Integration with Redis for scalable presence
  • โœ… Visual status indicators in UI

User Experience

  • โœ… Modern "Slack-like" UI with Dark Mode
  • โœ… User Settings and Profile Management
  • โœ… Avatar uploading and cropping
  • โœ… Responsive design for mobile/desktop

๐Ÿšง In Progress

Notifications & Unread

  • โณ Unread message counters
  • โณ Typing indicators
  • โณ "Edited" message status

๐Ÿ“… Planned Features

Phase 3: Advanced Features

File Sharing

  • File upload endpoint with validation
  • Drag-and-drop file upload in UI
  • Image and GIF auto-expansion in chat
  • Cloud storage integration (Azure Blob Storage)

Message Threading

  • Reply to specific messages
  • Threaded conversation view
  • Thread notifications

Search Functionality

  • Global message search
  • User search
  • Quick Switcher (Ctrl+K) for navigation

Future Enhancements

  • Workspace analytics
  • Voice/video integration
  • Third-party integrations

๐Ÿ— Architecture

Project Structure

SharpTalk/
โ”œโ”€โ”€ SharpTalk.Api/              # Backend Web API
โ”‚   โ”œโ”€โ”€ Controllers/            # API endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ AuthController.cs
โ”‚   โ”‚   โ”œโ”€โ”€ ChannelController.cs
โ”‚   โ”‚   โ”œโ”€โ”€ MessageController.cs
โ”‚   โ”‚   โ”œโ”€โ”€ UserController.cs
โ”‚   โ”‚   โ””โ”€โ”€ WorkspaceController.cs
โ”‚   โ”œโ”€โ”€ Data/                   # Database context
โ”‚   โ”‚   โ””โ”€โ”€ ApplicationDbContext.cs
โ”‚   โ”œโ”€โ”€ Entities/               # EF Core entities
โ”‚   โ”‚   โ”œโ”€โ”€ Attachment.cs
โ”‚   โ”‚   โ”œโ”€โ”€ Channel.cs
โ”‚   โ”‚   โ”œโ”€โ”€ ChannelMember.cs
โ”‚   โ”‚   โ”œโ”€โ”€ Message.cs
โ”‚   โ”‚   โ”œโ”€โ”€ Reaction.cs
โ”‚   โ”‚   โ”œโ”€โ”€ User.cs
โ”‚   โ”‚   โ”œโ”€โ”€ Workspace.cs
โ”‚   โ”‚   โ””โ”€โ”€ WorkspaceMember.cs
โ”‚   โ”œโ”€โ”€ Hubs/                   # SignalR hubs
โ”‚   โ”‚   โ””โ”€โ”€ ChatHub.cs
โ”‚   โ”œโ”€โ”€ Migrations/             # Database migrations
โ”‚   โ””โ”€โ”€ Program.cs              # API startup configuration
โ”‚
โ”œโ”€โ”€ SharpTalk.Web/              # Frontend Blazor WASM
โ”‚   โ”œโ”€โ”€ Auth/                   # Authentication
โ”‚   โ”‚   โ””โ”€โ”€ CustomAuthStateProvider.cs
โ”‚   โ”œโ”€โ”€ Layout/                 # Layout components
โ”‚   โ”‚   โ”œโ”€โ”€ MainLayout.razor
โ”‚   โ”‚   โ”œโ”€โ”€ NavMenu.razor
โ”‚   โ”‚   โ””โ”€โ”€ LandingLayout.razor
โ”‚   โ”œโ”€โ”€ Pages/                  # Page components
โ”‚   โ”‚   โ”œโ”€โ”€ Login.razor
โ”‚   โ”‚   โ”œโ”€โ”€ Register.razor
โ”‚   โ”‚   โ”œโ”€โ”€ Home.razor
โ”‚   โ”‚   โ””โ”€โ”€ Index.razor
โ”‚   โ”œโ”€โ”€ Services/               # Business logic services
โ”‚   โ”‚   โ”œโ”€โ”€ WorkspaceService.cs
โ”‚   โ”‚   โ”œโ”€โ”€ ChannelService.cs
โ”‚   โ”‚   โ”œโ”€โ”€ ChatService.cs
โ”‚   โ”‚   โ””โ”€โ”€ UserService.cs
โ”‚   โ”œโ”€โ”€ Shared/                 # Shared components
โ”‚   โ”‚   โ”œโ”€โ”€ Sidebar.razor
โ”‚   โ”‚   โ”œโ”€โ”€ ChannelList.razor
โ”‚   โ”‚   โ”œโ”€โ”€ ChatArea.razor
โ”‚   โ”‚   โ”œโ”€โ”€ CreateWorkspaceModal.razor
โ”‚   โ”‚   โ”œโ”€โ”€ CreateChannelModal.razor
โ”‚   โ”‚   โ”œโ”€โ”€ WorkspaceSettingsModal.razor
โ”‚   โ”‚   โ”œโ”€โ”€ UserSettingsModal.razor
โ”‚   โ”‚   โ””โ”€โ”€ UserProfile.razor
โ”‚   โ””โ”€โ”€ Program.cs              # Blazor startup configuration
โ”‚
โ”œโ”€โ”€ SharpTalk.Shared/           # Shared DTOs and models
โ”‚   โ””โ”€โ”€ DTOs/                   # Data transfer objects
โ”‚       โ”œโ”€โ”€ AuthResponse.cs
โ”‚       โ”œโ”€โ”€ ChannelDto.cs
โ”‚       โ”œโ”€โ”€ CreateChannelRequest.cs
โ”‚       โ”œโ”€โ”€ CreateWorkspaceRequest.cs
โ”‚       โ”œโ”€โ”€ InviteUserRequest.cs
โ”‚       โ”œโ”€โ”€ LoginRequest.cs
โ”‚       โ”œโ”€โ”€ MessageDto.cs
โ”‚       โ”œโ”€โ”€ RegisterRequest.cs
โ”‚       โ”œโ”€โ”€ RemoveMemberRequest.cs
โ”‚       โ”œโ”€โ”€ RenameWorkspaceRequest.cs
โ”‚       โ”œโ”€โ”€ SendMessageRequest.cs
โ”‚       โ”œโ”€โ”€ TransferOwnershipRequest.cs
โ”‚       โ”œโ”€โ”€ UpdateMemberRoleRequest.cs
โ”‚       โ”œโ”€โ”€ UpdateWorkspaceDescriptionRequest.cs
โ”‚       โ”œโ”€โ”€ UserInfo.cs
โ”‚       โ”œโ”€โ”€ UserStatusDto.cs
โ”‚       โ”œโ”€โ”€ WorkspaceDto.cs
โ”‚       โ””โ”€โ”€ WorkspaceMemberDto.cs
โ”‚
โ”œโ”€โ”€ plans/                      # Feature planning documents
โ”‚   โ”œโ”€โ”€ workspace-management-features.md
โ”‚   โ””โ”€โ”€ user-avatar-features.md
โ”‚
โ”œโ”€โ”€ docker-compose.yml          # Docker services configuration
โ”œโ”€โ”€ IMPLEMENTATION_PLAN.md      # Detailed implementation roadmap
โ”œโ”€โ”€ Requirements Document.txt   # Original requirements specification
โ””โ”€โ”€ README.md                   # This file

Database Schema

The application uses PostgreSQL with the following core entities:

  • User: User accounts with authentication and profile data
  • Workspace: Independent collaboration spaces
  • WorkspaceMember: Join table linking users to workspaces with roles
  • Channel: Communication channels within workspaces
  • ChannelMember: Join table tracking channel membership
  • Message: Chat messages with threading support
  • Attachment: File attachments linked to messages
  • Reaction: Emoji reactions on messages

User Roles

  • Workspace Owner: Creator of the workspace, can delete and manage all aspects
  • Workspace Admin: Can manage users, channels, and moderation
  • Member: Standard user, can send messages and join public channels
  • Guest (Future): Restricted access to specific channels

๐Ÿš€ Getting Started

Prerequisites

  • .NET 10 SDK
  • Docker Desktop (for PostgreSQL and Redis)
  • Git

Installation

  1. Clone the repository

    git clone <repository-url>
    cd SharpTalk
  2. Start infrastructure services

    docker-compose up -d

    This starts:

    • PostgreSQL on port 5433
    • Redis on port 6379
  3. Configure connection strings

    Update SharpTalk.Api/appsettings.json:

    {
      "ConnectionStrings": {
        "DefaultConnection": "Host=localhost;Port=5433;Database=sharptalk;Username=postgres;Password=password"
      },
      "JwtSettings": {
        "Secret": "your-super-secret-key-at-least-32-characters-long",
        "Issuer": "SharpTalk",
        "Audience": "SharpTalkUsers"
      }
    }
  4. Run database migrations

    cd SharpTalk.Api
    dotnet ef database update
  5. Start the API

    dotnet run

    The API will be available at http://localhost:5298

  6. Start the Web client (in a new terminal)

    cd SharpTalk.Web
    dotnet run

    The web application will be available at http://localhost:5000

Development Setup

Running Tests

# Run all tests
dotnet test

# Run tests with coverage
dotnet test --collect:"XPlat Code Coverage"

Creating New Migrations

cd SharpTalk.Api
dotnet ef migrations add MigrationName
dotnet ef database update

Building for Production

# Build API
cd SharpTalk.Api
dotnet publish -c Release

# Build Web
cd SharpTalk.Web
dotnet publish -c Release

๐Ÿ“Š Current Implementation Status

Phase 1: Foundation (MVP) - 85% Complete

  • Project setup and structure
  • Docker Compose configuration
  • EF Core entities and relationships
  • Database migrations
  • Authentication (JWT)
  • Workspace CRUD operations
  • Channel CRUD operations
  • Private channel support
  • Frontend layout and navigation
  • Authentication state management
  • Real-time messaging (SignalR) - In Progress

Phase 2: Enhanced UX - 0% Complete

  • Direct Messages (1:1 and Group)
  • Online/offline status tracking
  • Typing indicators
  • Unread message counters
  • Message editing indicators

Phase 3: Advanced Features - 0% Complete

  • File upload and sharing
  • Message threading
  • Search functionality
  • Workspace management enhancements
  • User profile and avatar features

๐Ÿ”ฎ Future Roadmap

Short Term (Next 1-2 months)

  1. Complete real-time messaging implementation
  2. Add presence tracking with Redis
  3. Implement typing indicators
  4. Add unread message counters
  5. Implement message editing and deletion

Medium Term (3-6 months)

  1. Direct messaging (1:1 and group)
  2. File upload and sharing
  3. Message threading
  4. Enhanced workspace management
  5. User profile and avatar features

Long Term (6+ months)

  1. Global search functionality
  2. Quick Switcher (Ctrl+K)
  3. Notifications system
  4. Workspace analytics
  5. Mobile app (React Native or MAUI)
  6. Voice/video integration
  7. Integration with third-party services (GitHub, Jira, etc.)

๐Ÿค Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow C# coding conventions
  • Write unit tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting PR
  • Follow the existing code style and structure

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Inspired by Slack and Discord
  • Built with Microsoft .NET ecosystem
  • Uses SignalR for real-time communication
  • Styled with modern CSS and glassmorphism design principles

๐Ÿ“ž Support

For questions, issues, or suggestions:

๐Ÿ”— Related Resources


Built with โค๏ธ using .NET 10

About

SharpTalk is a slack clone built entirely in .NET C#

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published