# Servis İletişimi - FikoYT

## 🔄 Communication Patterns

**1. REST API:**
- Go server → CRUD operations
- JSON request/response
- HTTP status codes

**2. WebSocket:**
- Socket.io → real-time
- Bidirectional events
- Room-based broadcasting

**3. File Sharing:**
- /tmp volume
- Direct file paths
- Progress tracking

## 📡 API Gateway

**Go Fiber Endpoints:**
```
POST /fapiv1/*          - MongoDB aggregate
POST /fapiv1/filYukle     - File upload
POST /api/freecad/*      - FreeCAD integration
```

**Request Flow:**
```go
// Middleware chain
request → JSON parse → File handler → Auth → Controller → Response
```

## 🔗 Database Pattern

**Connection:**
```go
// MongoDB URI
mongodb://fikoyt:fikoyt1299@host:27017/db?replicaSet=rs0

// Session store
MongoStore = mongodb.New(mongodb.Config{
    ConnectionURI: uri,
    Database: "fikoyt",
    Collection: "go_sessions"
})
```

## ⚡ Performance

- **Connection pool:** 10 connections
- **Timeout:** 30s
- **Compression:** gzip
- **Keep-alive:** Enabled

---
2025-11-06