ไธไธชๅบไบ WebRTC ็ๅฎๆถ้ณ่ง้ข้ไฟกๅนณๅฐ๏ผๆฏๆ็นๅฏน็น่ฏญ้ณ้่ฏใ่็ณปไบบ็ฎก็ๅๅจ็บฟ็ถๆๅๆญฅใ
- ๐ค ๅฎๆถ้ณ่ง้ข้่ฏ - ๅบไบ Pion WebRTC ็็นๅฏน็น้ณ้ข้่ฏ
- ๐ ๅฎๆถ็ฟป่ฏ - ็ฆป็บฟๆฌๅฐ AI ๆจกๅ๏ผ่ฏญ้ณ่ฏๅซ + ๆๆฌ็ฟป่ฏ + ่ฏญ้ณๅๆ (Whisper + Opus-MT + VITS)
- ๐ฅ ่็ณปไบบ็ฎก็ - ๆทปๅ ใๆ็ดขๅ็ฎก็้่ฎฏๅฝ
- ๐ข ๅจ็บฟ็ถๆ - ๅฎๆถๆพ็คบ็จๆทๅจ็บฟ็ถๆๅๆๅๅจ็บฟๆถ้ด
- ๐ ็จๆท่ฎค่ฏ - JWT ไปค็่ฎค่ฏๅไผ่ฏ็ฎก็
- ๐ฑ ่ทจๅนณๅฐ - Android ๅ็ๅบ็จๆฏๆ๏ผiOS ๅผๅไธญ
- ๐ ้ซๆง่ฝ - Redis ็ผๅญใ่ฟๆฅๆฑ ไผๅใๅผๆญฅ WebSocket ไฟกไปค
- ๐ ่ชๅจ้่ฟ - ็ฝ็ปๅผๅธธ่ชๅจ้ๆฐ่ฟๆฅ
- ๐ ้็งไฟๆค - ๅฎๅ จ็ฆป็บฟ็ฟป่ฏ๏ผๆฐๆฎไธไธไผ ไบ็ซฏ
- ่ฏญ่จ: Go 1.22+
- ๆกๆถ: Gin๏ผHTTP๏ผใGorilla WebSocket
- ๆฐๆฎๅบ: MySQL 8.0
- ็ผๅญ: Redis 7.2
- WebRTC: Pion v4.0.0
- ่ฎค่ฏ: JWT (golang-jwt)
- ้ฎไปถ: SMTP (QQ้ฎ็ฎฑ smtp.qq.com:587)
- ๆกๆถ: React Native 0.74+
- ๅผๅ: Expo 51.0+๏ผExpo Development Client๏ผ
- ่ฏญ่จ: TypeScript
- UI: React Navigation
- WebRTC: react-native-webrtc 124.0.0
- HTTP: Axios
- ็ถๆ็ฎก็: React Context API
- ็ฆป็บฟ็ฟป่ฏ: Whisper (ASR) + Opus-MT (็ฟป่ฏ) + VITS (TTS)
- ๆจกๅ้ๅ: INT8 (70% ๅคงๅฐๅๅฐ)
- ๅ็้ๆ: Android JNI + C++
- ๅฎนๅจๅ: Docker & Docker Compose
- ๆๅปบ: Metro BundlerใExpo CLI
- ่ฐ่ฏ: ADB (Android Debug Bridge)
- ๆๅกไปฃ็: Cloudflare Tunnel๏ผๅฏ้๏ผ
- ๅผๅๆบ: macOS / Linux
- Node.js: 18.0 ๆๆดๆฐ
- Go: 1.22 ๆๆดๆฐ
- Docker: 20.10+๏ผๅฏ้๏ผ็จไบๆฐๆฎๅบ๏ผ
- Android SDK: API ็บงๅซ 31+ ๏ผ็ๆบ่ฐ่ฏ๏ผ
- ADB: Android Debug Bridge
# ๅ
้้กน็ฎ
git clone [email protected]:1victorloui1/AllCallAll.git
cd AllCallAll
# ๅฎ่ฃ
ๅ็ซฏไพ่ต
cd backend
go mod download
cd ..
# ๅฎ่ฃ
็งปๅจ็ซฏไพ่ต
cd mobile
npm install
cd ..# ๅฏๅจ MySQL ๅ Redis
./scripts/development/start-services.sh
# ้ช่ฏๆๅก็ถๆ
docker compose -f infra/docker-compose.yml pscd backend
# 1. ๅคๅถ็ฏๅขๅ้็คบไพๆไปถ
cp .env.example .env
# 2. ็ผ่พ .env๏ผๅกซๅ
ฅ QQ ้ฎ็ฎฑๆๆ็
# MAIL_PASSWORD=xxxx xxxx xxxx xxxx (็ปๅฝไฝ ่ชๅทฑ็ๅฎ้
ๆๆ็ )
# 3. ้ช่ฏๅ็ซฏ้
็ฝฎๆไปถไธญ็้ฎไปถ่ฎพ็ฝฎ
cat configs/config.yaml | grep -A5 mail:
# ๅบ่ฏฅๆพ็คบ๏ผ
# host: smtp.qq.com
# port: 587
# username: [email protected]cd backend
# ่ฎพ็ฝฎ้
็ฝฎๆไปถ่ทฏๅพ
export CONFIG_PATH=./configs/config.yaml
# ่ฟ่กๅ็ซฏๆๅก๏ผ็ๅฌ 0.0.0.0:8080๏ผ
go run cmd/server/main.go
# ้ช่ฏๅ็ซฏๆฏๅฆ่ฟ่ก
curl http://localhost:8080/api/v1/health- ๅจๆๅกๅจไธๅๅค TURN๏ผ็คบไพ๏ผ็ซฏๅฃ 3478๏ผ๏ผ
docker run -d --network host --name coturn instrumentisto/coturn \ -a -f -v -n --log-file=stdout \ --realm=allcallall --user=allcallall:strongpassword \ --external-ip=$(curl -s ifconfig.me) \ --min-port=49152 --max-port=49200 - ๆ TURN/STUN ๅ่กจไธๅ็ปๅ็ซฏ๏ผ็งปๅจ็ซฏไผ่ชๅจๆๅ๏ผ๏ผ
export WEBRTC_ICE_SERVERS_JSON='[ {"urls":["stun:stun.l.google.com:19302"]}, {"urls":["turn:81.68.168.207:3478?transport=udp","turn:81.68.168.207:3478?transport=tcp"],"username":"allcallall","credential":"strongpassword"} ]'
3. ้ๅฏๅ็ซฏใAPK ไธ้่ฆ้ๆฐๆๅ
๏ผ็ป้ๅๅฎขๆท็ซฏไผ่ชๅจไป `/api/v1/webrtc/config` ่ฏปๅๆๆฐ ICE/TURN ้
็ฝฎใ
### ๐ ็ไบง็ฏๅข๏ผๅฝๅ้จ็ฝฒ๏ผ81.68.168.207๏ผ
- API: `http://81.68.168.207/api/v1`
- WS: `ws://81.68.168.207/api/v1/ws`
#### ไบๆๅกๅจ่ฟ็ปด
```bash
# ่ฟๅ
ฅ้จ็ฝฒ็ฎๅฝ
cd ~/workspace/AllCallAll-deploy-server/infra
# ้ฆๆฌกๆ้ๆฐๆๅปบๅฏๅจ๏ผ็กฎไฟ .env ๅกซๅฅฝ๏ผ
docker compose -f docker-compose.production.yml up -d --build
# ๅธธ่ง้ๅฏๅ็ซฏ/nginx
docker compose -f docker-compose.production.yml up -d
# ๅ
ณ้ญๆๆๆๅก
docker compose -f docker-compose.production.yml down
# ้ฆๆฌกๅฏๅจ TURN๏ผ็ๅฌ 3478๏ผ็ซฏๅฃ่ๅด 49152-49200๏ผ
docker run -d --network host --name coturn instrumentisto/coturn \
-a -f -v -n --log-file=stdout \
--realm=allcallall --user=allcallall:strongpassword \
--external-ip=$(curl -s ifconfig.me) \
--min-port=49152 --max-port=49200
# ไนๅๅฏๅจ/ๅๆญข
docker start coturn
docker stop coturndocker exec -it infra-mysql-1 mysql -uroot -p"$MYSQL_ROOT_PASSWORD" allcallall_db \
-e "SET FOREIGN_KEY_CHECKS=0;
TRUNCATE TABLE contacts;
TRUNCATE TABLE email_verification_codes;
TRUNCATE TABLE email_send_logs;
TRUNCATE TABLE users;
SET FOREIGN_KEY_CHECKS=1;"cd mobile
npm install
cd android
./gradlew assembleRelease
cp app/build/outputs/apk/release/app-release.apk ../AllCallAll.apk
# ๅฏ้๏ผๅฎ่ฃ
ๅฐ็ๆบ
adb install -r ../AllCallAll.apkcd mobile
# ไฝฟ็จ่ชๅจๅ่ๆฌๅฏๅจ๏ผๆจ่๏ผ
bash scripts/dev-client-debug.sh
# ๆๆๅจๆญฅ้ชค๏ผ
# 1. ้
็ฝฎ ADB ๅๅ่ฝฌๅ
adb reverse tcp:8080 tcp:8080
adb reverse tcp:8081 tcp:8081
# 2. ๅฏๅจ Metro ๅผๅๆๅกๅจ
npm run start:dev-client
# 3. ๅจ็ๆบไธๆซๆไบ็ปด็ ๆ่พๅ
ฅ Metro ๆพ็คบ็ URLcd mobile
# ๅฏๅจ Metro ๆๅกๅจ๏ผLAN ๆจกๅผ๏ผ
npm run start:dev-client:lan
# ๆไฝฟ็จไผ ็ป Expo Go
npm run start:lan
# ๅจ็ๆบๆไธๆ่ๅไธญ้ๆฉ 'Change Bundle URL'๏ผ่พๅ
ฅๆพ็คบ็ LAN ๅฐๅcd mobile
# ้ฆๆฌกๆ้่ฆๆดๆฐๅฎขๆท็ซฏๆถ่ฟ่ก
npm run android
# ่ฟไผๆๅปบๅนถๅฎ่ฃ
Expo Development Clientallcall/
โโโ backend/ # Go ๅ็ซฏๆๅก
โ โโโ cmd/
โ โ โโโ server/ # ๅบ็จๅ
ฅๅฃ็น
โ โโโ internal/
โ โ โโโ auth/ # ่ฎค่ฏๅ JWT
โ โ โโโ user/ # ็จๆท็ฎก็
โ โ โโโ contact/ # ่็ณปไบบ็ฎก็
โ โ โโโ signaling/ # WebRTC ไฟกไปค
โ โ โโโ media/ # Pion WebRTC ๅชไฝๅผๆ
โ โ โโโ presence/ # ๅจ็บฟ็ถๆ็ฎก็
โ โ โโโ models/ # ๆฐๆฎๆจกๅ
โ โ โโโ handlers/ # HTTP ๅค็ๅจ
โ โ โโโ database/ # ๆฐๆฎๅบ่ฟๆฅ
โ โ โโโ cache/ # Redis ็ผๅญ
โ โโโ configs/ # ้
็ฝฎๆไปถ
โ โโโ Dockerfile # Docker ้ๅ
โ
โโโ mobile/ # React Native ็งปๅจๅบ็จ
โ โโโ src/
โ โ โโโ screens/ # ๅบ็จ้กต้ข
โ โ โโโ components/ # UI ็ปไปถ
โ โ โโโ context/ # ็ถๆ็ฎก็๏ผAuthใSignaling๏ผ
โ โ โโโ navigation/ # ่ทฏ็ฑ้
็ฝฎ
โ โ โโโ config/ # ๅบ็จ้
็ฝฎ
โ โ โโโ utils/ # ๅทฅๅ
ทๅฝๆฐ
โ โโโ android/ # Android ๅ็ไปฃ็
โ โโโ metro.config.js # Metro ๆๅ
ๅจ้
็ฝฎ
โ โโโ app.json # Expo ้
็ฝฎ
โ โโโ package.json
โ
โโโ infra/ # ๅบ็ก่ฎพๆฝ้
็ฝฎ
โ โโโ docker-compose.yml # ๆฌๅฐๅผๅ็ฏๅข
โ โโโ docker-compose.production.yml # ็ไบง็ฏๅข
โ โโโ cloudflared-config.yml # Cloudflare Tunnel ้
็ฝฎ
โ โโโ deploy-cloudflare-tunnel.sh # Cloudflare Tunnel ้จ็ฝฒ่ๆฌ
โ
โโโ scripts/development/ # ๅผๅ่พ
ๅฉ่ๆฌ
โโโ start-services.sh # ๅฏๅจๆฌๅฐ MySQL/Redis
โโโ restart-services.sh # ้ๅฏๆฐๆฎๅบไธๅ็ซฏ
Metro ไผ่ชๅจๆฃๆตๆฌๆบ LAN IP ๅนถๅจๆ็ปๅฎใๆฅ็ๅฏๅจๆฅๅฟ่ทๅ URL๏ผ
npm run start
# ่พๅบ็คบไพ๏ผ
# ๐ฑ Metroๅผๅๆๅกๅจ้
็ฝฎ๏ผ
# LAN IP: 192.168.1.36
# Metro URL: http://192.168.1.36:8081
# API URL: http://192.168.1.36:8080
# โ
ๆฏๆUSB่ฟๆฅๅWi-Fi่ฟๆฅไธค็งๆจกๅผๅฝๅ้ ็ฝฎไฝฟ็จ ADB ๅๅ่ฝฌๅๆนๆก๏ผๆจ่๏ผ๏ผ
# ่ชๅจ้
็ฝฎ๏ผไฝฟ็จ่ๆฌ๏ผ
bash scripts/dev-client-debug.sh
# ๆๅจ้
็ฝฎ
adb reverse tcp:8080 tcp:8080 # ๅ็ซฏ API ๆๅก
adb reverse tcp:8081 tcp:8081 # Metro ๅผๅๆๅกๅจๅ็ซฏๅบ็จ้ ็ฝฎ๏ผ่ชๅจไฝฟ็จ localhost๏ผ๏ผ
// src/config/index.ts
const API_HOST = "http://localhost:8080"; // ้่ฟ ADB ่ฝฌๅ
const WS_HOST = "ws://localhost:8080"; // WebSocket ไน้่ฟ่ฝฌๅไธบไปไนไฝฟ็จ ADB ๅๅ่ฝฌๅ๏ผ
- โ ๆฏ็ดๆฅไฝฟ็จ LAN IP ๆด็จณๅฎๅฏ้
- โ ไธๆฌๅฐๅผๅ็ฏๅขไธ่ด
- โ ๆฏๆๅค่ฎพๅคๅๆถ่ฐ่ฏ
- โ ็ฝ็ปๆด็จณๅฎ๏ผๅปถ่ฟๆดไฝ
ๅฏ้๏ผLAN ๆจกๅผ๏ผWi-Fi ่ฐ่ฏ๏ผ
- ๅผๅๆบ IP๏ผ192.168.31.217
- ไฝฟ็จๅบๆฏ๏ผ้่ฆๆ ็บฟ่ช็ฑ็งปๅจ็ๅผๅๆต่ฏ
cd mobile
# ๅฏๅจ Metro ๅผๅๆๅกๅจ
npm run start
# LAN ๆจกๅผๅฏๅจ๏ผWi-Fi ่ฐ่ฏ๏ผ
npm run start:lan
# Tunnel ๆจกๅผ๏ผ่ทจ็ฝ็ป๏ผ
npm run start:tunnel
# ๆๅปบ่ชๅฎไนๅผๅๅฎขๆท็ซฏ
npm run android
# ไปฃ็ ๆฃๆฅ
npm run lint# ๆฅ็่ฎพๅคๆฅๅฟ
adb logcat
# ๆธ
้คๅบ็จๆฐๆฎๅนถ้ๅฏ
adb shell pm clear com.allcallall.mobile
adb shell am start -n com.allcallall.mobile/.MainActivity
# ้
็ฝฎ ADB ๅๅ็ซฏๅฃ่ฝฌๅ
adb reverse tcp:8080 tcp:8080
adb reverse tcp:8081 tcp:8081POST /api/v1/auth/register - ็จๆทๆณจๅ
POST /api/v1/auth/login - ็จๆท็ปๅฝ
GET /api/v1/users/contacts - ่ทๅ่็ณปไบบๅ่กจ
GET /api/v1/users/presence - ่ทๅ็จๆทๅจ็บฟ็ถๆ
GET /api/v1/users/search - ๆ็ดข็จๆท
GET /api/v1/ws - WebSocket ่ฟๆฅ
้ฎ้ข: AxiosError: Network Error ๆ Network timeout
่งฃๅณๆนๆก:
-
ๆฃๆฅ ADB ๅๅ่ฝฌๅ้ ็ฝฎ
adb reverse --list # ๅบ่ฏฅๆพ็คบ๏ผ # tcp:8080 tcp:8080 # tcp:8081 tcp:8081 # ๅฆๆ็ผบๅฐ๏ผ้ๆฐ้ ็ฝฎ adb reverse tcp:8080 tcp:8080 adb reverse tcp:8081 tcp:8081
-
้ช่ฏๅ็ซฏๆๅกๆฏๅฆ่ฟ่ก
curl http://localhost:8080/api/v1/health
-
ๆฃๆฅๅ็ซฏ้ ็ฝฎ
cat mobile/src/config/index.ts # ๅบ่ฏฅๆพ็คบ API_HOST = "http://localhost:8080" -
ๆธ ้คๅบ็จๆฐๆฎๅนถ้ๆฐๅฏๅจ
adb shell pm clear com.allcallall.mobile # ๅจ็ๆบไธ้ๆฐๆซๆ Metro ไบ็ปด็ -
่ฟ่กๅฎๆดๅฏๅจ่ๆฌ
bash mobile/scripts/dev-client-debug.sh
้ฎ้ข: Unable to resolve module ./.expo/.virtual-metro-entry ๆ็ผ่ฏๅคฑ่ดฅ
่งฃๅณๆนๆก:
-
ไฝฟ็จ่ชๅจๅ่ๆฌ๏ผๆจ่ - ่ชๅจๅค็่ๆๅ ฅๅฃ็น๏ผ
bash mobile/scripts/dev-client-debug.sh
-
ๆๅจๆธ ็ๅ้ๅฏ
# ๆธ ็็ผๅญ rm -rf mobile/node_modules/.cache /tmp/metro-* # ไฟๆค่ๆๅ ฅๅฃ็นๆไปถ๏ผไธ่ฆๅ ้ค๏ผ ls -la mobile/.expo/.virtual-metro-entry.js # ๅฆๆ่ๆๅ ฅๅฃ็นๆไปถไธขๅคฑ๏ผ้ๅปบๅฎ mkdir -p mobile/.expo cat > mobile/.expo/.virtual-metro-entry.js << 'EOF'
import { registerRootComponent } from 'expo'; import App from '../App'; registerRootComponent(App); EOF
cd mobile npm install npm run start:dev-client
โ ๏ธ **ๅ
ณ้ฎๆ็คบ**: `.virtual-metro-entry.js` ๆฏ Metro ๅฟ
้็่ๆๅ
ฅๅฃ็นๆไปถ๏ผ**็ปไธ่ฝๅ ้ค**ใ่ฟ่ก่ๆฌไผ่ชๅจไฟๆคๅฎใ
### ๅ็ซฏๆๅกๆ ๆณๅฏๅจๆ้ฎไปถๆ ๆณๅ้
**้ฎ้ข 1**: `failed to connect mysql`
**่งฃๅณๆนๆก**:
```bash
# ็กฎไฟๆฐๆฎๅบๆๅกๅทฒๅฏๅจ
./scripts/development/start-services.sh
# ๆฃๆฅ MySQL ่ฟๆฅ
mysql -u allcallall -p allcallall_db -h localhost
# ้ช่ฏ Redis ่ฟๆฅ
redis-cli ping
้ฎ้ข 2: ้ฎไปถๆ ๆณๅ้ๆ้ช่ฏ็ ๆ ๆณๆฅๆถ
่งฃๅณๆนๆก:
# ๆฃๆฅ QQ ้ฎ็ฎฑ SMTP ้
็ฝฎ
cat backend/configs/config.yaml | grep -A5 mail:
# ้ช่ฏ็ฏๅขๅ้
echo $MAIL_PASSWORD
# ๆต่ฏ้ฎไปถๅ้็ซฏ็น
curl -X POST http://localhost:8080/api/v1/email/send-verification-code \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]"}'
# ้ขๆๅๅบ: {"message":"verification code sent successfully"}- Go: ้ตๅพช Effective Go
- TypeScript: ESLint ้ ็ฝฎ่ง่
- Kotlin: Android ๅฎๆน้ฃๆ ผๆๅ
main- ็จณๅฎๅๅธ็ๆฌ๏ผๅฏไธ้ฟๆไธปๅนฒ๏ผfeature/*- ๅ่ฝๅๆฏ๏ผไปmainๅๅบ๏ผhotfix/*- ็ดงๆฅไฟฎๅคๅๆฏ๏ผไปmainๅๅบ๏ผ
PR ๆต็จ๏ผfeature/* / hotfix/* ็ดๆฅๆไบคๅฐ main๏ผTrunk-based๏ผใ
- Fork ้กน็ฎ
- ๅๅปบ็นๆงๅๆฏ (
git checkout -b feature/AmazingFeature) - ๆไบคๆดๆน (
git commit -m 'Add some AmazingFeature') - ๆจ้ๅฐๅๆฏ (
git push origin feature/AmazingFeature) - ๅผๅฏ Pull Request
MIT License - ่ฏฆ่ง LICENSE ๆไปถ
- ้ฎ้ขๆฅๅ: GitHub Issues
- ่ฎจ่ฎบ: GitHub Discussions
Real-time audio/video communication platform built with WebRTC and React Native.
- ๐ค Real-time Audio/Video Calls - Peer-to-peer audio calls based on Pion WebRTC
- ๐ฅ Contact Management - Add, search, and manage contacts
- ๐ข Online Status - Real-time user presence and last seen information
- ๐ User Authentication - JWT token authentication and session management via email
- ๐ง Email Verification - Secure user registration with QQ SMTP email verification
- ๐ฑ Cross-Platform - Native Android support, iOS in development
- ๐ High Performance - Redis caching, connection pooling, async WebSocket signaling
- ๐ Auto Reconnection - Automatic reconnection on network failure
- Language: Go 1.22+
- Framework: Gin (HTTP), Gorilla WebSocket
- Database: MySQL 8.0
- Cache: Redis 7.2
- WebRTC: Pion v4.0.0
- Authentication: JWT (golang-jwt)
- Email: SMTP (QQ Mail smtp.qq.com:587)
- Framework: React Native 0.74+
- Development: Expo 51.0+ (Expo Development Client)
- Language: TypeScript
- UI: React Navigation
- WebRTC: react-native-webrtc 124.0.0
- HTTP: Axios
- State Management: React Context API
- Containerization: Docker & Docker Compose
- Build: Metro Bundler, Expo CLI
- Debug: ADB (Android Debug Bridge)
- Service Proxy: Cloudflare Tunnel (Optional)
- Development Machine: macOS / Linux
- Node.js: 18.0 or newer
- Go: 1.22 or newer
- Docker: 20.10+ (optional, for databases)
- Android SDK: API level 31+ (physical device debugging)
- ADB: Android Debug Bridge
# Clone the repository
git clone [email protected]:1victorloui1/AllCallAll.git
cd AllCallAll
# Install backend dependencies
cd backend
go mod download
cd ..
# Install mobile dependencies
cd mobile
npm install
cd ..- API:
http://81.68.168.207/api/v1 - WS:
ws://81.68.168.207/api/v1/ws
cd ~/workspace/AllCallAll-deploy-server/infra
# First time or rebuild/start (ensure .env is filled)
docker compose -f docker-compose.production.yml up -d --build
# Regular restart
docker compose -f docker-compose.production.yml up -d
# Stop all services
docker compose -f docker-compose.production.yml down# First start (ports: 3478, relay 49152-49200)
docker run -d --network host --name coturn instrumentisto/coturn \
-a -f -v -n --log-file=stdout \
--realm=allcallall --user=allcallall:strongpassword \
--external-ip=$(curl -s ifconfig.me) \
--min-port=49152 --max-port=49200
# Afterwards
docker start coturn
docker stop coturndocker exec -it infra-mysql-1 mysql -uroot -p"$MYSQL_ROOT_PASSWORD" allcallall_db \
-e "SET FOREIGN_KEY_CHECKS=0;
TRUNCATE TABLE contacts;
TRUNCATE TABLE email_verification_codes;
TRUNCATE TABLE email_send_logs;
TRUNCATE TABLE users;
SET FOREIGN_KEY_CHECKS=1;"# Start MySQL and Redis
./scripts/development/start-services.sh
# Verify service status
docker compose -f infra/docker-compose.yml psPrerequisite: Configure email service (QQ Mail)
cd backend
# 1. Copy environment variable example file
cp .env.example .env
# 2. Edit .env and fill in QQ Mail authorization code
# MAIL_PASSWORD=xxxx xxxx xxxx xxxx (enter your actual authorization code)
# 3. Verify backend mail config in config.yaml
cat configs/config.yaml | grep -A5 mail:
# Should show:
# host: smtp.qq.com
# port: 587
# username: [email protected]
# 4. Set configuration file path
export CONFIG_PATH=./configs/config.yaml
# 5. Run backend service (listening on 0.0.0.0:8080)
go run cmd/server/main.go
# 6. Verify backend is running
curl http://localhost:8080/api/v1/healthRecommended: Expo Development Client + ADB Reverse Forwarding (Most Stable)
cd mobile
# Using automated script (Recommended)
bash scripts/dev-client-debug.sh
# Or manual steps:
# 1. Configure ADB reverse port forwarding
adb reverse tcp:8080 tcp:8080
adb reverse tcp:8081 tcp:8081
# 2. Start Metro development server
npm run start:dev-client
# 3. Scan QR code on physical device or enter the URL shown by Metrocd mobile
# Start Metro server (LAN mode)
npm run start:dev-client:lan
# Or use traditional Expo Go
npm run start:lan
# In the app, shake the device and select 'Change Bundle URL', enter the displayed LAN addresscd mobile
# Run when first installing or updating the client
npm run android
# This builds and installs the Expo Development Clientcd mobile
npm install
cd android
./gradlew assembleRelease
cp app/build/outputs/apk/release/app-release.apk ../AllCallAll.apk
# Optional: install to device
adb install -r ../AllCallAll.apkallcall/
โโโ backend/ # Go backend service
โ โโโ cmd/
โ โ โโโ server/ # Application entry point
โ โโโ internal/
โ โ โโโ auth/ # Authentication and JWT
โ โ โโโ user/ # User management
โ โ โโโ contact/ # Contact management
โ โ โโโ signaling/ # WebRTC signaling
โ โ โโโ media/ # Pion WebRTC media engine
โ โ โโโ presence/ # Online status management
โ โ โโโ models/ # Data models
โ โ โโโ handlers/ # HTTP handlers
โ โ โโโ database/ # Database connection
โ โ โโโ cache/ # Redis cache
โ โโโ configs/ # Configuration files
โ โโโ Dockerfile # Docker image
โ
โโโ mobile/ # React Native mobile application
โ โโโ src/
โ โ โโโ screens/ # Application pages
โ โ โโโ components/ # UI components
โ โ โโโ context/ # State management (Auth, Signaling)
โ โ โโโ navigation/ # Routing configuration
โ โ โโโ config/ # Application configuration
โ โ โโโ utils/ # Utility functions
โ โโโ android/ # Android native code
โ โโโ metro.config.js # Metro bundler configuration
โ โโโ app.json # Expo configuration
โ โโโ package.json
โ
โโโ infra/ # Infrastructure configuration
โ โโโ docker-compose.yml # Local development environment
โ โโโ docker-compose.production.yml # Production environment
โ โโโ cloudflared-config.yml # Cloudflare Tunnel configuration
โ โโโ deploy-cloudflare-tunnel.sh # Cloudflare Tunnel deployment script
โ
โโโ scripts/development/ # Development helper scripts
โโโ start-services.sh # Start local MySQL/Redis
โโโ restart-services.sh # Restart database and backend
Metro automatically detects the local LAN IP and binds dynamically. Check the startup log for the URL:
npm run start
# Sample output:
# ๐ฑ Metro Development Server Configuration:
# LAN IP: 192.168.1.36
# Metro URL: http://192.168.1.36:8081
# API URL: http://192.168.1.36:8080
# โ
Supports both USB and Wi-Fi connection modesCurrent configuration uses ADB Reverse Forwarding (Recommended):
# Automatic configuration (using script)
bash scripts/dev-client-debug.sh
# Manual configuration
adb reverse tcp:8080 tcp:8080 # Backend API service
adb reverse tcp:8081 tcp:8081 # Metro development serverFrontend app configuration (automatically uses localhost):
// src/config/index.ts
const API_HOST = "http://localhost:8080"; // Forwarded by ADB
const WS_HOST = "ws://localhost:8080"; // WebSocket also forwardedWhy use ADB reverse forwarding?
- โ More stable and reliable than direct LAN IP
- โ Consistent with local development environment
- โ Supports debugging multiple devices simultaneously
- โ More stable network, lower latency
Optional: LAN Mode (Wi-Fi Debugging)
- Development Machine IP: 192.168.31.217
- Use Case: Development testing that requires wireless mobility
cd mobile
# Start Metro development server
npm run start
# Start in LAN mode (Wi-Fi debugging)
npm run start:lan
# Tunnel mode (cross-network)
npm run start:tunnel
# Build custom development client
npm run android
# Code linting
npm run lint# View device logs
adb logcat
# Clear app data and restart
adb shell pm clear com.allcallall.mobile
adb shell am start -n com.allcallall.mobile/.MainActivity
# Configure ADB reverse port forwarding
adb reverse tcp:8080 tcp:8080
adb reverse tcp:8081 tcp:8081POST /api/v1/auth/register - User registration
POST /api/v1/auth/login - User login
GET /api/v1/users/contacts - Get contacts list
GET /api/v1/users/presence - Get user online status
GET /api/v1/users/search - Search users
GET /api/v1/ws - WebSocket connection
Issue: AxiosError: Network Error or Network timeout
Solution:
-
Check ADB reverse port forwarding configuration
adb reverse --list # Should show: # tcp:8080 tcp:8080 # tcp:8081 tcp:8081 # If missing, reconfigure adb reverse tcp:8080 tcp:8080 adb reverse tcp:8081 tcp:8081
-
Verify backend service is running
curl http://localhost:8080/api/v1/health
-
Check frontend configuration
cat mobile/src/config/index.ts # Should show API_HOST = "http://localhost:8080" -
Clear app data and restart
adb shell pm clear com.allcallall.mobile # Scan Metro QR code again on physical device -
Run complete startup script
bash mobile/scripts/dev-client-debug.sh
Issue: Unable to resolve module ./.expo/.virtual-metro-entry or compilation failed
Solution:
-
Use automated script (Recommended - automatically handles virtual entry point)
bash mobile/scripts/dev-client-debug.sh
-
Manual cleanup and restart
# Clear cache rm -rf mobile/node_modules/.cache /tmp/metro-* # Protect virtual entry point file (do NOT delete) ls -la mobile/.expo/.virtual-metro-entry.js # If virtual entry point file is missing, recreate it mkdir -p mobile/.expo cat > mobile/.expo/.virtual-metro-entry.js << 'EOF'
import { registerRootComponent } from 'expo'; import App from '../App'; registerRootComponent(App); EOF
cd mobile npm install npm run start:dev-client
โ ๏ธ **Important**: `.virtual-metro-entry.js` is a required Metro virtual entry point file. **Never delete it**. Running the script will automatically protect it.
#### Backend Service Cannot Start or Email Cannot Be Sent
**Issue 1**: `failed to connect mysql`
**Solution**:
```bash
# Ensure database service is running
./scripts/development/start-services.sh
# Check MySQL connection
mysql -u allcallall -p allcallall_db -h localhost
# Verify Redis connection
redis-cli ping
Issue 2: Email cannot be sent or verification code not received
Solution:
# Check QQ Mail SMTP config
cat backend/configs/config.yaml | grep -A5 mail:
# Verify environment variable
echo $MAIL_PASSWORD
# Test email sending endpoint
curl -X POST http://localhost:8080/api/v1/email/send-verification-code \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]"}'
# Expected response: {"message":"verification code sent successfully"}- Go: Follow Effective Go
- TypeScript: ESLint configuration standards
- Kotlin: Android official style guide
main- Stable release version (single long-lived trunk)feature/*- Feature branches (branched frommain)hotfix/*- Emergency fix branches (branched frommain)
PR flow: open PRs from feature/* / hotfix/* directly to main (Trunk-based).
The offline translation feature enables real-time speech translation using local AI models, ensuring complete privacy and zero operational costs.
- Whisper-small (INT8): Speech Recognition
- Opus-MT-en-zh (INT8): Text Translation
- VITS: Text-to-Speech Synthesis
- Total Size: ~264MB (INT8 quantized)
- Performance: <500ms latency, >88% accuracy
- Offline Translation Guide - Complete documentation
- Implementation Roadmap - 5-week development plan
- Model Download Guide - Setup instructions
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
MIT License - See the LICENSE file for details
- Issues: GitHub Issues
- Discussions: GitHub Discussions
-
Pion WebRTC - WebRTC implementation
-
Expo - React Native development framework
-
Gin - Web framework
-
All contributors for their support and help
-
Pion WebRTC - WebRTC ๅฎ็ฐ
-
Expo - React Native ๅผๅๆกๆถ
-
Gin - Web ๆกๆถ
-
ๆๆ่ดก็ฎ่ ็ๆฏๆไธๅธฎๅฉ