collabrix/QUICKSTART.md
DGSoft 93b98cfb5c Initial commit: Team Chat System with Code Snippet Library
- Complete chat application similar to Microsoft Teams
- Code snippet library with syntax highlighting
- Real-time messaging with WebSockets
- File upload with Office integration
- Department-based permissions
- Dark/Light theme support
- Production deployment with SSL/Reverse Proxy
- Docker containerization
- PostgreSQL database with SQLModel ORM
2025-12-09 22:25:03 +01:00

3.2 KiB

Team Chat - Schnellstart-Anleitung

Schnellstart mit Docker

# Im Projektverzeichnis
docker-compose up -d

# Warten bis Services bereit sind (ca. 30 Sekunden)
docker-compose logs -f

# Zugriff:
# Frontend: http://localhost:5173
# Backend API: http://localhost:8000/docs

Erste Schritte

  1. Registrieren: http://localhost:5173/register

  2. Abteilung & Kanal erstellen (via API oder später im UI):

# Login Token holen
TOKEN=$(curl -X POST http://localhost:8000/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"Admin123!"}' \
  | jq -r .access_token)

# Abteilung erstellen
curl -X POST http://localhost:8000/departments/ \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"IT","description":"IT Department"}'

# User zu Abteilung hinzufügen (User-ID 1, Dept-ID 1)
curl -X POST http://localhost:8000/departments/1/users/1 \
  -H "Authorization: Bearer $TOKEN"

# Kanal erstellen
curl -X POST http://localhost:8000/channels/ \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"general","department_id":1}'
  1. Im Frontend: Login → Chat ansehen → Snippet erstellen

Manueller Start (ohne Docker)

Backend:

cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# PostgreSQL-DB "teamchat" muss existieren
uvicorn app.main:app --reload

Frontend:

cd frontend
npm install
npm run dev

Tests ausführen

cd backend
pytest -v

Demo-Daten Script

# scripts/create_demo_data.py
import requests

BASE_URL = "http://localhost:8000"

# Register users
users = [
    {"username": "alice", "email": "alice@example.com", "password": "pass123", "full_name": "Alice Smith"},
    {"username": "bob", "email": "bob@example.com", "password": "pass123", "full_name": "Bob Jones"},
]

for user in users:
    requests.post(f"{BASE_URL}/auth/register", json=user)

# Login als alice
response = requests.post(f"{BASE_URL}/auth/login", json={"username": "alice", "password": "pass123"})
token = response.json()["access_token"]
headers = {"Authorization": f"Bearer {token}"}

# Departments erstellen
depts = [
    {"name": "Engineering", "description": "Engineering Team"},
    {"name": "Marketing", "description": "Marketing Team"},
]

for dept in depts:
    requests.post(f"{BASE_URL}/departments/", json=dept, headers=headers)

# User zu Department hinzufügen
requests.post(f"{BASE_URL}/departments/1/users/1", headers=headers)  # Alice zu Engineering

# Channels erstellen
requests.post(f"{BASE_URL}/channels/", json={"name": "general", "department_id": 1}, headers=headers)

# Snippet erstellen
requests.post(f"{BASE_URL}/snippets/", json={
    "title": "FastAPI Hello World",
    "language": "python",
    "content": "from fastapi import FastAPI\n\napp = FastAPI()\n\n@app.get('/')\ndef read_root():\n    return {'Hello': 'World'}",
    "tags": "fastapi, python",
    "visibility": "organization"
}, headers=headers)

print("✅ Demo-Daten erstellt!")

Ausführen:

python scripts/create_demo_data.py