A simple, secure, and feature-rich terminal-based chat application with end-to-end encryption, private file sharing, and multi-client support.
This entire project was created by AI using VS Codium with the Roo Code extension, powered by Anthropic Claude Sonnet 4.5.
- β¨ 100% AI-coded - Every line of code, documentation, tests, and configuration
- π― Prompt-driven development - The author only wrote prompts, no actual code
- π€ AI architecture - Designed, implemented, and tested by AI
- π AI documentation - All README files, guides, and comments generated by AI
This project demonstrates the current capabilities of AI-assisted development and serves as an example of what can be achieved through careful prompting and iterative refinement.
This application is designed for private, trusted networks only (home LANs, office networks, VPNs). It is NOT intended for public internet deployment without significant additional security measures.
Why private networks only?
- π« No TLS/SSL transport encryption (data encrypted but no secure channel)
- π« No authentication system (password-only, no user accounts)
- π« No rate limiting (vulnerable to spam/DoS)
- π« No input validation hardening for internet threats
- π« No protection against sophisticated attacks
If you must deploy publicly:
- Use a VPN (WireGuard, OpenVPN) to create a private network
- Add a reverse proxy with TLS (nginx, traefik)
- Implement rate limiting and fail2ban
- Use strong, unique passwords
- Monitor logs actively
- See Security Assessment
Recommended use cases:
- β Home networks
- β Office LANs
- β VPN-connected users
- β Development/testing
- β Educational purposes
- β Public internet (without additional security)
- π End-to-End Encryption - AES-256-CBC encryption for all messages and files
- π₯ Multi-Client Support - Real-time chat with multiple users simultaneously
- π Smart File Sharing - Share files publicly or privately with specific users
- π― Permission System - Granular access control for file sharing
- π Color-Coded Messages - Easy-to-follow conversations with unique colors per user
- π Unique Usernames - No duplicate names allowed for secure identification
- π Complete Logging - Server-side audit trail for all operations
- π Multi-Language - English and German documentation
- π§ͺ Fully Tested - 27 unit and integration tests (100% pass rate)
# Clone the repository
git clone https://github.com/maxron84/Terminal-Chat-Program.git
cd Terminal-Chat-Program
# No dependencies needed! Pure Python 3.6+Interactive Mode (Easiest - Cross-Platform):
python3 bin/terminal-chat.pyDocker Mode (Production-Ready):
# Configure
cp .env.example .env
nano .env # Set strong password
# Deploy
docker-compose up -d
# Connect from any machine
python3 bin/terminal-chat.pyTroubleshooting Docker:
# If containers restart or encounter errors:
./docker-rebuild.shSee Docker Deployment Guide for complete guide.
Command Line Mode:
# Start server
python3 src/main.py listen 4444 mypassword Admin
# Connect as client
python3 src/main.py connect localhost 4444 mypassword AliceOnce connected, simply type messages and press Enter:
[Alice] > Hello everyone!
[Bob] > Hi Alice! How are you?
[Alice] > Great! Let me share a file with you...
| Command | Description | Example | Available To |
|---|---|---|---|
/upload <file> |
Upload file (public) | /upload report.pdf |
All users |
/upload <file> @user |
Upload file privately | /upload contract.pdf @Bob |
All users |
/download <file> |
Download file from shared | /download report.pdf |
All users |
/list |
List shared files | /list |
All users |
/inbox |
List received private files | /inbox |
All users |
/outbox |
List files ready to upload | /outbox |
All users |
/help |
Show available commands | /help |
All users |
/quit |
Exit chat | /quit |
All users |
Note: The server (admin) can also receive private files from clients in its inbox folder!
Public File (Everyone can access):
# 1. Put file in data/outbox/
cp myfile.pdf data/outbox/
# 2. Upload in chat
[Alice] > /upload myfile.pdf
β File uploaded
# 3. Anyone can download
[Bob] > /download myfile.pdf
β Downloaded to data/inbox/myfile.pdfPrivate File (Only for specific user):
# 1. Put file in data/outbox/
cp confidential.pdf data/outbox/
# 2. Upload privately
[Alice] > /upload confidential.pdf @Bob
β File uploaded privately for Bob
# 3. Only Bob can download
[Bob] > /download confidential.pdf
β Downloaded
[Charlie] > /download confidential.pdf
β Error: Private file (from Alice for Bob)Terminal-Chat-Program/
βββ bin/
β βββ terminal-chat.py # Interactive launcher (cross-platform) β
β βββ instructions.txt # Quick reference (EN)
β βββ anleitung.txt # Quick reference (DE)
βββ src/
β βββ main.py # Main entry point β
β βββ lib/ # Core library modules
β βββ __init__.py
β βββ utils.py # Utilities & colors
β βββ encryption.py # AES-256-CBC encryption
β βββ server.py # Multi-client server
β βββ client.py # Chat client
β βββ file_permissions.py # Access control
βββ tests/
β βββ test_chat.py # 27 unit & integration tests
βββ docs/
β βββ CONTRIBUTING.md # Contribution guidelines
β βββ SECURITY.md # Security policy
β βββ CHANGELOG.md # Version history
β βββ DOCKER_DEPLOYMENT.md # Docker guide
β βββ MODULAR_STRUCTURE.md # Architecture
β βββ TEST_DOCUMENTATION.md # Testing
β βββ USER_MANUAL.txt # User manual (EN)
β βββ BENUTZER_HANDBUCH.txt # User manual (DE)
β βββ security/ # Security docs
β βββ SECURITY_ASSESSMENT.md
β βββ SECURITY_ENHANCEMENT_CONCEPT.md
βββ data/ # User data (auto-created)
β βββ inbox/ # Downloaded files
β βββ outbox/ # Files to upload
β βββ shared/ # Shared folder on server
β βββ file_permissions.json # Access metadata
βββ logs/ # Server logs (auto-created)
βββ chat_server_*.log
- Python 3.6+ (usually pre-installed on Linux/Mac)
- OpenSSL (for encryption - usually pre-installed)
No external Python packages required!
- Docker 20.10+
- Docker Compose 1.29+ (optional but recommended)
Perfect for production deployments!
Run the comprehensive test suite:
cd tests
python3 test_chat.pyExpected output:
Ran 27 tests in 0.330s
OK β
Tests run: 27
Successes: 27
Failures: 0
Errors: 0
- User Manual - Complete guide (EN)
- Benutzerhandbuch - VollstΓ€ndige Anleitung (DE)
- Docker Deployment - Container deployment
- Architecture - Code structure
- Testing - Test strategy
- Security - Security policy
- Contributing - Contribution guide
- Changelog - Version history
- Commands (EN) - Quick reference
- Befehle (DE) - Kurzreferenz
- Algorithm: AES-256-CBC with PBKDF2 key derivation
- Transport: Encrypted payload over TCP
- Files: Base64-encoded and encrypted during transfer
- Username Uniqueness: No duplicate names allowed
- File Permissions: Granular control over who can access what
- Audit Trail: Complete server-side logging
- Private Sharing: One-to-one file transfers
- User connections/disconnections
- File uploads/downloads
- Permission checks
- Failed authentication attempts
- All server operations
- π¬π§ English
- π©πͺ Deutsch (German)
Contributions for additional languages welcome! See bin/instructions.txt as template.
# As library
python3 -c "from src.lib import ChatServer, ChatClient"
# Direct execution
python3 src/main.py listen 4444 pass Admin# Build image
docker build -t terminal-chat:dev .
# Run with live code mounting
docker run -it --rm \
-v $(pwd)/src:/app/src \
-p 4444:4444 \
terminal-chat:dev listen 4444 pass Admin
# Run tests in container
docker run --rm terminal-chat:dev python3 tests/test_chat.py# All tests
python3 tests/test_chat.py
# Specific test class
python3 -m unittest tests.test_chat.TestEncryption
# With pytest (if installed)
pytest tests/test_chat.py -vThe project follows PEP 8 guidelines with:
- 4-space indentation
- Max line length: 100 characters
- Docstrings for all functions/classes
Component Tests Status
βββββββββββββββββββββββββββββββββ
Encryption 8 β
Pass
Client 5 β
Pass
Server 2 β
Pass
File Ops 2 β
Pass
Permissions 7 β
Pass
Integration 2 β
Pass
Utilities 2 β
Pass
βββββββββββββββββββββββββββββββββ
Total 27 β
All Pass
- Private messaging without corporate platforms
- Share family photos securely
- Coordinate events with file sharing
- Quick team communication
- Share project files
- Development team coordination
- Class discussions
- Assignment submission
- Study group collaboration
- Complete control over your data
- No external dependencies
- Run on any Linux/Mac/Windows machine
- β Perfect for home/office LANs
- β Encrypted message content
- β No external dependencies
β οΈ Consider adding TLS transport layerβ οΈ Implement rate limitingβ οΈ Use VPN for additional security- π See Security Assessment
βββββββββββββββββββββββββββββββββββββββββββ
β Terminal Chat β
βββββββββββββββββββββββββββββββββββββββββββ€
β [10:30:15] Alice: Hello everyone! β
β [10:30:20] Bob: Hi Alice! β
β [10:30:25] Alice: Check out report.pdf β
β [10:30:30] *** Alice uploaded file: β
β report.pdf *** β
β [10:30:35] Bob: /download report.pdf β
β [10:30:36] β Downloaded to inbox/ β
β β
β [Alice] > _ β
βββββββββββββββββββββββββββββββββββββββββββ
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Python's standard library
- Uses OpenSSL for encryption
- Inspired by the need for simple, secure communication
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- TLS/SSL transport encryption
- User authentication system
- Session management
- Rate limiting
- Web-based GUI
- Voice chat support
- Video sharing
- Mobile apps
- Plugin system
Contributions welcome! Please:
- Fork the repo and create a feature branch
- Run tests before submitting PR
- Follow PEP 8 style guidelines
- Update documentation as needed
See CONTRIBUTING.md for detailed guidelines.
Report vulnerabilities via GitHub Security Advisories (not public issues).
This project is for private networks only. It lacks:
- TLS/SSL transport encryption
- Rate limiting
- Enterprise-grade security features
See SECURITY.md for full security policy.
- Initial release
- Multi-client encrypted chat
- Private file sharing
- Docker deployment
- 27 passing tests
See CHANGELOG.md for detailed version history.
If you find this project useful, please consider giving it a star!
Made with β€οΈ by AI (Claude Sonnet 4.5) + Human prompts
Happy Chatting! π