Skip to content

Repository files navigation

πŸ—¨οΈ Banter

Where modernity embraces tradition.
A real-time, cloud-native chat application that lives entirely in your terminal.

License: MIT .NET Terminal.Gui


πŸ“– Overview

Banter is a feature-rich Text User Interface (TUI) chat application that bridges the nostalgic aesthetics of classic BBS/IRC systems with modern cloud architecture. Unlike traditional console applications that rely on simple scrolling text, Banter provides a sophisticated windowed interfaceβ€”complete with mouse support, interactive dialogs, and dynamic menusβ€”all within your command line.

Powered by Google Cloud Firestore for real-time synchronization and Terminal.Gui for an immersive terminal experience, Banter delivers instant messaging with enterprise-grade features in a lightweight, keyboard-friendly package.


✨ Key Features

πŸ’¬ Real-Time Communication

  • Instant Messaging: Messages sync across all clients in real-time via Firestore
  • Group & Individual Chats: Create private conversations or group chatrooms
  • Message Pinning: Pin important messages for easy reference
  • Search & Filter: Search through chat history and chatrooms instantly

πŸ–₯️ Rich Terminal Interface

  • Full Windowing System: Multiple resizable windows with mouse support
  • Keyboard Navigation: Efficient hotkey system for power users
  • Responsive Design: Adaptive layouts that work in various terminal sizes
  • Custom Color Schemes: Eye-friendly color schemes optimized for extended use

πŸ›‘οΈ Smart Moderation

  • Profanity Filter: Built-in content filtering with robust leetspeak detection
  • Admin Controls: Chatroom admins can manage messages and participants
  • Content Censorship: Automatically censors inappropriate language

πŸ‘₯ User Management

  • Secure Authentication: Login and registration system with validation
  • User Profiles: Display names and usernames
  • Session Management: Persistent sessions with automatic cleanup

πŸŽ›οΈ Chatroom Management

  • Create Chatrooms: Invite multiple users to group conversations
  • Admin Privileges: Designated admins can rename, delete, or clear chatrooms
  • Leave/Remove: Users can leave chatrooms; admins can remove participants
  • Dynamic Updates: Chatroom lists update in real-time

πŸ—οΈ Architecture

Banter follows a clean, event-driven architecture with clear separation of concerns:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Terminal.Gui (View Layer)               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚ Window1  β”‚  β”‚ Window2  β”‚  β”‚ Window3  β”‚  β”‚  Other   β”‚     β”‚
β”‚  β”‚(Chatroom)β”‚  β”‚  (Chat)  β”‚  β”‚  (Info)  β”‚  β”‚ Windows  β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    SessionHandler (State)                   β”‚
β”‚  β€’ Event-driven state management                            β”‚
β”‚  β€’ Real-time Firestore listeners                            β”‚
β”‚  β€’ User session tracking                                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Utilities (Business Logic)                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                 β”‚
β”‚  β”‚ FirebaseHelper   β”‚  β”‚ ProfanityChecker β”‚                 β”‚
β”‚  β”‚ β€’ CRUD operationsβ”‚  β”‚ β€’ Content filter β”‚                 β”‚
β”‚  β”‚ β€’ Real-time sync β”‚  β”‚ β€’ Leetspeak det. β”‚                 β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Google Cloud Firestore                     β”‚
β”‚  β€’ NoSQL Database β€’ Real-time Updates β€’ Scalable            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Design Patterns

  • Singleton Pattern: All windows and managers use thread-safe lazy singletons
  • Observer Pattern: Event-driven updates via SessionHandler events
  • Repository Pattern: FirebaseHelper abstracts all database operations

πŸ› οΈ Tech Stack

Component Technology Purpose
Language C# / .NET 10.0 Core application logic
UI Framework Terminal.Gui Terminal windowing toolkit
Backend Google Cloud Firestore Real-time NoSQL database
Local Cache LiteDB Embedded database for sessions
Authentication Firebase Admin SDK Secure credential management

πŸ“‚ Project Structure

Banter/
β”œβ”€β”€ πŸ“„ Program.cs                    # Application entry point & initialization
β”‚
β”œβ”€β”€ πŸ“‚ Utilities/                    # Business Logic Layer
β”‚   β”œβ”€β”€ FirebaseHelper.cs            # Firestore CRUD operations
β”‚   β”œβ”€β”€ FirestoreManager.cs          # Singleton Firestore connection
β”‚   β”œβ”€β”€ SessionHandler.cs            # User session & state management
β”‚   β”œβ”€β”€ ProfanityChecker.cs          # Content moderation & filtering
β”‚   β”œβ”€β”€ Validator.cs                 # Input validation (email, etc.)
β”‚   β”œβ”€β”€ Models.cs                    # Data models (User, Chatroom, Message)
β”‚   β”œβ”€β”€ Interfaces.cs                # IViewable interface
β”‚   β”œβ”€β”€ CustomColorScheme.cs         # UI color schemes
β”‚   └── WindowHelper.cs              # Window management utilities
β”‚
β”œβ”€β”€ πŸ“‚ Windows/                      # Presentation Layer
β”‚   β”œβ”€β”€ AbstractWindow.cs            # Base window class
β”‚   β”œβ”€β”€ LogInWindow.cs               # User authentication UI
β”‚   β”œβ”€β”€ CreateAccountWindow.cs       # Registration UI
β”‚   β”œβ”€β”€ Window1.cs                   # Chatroom list & user info
β”‚   β”œβ”€β”€ Window2.cs                   # Main chat interface
β”‚   β”œβ”€β”€ Window3.cs                   # Chatroom management panel
β”‚   β”œβ”€β”€ CreateChatroomWindow.cs      # Chatroom creation dialog
β”‚   β”œβ”€β”€ ChangeChatroomNameWindow.cs  # Rename chatroom dialog
β”‚   └── ViewPinnedMessagesWindow.cs  # Pinned messages viewer
β”‚
β”œβ”€β”€ πŸ“‚ documentation-website/        # Project documentation site
β”œβ”€β”€ πŸ“‚ presentation-website/         # Project presentation site
β”‚
β”œβ”€β”€ πŸ“„ Banter.csproj                 # Project configuration
β”œβ”€β”€ πŸ“„ BanterLogo.txt                # ASCII art logo
β”œβ”€β”€ πŸ“„ Schema.txt                    # Database schema
β”œβ”€β”€ πŸ“„ LICENSE                       # MIT License
└── πŸ“„ README.md                     # This file

πŸš€ Getting Started

Prerequisites

  • .NET 10.0 SDK or later
  • Google Cloud Project with Firestore enabled
  • Terminal that supports 256 colors (recommended: Windows Terminal, iTerm2, or modern Linux terminals)

Installation

  1. Clone the repository

    git clone https://github.com/dreeyanzz/Banter.git
    cd Banter
  2. Configure Firebase Credentials

    The project uses an embedded Firebase Admin SDK key. To set up your own:

    • Create a Firebase project at console.firebase.google.com
    • Enable Firestore Database
    • Generate a service account key (JSON)
    • Update FirestoreManager.cs:
      private const string ProjectId = "your-project-id";
      string resourceName = "Banter.your-firebase-key.json";
    • Add the JSON file to the project and set its Build Action to Embedded Resource
  3. Restore Dependencies

    dotnet restore
  4. Build the Project

    dotnet build
  5. Run Banter

    dotnet run

πŸ•ΉοΈ Usage Guide

First Time Setup

  1. Launch Banter - The login screen will appear with the ASCII logo
  2. Create an Account:
    • Click "Create Account"
    • Enter a username (min. 8 characters)
    • Set a password (min. 8 characters)
    • Provide your name and email
  3. Login with your new credentials

Main Interface

Once logged in, you'll see three main windows:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Window1   β”‚          Window2             β”‚   Window3   β”‚
β”‚  (People)   β”‚       (Main Chat)            β”‚ (Chat Info) β”‚
β”‚             β”‚                              β”‚             β”‚
β”‚ β€’ Chatrooms β”‚ β€’ Chat History               β”‚ β€’ Settings  β”‚
β”‚ β€’ Search    β”‚ β€’ Message Input              β”‚ β€’ Admin     β”‚
β”‚ β€’ User Info β”‚ β€’ Pinned Messages            β”‚   Controls  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Controls

  • Mouse: Click buttons, select text, and switch between windows
  • Tab/Shift+Tab: Navigate between UI elements
  • Enter: Send message or activate focused button
  • Esc: Close dialogs
  • Ctrl+Q: Quit application (from File menu)

Creating a Chatroom

  1. Click "+ Add Chatroom" in Window1
  2. Type usernames to add (one at a time)
  3. Click "Add" after each username
  4. Click "Create" when done

Sending Messages

  1. Select a chatroom from Window1
  2. Type your message in the bottom text field of Window2
  3. Press Enter or click "Send"

Pinning Messages

  1. In Window2, click on any message in the chat history
  2. The message will be pinned (marked with a bullet β€’)
  3. Click "View pinned messages" to see all pinned messages
  4. Click a pinned message in the viewer to unpin it

Admin Features (Group Chats Only)

If you're an admin of a group chatroom, Window3 will show:

  • Change chatroom name: Rename the chatroom
  • Clear Messages: Delete all messages (for everyone)
  • Delete Chatroom: Permanently remove the chatroom
  • Leave Chatroom: Remove yourself from participants

πŸ”’ Security Considerations

⚠️ Important Security Notes:

  1. Passwords are stored in plaintext in the current implementation

    • This is NOT production-ready
    • Implement proper password hashing (bcrypt, Argon2) before deployment
  2. No input sanitization for SQL injection (Firestore is NoSQL, but still validate inputs)

  3. Firebase credentials are embedded in the application

    • Use environment variables or secure vaults in production
    • Never commit credentials to public repositories
  4. Email validation is basic

    • Consider sending verification emails for production use

πŸ› Known Issues & TODOs

  • Implement proper password hashing
  • Add file/image sharing capabilities
  • Implement emoji support
  • Add direct message notifications
  • Improve offline message handling
  • Add message edit/delete functionality
  • Implement typing indicators
  • Add voice note support (if feasible in TUI)
  • Create comprehensive unit tests
  • Add CI/CD pipeline

🀝 Contributing

Contributions are welcome! Whether you want to add new features, fix bugs, or improve documentation, your help is appreciated.

How to Contribute

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

Development Guidelines

  • Follow C# coding conventions
  • Add XML documentation comments to public methods
  • Test your changes thoroughly
  • Update README if you add new features

πŸ“Š Database Schema

Collections

Users

{
  "username": string,
  "password": string,  // ⚠️ Currently plaintext
  "name": string,
  "email": string,
  "chatrooms": string[]
}

Chatrooms

{
  "chatroom_name": string,
  "participants": string[],
  "admins": string[],
  "type": "group" | "individual",
  "last_chat": string,
  "pinned_messages": string[]
}

Messages (subcollection of Chatrooms)

{
  "sender_id": string,
  "text": string,
  "timestamp": Timestamp
}

πŸ“„ License

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

MIT License

Copyright (c) 2024 dreeyanzz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

πŸ™ Acknowledgments

  • Terminal.Gui - For the amazing TUI framework
  • Google Cloud Firestore - For real-time database capabilities
  • Miguel de Icaza - For creating Terminal.Gui
  • The open-source community for continuous inspiration

πŸ“§ Contact

Developer: dreeyanzz
Project Link: https://github.com/dreeyanzz/Banter
Documentation: https://dreeyanzz.github.io/Banter/


🌟 Star History

If you find Banter useful, please consider giving it a star ⭐ on GitHub!


Made with ❀️ and β˜• by dreeyanzz

Where modernity embraces tradition

About

Terminal chat app built with C# and Terminal.Gui, backed by Firestore. Messages, chatrooms, pins and renames all stream in live through Firestore listeners, so nothing ever needs a refresh. Final project from my 2nd year, 1st sem.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages