Social-Arcade-Universe
A production-ready multiplayer mobile game with social features, built with Unity (C#) and Node.js backend.
- Stars
- 6
- Language
- C#
- Updated
Social Arcade Universe
A production-ready multiplayer mobile game with social features, built with Unity (C#) and Node.js backend.
š® Game Overview
Social Arcade Universe is a hybrid arcade game combining:
- Real-time multiplayer gameplay
- Social/reel-style content sharing (TikTok-like)
- Progression and economy systems
- AI-driven personalization
šļø Architecture
Backend (Node.js + PostgreSQL + Socket.io)
- API Server: Express.js REST API
- Real-time: Socket.io for multiplayer
- Database: PostgreSQL with Prisma ORM
- Cache: Redis for matchmaking and sessions
Frontend (Unity 2023 LTS)
- Language: C# 11
- Networking: Socket.io Client
- Architecture: Event-driven with Clean Architecture
š Quick Start
Prerequisites
- Node.js 20+
- PostgreSQL 15+
- Redis 7+
- Unity 2023.2 LTS
Backend Setup
cd backend
# Install dependencies
npm install
# Copy environment file
cp .env.example .env
# Update .env with your configuration
# DATABASE_URL=postgresql://user:pass@localhost:5432/sau_dev
# REDIS_URL=redis://localhost:6379
# Generate Prisma client
npm run prisma:generate
# Run database migrations
npm run prisma:migrate
# Start development server
npm run dev
Unity Setup
- Open Unity Hub and add the
Unityfolder - Open the project with Unity 2023.2+
- Configure
ServerUrlinGameManagerto point to your backend - Build and run
š Project Structure
Social-Arcade-Universe/
āāā SPEC.md # Detailed technical specification
āāā backend/
ā āāā src/
ā ā āāā config/ # Configuration files
ā ā āāā modules/ # Feature modules
ā ā ā āāā auth/ # Authentication
ā ā ā āāā user/ # User management
ā ā ā āāā player/ # Player data
ā ā ā āāā game/ # Game sessions
ā ā ā āāā matchmaking/ # Matchmaking
ā ā ā āāā social/ # Friends, Chat, Reels
ā ā ā āāā economy/ # Currency, Shop
ā ā ā āāā admin/ # Admin panel
ā ā āāā shared/ # Shared utilities
ā ā āāā websocket/ # Socket.io service
ā ā āāā index.ts # Entry point
ā āāā prisma/
ā ā āāā schema.prisma # Database schema
ā āāā package.json
ā āāā tsconfig.json
ā āāā Dockerfile
ā āāā docker-compose.yml
ā
āāā Unity/
ā āāā Assets/
ā ā āāā Scripts/
ā ā ā āāā Core/ # GameManager, Events
ā ā ā āāā Networking/ # NetworkManager, Socket
ā ā ā āāā Player/ # PlayerController, Stats
ā ā ā āāā Game/ # Game modes, rules
ā ā ā āāā AI/ # AI behaviors
ā ā ā āāā Social/ # Friends, Reels
ā ā ā āāā Economy/ # Currency, Shop
ā ā ā āāā UI/ # Screens, Components
ā ā ā āāā Utils/ # Helpers
ā ā āāā Prefabs/
ā ā āāā Resources/
ā ā āāā Scenes/
ā āāā Packages/
ā āāā ProjectSettings/
ā
āāā README.md
š API Endpoints
Authentication
POST /api/auth/register- Register new userPOST /api/auth/login- LoginPOST /api/auth/refresh- Refresh tokenPOST /api/auth/logout- Logout
User
GET /api/users/me- Get current userPUT /api/users/me- Update profileGET /api/users/:id- Get user by ID
Player
GET /api/player/profile- Get player profileGET /api/player/inventory- Get inventoryPUT /api/player/progress- Update progress
Game
GET /api/games/modes- Get game modesPOST /api/games/create- Create gamePOST /api/games/:id/join- Join game
Social
GET /api/social/friends- Get friendsGET /api/social/chat/:roomId- Get chat messagesGET /api/reels- Get reels feedPOST /api/reels- Upload reel
Economy
GET /api/economy/balance- Get balanceGET /api/shop/items- Get shop itemsPOST /api/shop/purchase- Purchase item
Leaderboard
GET /api/leaderboard/global- Global leaderboardGET /api/leaderboard/friends- Friends leaderboard
š® WebSocket Events
Client ā Server
join_matchmaking- Join matchmaking queuejoin_lobby- Join game lobbyplayer_input- Send input dataposition_update- Sync positionchat_message- Send chat message
Server ā Client
match_found- Match foundgame_started- Game startingposition_sync- Player position updatechat_message- New chat messagegame_ended- Game over
š§ Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
NODE_ENV | Environment | development |
PORT | Server port | 3000 |
DATABASE_URL | PostgreSQL connection | - |
REDIS_URL | Redis connection | - |
JWT_SECRET | JWT signing secret | - |
CLIENT_URL | Client URL | http://localhost:3001 |
AWS_S3_BUCKET | S3 bucket for media | - |
š¢ Deployment
Docker (Recommended)
cd backend
# Update .env with production values
cp .env.example .env
# Edit .env
# Build and run
docker-compose up -d
Manual
- Build the backend:
cd backend
npm run build
- Run with PM2:
pm2 start dist/index.js --name sau-backend
Unity Build
- Open Unity project
- Go to File > Build Settings
- Select target platform (iOS/Android)
- Click Build
šØ UI Design System
The UI follows a modern Gen-Z aesthetic:
Colors
- Primary: #6C5CE7 (Purple)
- Secondary: #00CEC9 (Teal)
- Accent: #FD79A8 (Pink)
- Background: #0D0D1A (Dark)
- Surface: #1A1A2E
Typography
- Display: Poppins Bold
- Headings: Poppins SemiBold
- Body: Inter Regular
š”ļø Security
- JWT-based authentication
- Password hashing with bcrypt
- Rate limiting on API endpoints
- Input validation
- SQL injection prevention (Prisma)
- XSS protection
š Analytics
The system tracks:
- User acquisition
- Session events
- Game performance
- Purchase events
- Social interactions
š¤ Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
š License
MIT License - see LICENSE for details