5.7 KiB
5.7 KiB
SCAR Chat - Quick Start Guide
Initial Setup
1. Install Dependencies
Ubuntu/Debian
sudo apt update
sudo apt install -y \
build-essential cmake git \
qt6-base-dev libboost-all-dev \
libssl-dev libsqlite3-dev \
libpipewire-0.3-dev \
libavcodec-dev libavformat-dev libavutil-dev \
libdbus-1-dev
Fedora
sudo dnf install -y \
gcc-c++ cmake git \
qt6-qtbase-devel boost-devel \
openssl-devel sqlite-devel \
pipewire-devel \
ffmpeg-devel \
dbus-devel
Windows
- Install Visual Studio 2022 with C++ support
- Install CMake from https://cmake.org/
- Install Qt6 from https://www.qt.io/
- Install Boost via vcpkg:
vcpkg install boost-asio boost-system boost-thread openssl sqlite3 ffmpeg
2. Clone and Build
# Clone repository
cd /home/ganome/Projects/SCAR-719/repos/scar-chat7
# Build server and client
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)
3. Generate SSL Certificates
For testing purposes, generate self-signed certificates:
openssl req -x509 -newkey rsa:4096 \
-keyout server.key -out server.pem \
-days 365 -nodes \
-subj "/C=US/ST=State/L=City/O=SCAR/CN=localhost"
Place server.key and server.pem in the project root.
4. Create Test User
Use the dbmanager tool to create users with proper Argon2 password hashing:
# Create a test user
./build/dbmanager/dbmanager adduser testuser testpass
# Create admin user with avatar
./build/dbmanager/dbmanager adduser admin adminpass /path/to/avatar.jpg
./build/dbmanager/dbmanager modifyrole admin admin
# List all users
./build/dbmanager/dbmanager list
The database will be automatically created in the current directory as scarchat.db.
See dbmanager/README.md for complete documentation.
Better approach: Add a --create-user command-line option to the server (TODO).
5. Run Server
cd /home/ganome/Projects/SCAR-719/repos/scar-chat7
./build/server/scarchat-server
# Or with custom paths:
./build/server/scarchat-server \
--db ./scarchat.db \
--cert ./server.pem \
--key ./server.key
Expected output:
SCAR Chat Server v1.0.0
=======================
Configuration:
Database: scarchat.db
SSL Cert: server.pem
SSL Key: server.key
Host: 0.0.0.0
Port: 8443
Server listening on 0.0.0.0:8443
6. Run Client
./build/client/scarchat
- Login dialog will appear
- Enter:
- Username:
testuser - Password:
password123 - Server:
localhost - Port:
8443
- Username:
- Click Connect
Current Capabilities
Working Features ✅
- Server accepts SSL connections
- Client connects with exponential backoff
- User authentication (username/password → argon2 → JWT)
- Text messaging with chat history
- User list display
- Dark Discord-inspired UI
- Status bar with connection status, user count, clock
- Typing indicators
TODO Features 🔄
- Media capture implementation:
- Pipewire camera integration
- Screen capture (X11/Wayland/Windows)
- DBus portal for Wayland
- Video streaming protocol:
- Video stream message types
- Server-side stream routing
- Client video decoder/display
- User management:
- Server command to create/delete users
- User registration endpoint
- Avatar upload/download
- Enhanced features:
- Voice chat
- File sharing
- Emoji/reactions
- User roles/permissions
Testing
Manual Testing Checklist
-
Server Startup
- Server starts without errors
- Database is created if missing
- SSL certificates load correctly
-
Client Connection
- Client shows login dialog
- Connection succeeds with valid credentials
- Connection fails gracefully with invalid credentials
- Reconnect works after server restart
-
Messaging
- Send text messages
- Receive messages from other clients
- Chat history persists across restarts
- Typing indicators appear
-
UI
- Dark theme renders correctly
- User list updates when users join/leave
- Status bar shows connection state
- Clock updates every second
- Video grid shows placeholder when empty
Multi-Client Test
- Start server
- Run client #1, login as user1
- Run client #2, login as user2
- Send messages between clients
- Verify both see each other in user list
Troubleshooting
"Cannot open database"
- Ensure write permissions in current directory
- Check
--dbpath is valid
"Cannot open certificate file"
- Run
openssl req ...command above - Ensure
server.pemandserver.keyexist - Use
--certand--keyoptions
"SSL handshake error"
- Client may need to trust self-signed cert
- Check OpenSSL versions match
- Verify certificate is valid
Client won't connect
- Check server is running:
netstat -tlnp | grep 8443 - Verify firewall allows port 8443
- Check server host/port in client config
Qt platform plugin error
export QT_QPA_PLATFORM_PLUGIN_PATH=/path/to/qt6/plugins/platforms
Development Workflow
Adding a New Feature
- Update PROGRESS.md with feature status
- Implement in appropriate module (client/server/shared)
- Add to CMakeLists.txt if new files
- Build and test
- Update README/docs
Code Style
- C++20 standard
- Use
snake_casefor variables/functions - Use
PascalCasefor classes - Include guards:
#pragma once - Namespace:
scar
Next Steps
See PROGRESS.md for detailed implementation status.
Priority tasks:
- Add
--create-usercommand to server - Implement Pipewire camera capture
- Implement screen capture backends
- Add video streaming protocol
- Test on multiple platforms