Un sistema integral de gestiΓ³n para clubes de Pro Clubs.
Trueno Pro Club Services es una plataforma completa que permite gestionar todos los aspectos de un club de Pro Clubs, incluyendo miembros, logros, partidos, estadΓsticas de jugadores y mΓ‘s.
Este proyecto es una evoluciΓ³n de Caracantosmeaos.
Puedes ver el sistema en funcionamiento en el despliegue oficial de Casemuro City: π https://www.casemurocity.org
Este es un monorepo estructurado con pnpm workspaces que incluye:
- Stack: Express.js + MongoDB
- Funcionalidades principales:
- GestiΓ³n de clubes (
/club) - GestiΓ³n de miembros (
/members) - Logros y estadΓsticas (
/achievements) - Registro de partidos (
/matches) - Team of the Week (
/totw)
- GestiΓ³n de clubes (
- Modelos: Club, Club Members, Matches, Player Stats, Achievements, TOTW
- Stack: Astro + Vue + Tailwind
- CaracterΓsticas:
- Interfaz responsiva
- DiseΓ±o moderno con DaisyUI
- PropΓ³sito: Procesamiento asincrΓ³nico de events y tareas programadas
- CaracterΓsticas: Sistema de eventos y manejo de trabajos en segundo plano
- Paquete compartido reutilizable
- Contiene modelos y utilidades comunes
- Node.js 18+
- pnpm 8+
# Clonar el repositorio
git clone <repository-url>
cd TruenoProClubServices
# Instalar dependencias de todo el monorepo
pnpm install
# Construir todos los proyectos
pnpm build# Construir todas las aplicaciones
pnpm buildcd apps/api
# Iniciar en modo desarrollo
pnpm start
# Construir para producciΓ³n
pnpm build
# Ejecutar binario compilado
pnpm servecd apps/web
# Iniciar servidor de desarrollo
pnpm dev
# Construir para producciΓ³n
pnpm build
# Previsualizar build de producciΓ³n
pnpm previewLas variables de entorno se deben configurar en archivos .env (u otro tipo variables de entorno si es en docker por ejemplo) en cada aplicaciΓ³n.
| Variable | Tipo | DescripciΓ³n | Valor por defecto |
|---|---|---|---|
PORT |
number |
Puerto en el que escucha la API | 80 |
DEVMODE |
boolean |
Habilita CORS abierto para desarrollo | false |
MONGO_URL |
string |
URL de conexiΓ³n a MongoDB | Requerido |
CLUBID |
number |
ID del club en EA Sports | 2766636 |
PLATFORM |
string |
Plataforma del club (Xbox/PS/PC) | common-gen5 |
CLUB_CACHE_MS |
number |
Tiempo de cachΓ© para datos del club (ms) | 3600000 (1 hora) |
TOTW_CRON_SCHEDULE |
string |
ExpresiΓ³n cron para horario del TOTW | 0 21 * * 0 |
TZ |
string |
Zona horaria para el cron (Huso horario) | Europe/Madrid |
Ejemplo .env:
PORT=3000
DEVMODE=true
MONGO_URL=mongodb://localhost:27017/tpcs
CLUBID=2766636
PLATFORM=common-gen5
CLUB_CACHE_MS=3600000
TOTW_CRON_SCHEDULE="0 21 * * 0"
TZ=Europe/Madrid| Variable | Tipo | DescripciΓ³n | Valor por defecto |
|---|---|---|---|
MONGO_URL |
string |
URL de conexiΓ³n a MongoDB | Requerido |
CLUBID |
number |
ID del club para sincronizar | 290776 |
PLATFORM |
string |
Plataforma del club (Xbox/PS/PC) | common-gen5 |
WORKER_INTERVAL |
number |
Intervalo de sincronizaciΓ³n en segundos | 300 (5 minutos) |
FORCE_RECALCULATE |
boolean |
Fuerza recΓ‘lculo de estadΓsticas en startup | false |
RABBITMQ_URL |
string |
URL de conexiΓ³n a RabbitMQ | amqp://localhost |
TZ |
string |
Zona horaria para cΓ‘lculos de fechas | Europe/Madrid |
TOTW_CRON_SCHEDULE |
string |
ExpresiΓ³n cron para proceso de TOTW | 0 21 * * 0 |
TOTW_MIN_GAMES_PLAYED |
number |
MΓnimo de partidos jugados para ser considerado en el TOTW | 5 |
Ejemplo .env:
MONGO_URL=mongodb://localhost:27017/tpcs
CLUBID=290776
PLATFORM=common-gen5
WORKER_INTERVAL=300
FORCE_RECALCULATE=false
RABBITMQ_URL=amqp://localhost
TZ=Europe/Madrid
TOTW_CRON_SCHEDULE="0 21 * * 0"
TOTW_MIN_GAMES_PLAYED=5MongoDB:
# Usando Docker
docker run -d -p 27017:27017 --name mongodb mongo:latestRabbitMQ:
# Usando Docker
docker run -d -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:3-managementapps/
βββ api/ # REST API
β βββ src/
β βββ controllers/ # Controladores
β βββ models/ # Esquemas MongoDB
β βββ interfaces/ # TypeScript interfaces
β βββ routes/ # DefiniciΓ³n de rutas
β βββ services/ # LΓ³gica de negocio
β βββ middleware/ # Middlewares
β βββ database/ # ConfiguraciΓ³n DB
β βββ app.ts # Punto de entrada
βββ web/ # Frontend Astro
β βββ src/
β βββ components/ # Componentes Vue y Astro
β βββ pages/ # Rutas Astro
β βββ layouts/ # Layouts
β βββ services/ # Servicios HTTP
β βββ interfaces/ # TypeScript types
β βββ i18n/ # Traducciones
β βββ scripts/ # Scripts compartidos
βββ worker/ # Background Jobs
βββ src/
βββ controllers/
βββ services/
βββ jobs/
βββ events/
- Desarrollo:
http://localhost:80
GET /- InformaciΓ³n general de rutas
Motor: MongoDB
Colecciones principales:
clubs- InformaciΓ³n de clubesclubmembers- Integrantes de los clubesmatches- Registro de partidosplayerstats- EstadΓsticas de jugadoresachievements- Logros desbloqueadostotw- Equipo de la semana
Ambas aplicaciones principales incluyen Dockerfile para contenerizaciΓ³n:
# Construir imagen API
cd apps/api
docker build -t tpcs-api .
# Construir imagen Worker
cd apps/worker
docker build -t tpcs-worker .- CORS: Configurado para producciΓ³n (
https://www.casemurocity.org) - Error Handling: Middleware centralizado para manejo de errores
- ValidaciΓ³n: Schemas y tipos TypeScript fuertes
| Componente | TecnologΓas |
|---|---|
| API Backend | Express.js, TypeScript, MongoDB, Mongoose |
| Frontend Web | Astro, Vue.js, Tailwind CSS, DaisyUI |
| Build Tools | TypeScript, pnpm, Webpack |
el_trueno
Este proyecto estΓ‘ bajo la Licencia MIT.
Las contribuciones son bienvenidas. Por favor:
- Fork el repositorio
- Crea una rama para tu feature (
git checkout -b feature/AmazingFeature) - Commit tus cambios (
git commit -m 'Add some AmazingFeature') - Push a la rama (
git push origin feature/AmazingFeature) - Abre un Pull Request
A comprehensive management system for Pro Clubs.
Trueno Pro Club Services is a complete platform that allows you to manage all aspects of a Pro Club, including members, achievements, matches, player statistics, and more.
This project is an evolution of Caracantosmeaos.
You can see the system in action at the official Casemuro City deployment: π https://www.casemurocity.org
This is a monorepo structured with pnpm workspaces that includes:
- Stack: Express.js + MongoDB
- Main functionalities:
- Club management (
/club) - Member management (
/members) - Achievements and statistics (
/achievements) - Match registration (
/matches) - Team of the Week (
/totw)
- Club management (
- Models: Club, Club Members, Matches, Player Stats, Achievements, TOTW
- Stack: Astro + Vue + Tailwind
- Features:
- Responsive interface
- Modern design with DaisyUI
- Purpose: Asynchronous processing of events and scheduled tasks
- Features: Event system and background job handling
- Reusable shared package
- Contains common models and utilities
- Node.js 18+
- pnpm 8+
# Clone the repository
git clone <repository-url>
cd TruenoProClubServices
# Install dependencies for the entire monorepo
pnpm install
# Build all projects
pnpm build# Build all applications
pnpm buildcd apps/api
# Start in development mode
pnpm start
# Build for production
pnpm build
# Run compiled binary
pnpm servecd apps/web
# Start development server
pnpm dev
# Build for production
pnpm build
# Preview production build
pnpm previewEnvironment variables should be configured in .env files (or other environment variable types if using Docker, for example) in each application.
| Variable | Type | Description | Default Value |
|---|---|---|---|
PORT |
number |
Port on which the API listens | 80 |
DEVMODE |
boolean |
Enables open CORS for development | false |
MONGO_URL |
string |
MongoDB connection URL | Required |
CLUBID |
number |
Club ID on EA Sports | 2766636 |
PLATFORM |
string |
Club platform (Xbox/PS/PC) | common-gen5 |
CLUB_CACHE_MS |
number |
Cache time for club data (ms) | 3600000 (1 hour) |
TOTW_CRON_SCHEDULE |
string |
Cron expression for TOTW schedule | 0 21 * * 0 |
TZ |
string |
Timezone for cron calculates | Europe/Madrid |
Example .env:
PORT=3000
DEVMODE=true
MONGO_URL=mongodb://localhost:27017/tpcs
CLUBID=2766636
PLATFORM=common-gen5
CLUB_CACHE_MS=3600000
TOTW_CRON_SCHEDULE="0 21 * * 0"
TZ=Europe/Madrid| Variable | Type | Description | Default Value |
|---|---|---|---|
MONGO_URL |
string |
MongoDB connection URL | Required |
CLUBID |
number |
Club ID to synchronize | 290776 |
PLATFORM |
string |
Club platform (Xbox/PS/PC) | common-gen5 |
WORKER_INTERVAL |
number |
Synchronization interval in seconds | 300 (5 minutes) |
FORCE_RECALCULATE |
boolean |
Force statistics recalculation on startup | false |
RABBITMQ_URL |
string |
RabbitMQ connection URL | amqp://localhost |
TZ |
string |
Timezone for date calculations | Europe/Madrid |
TOTW_CRON_SCHEDULE |
string |
Cron expression for TOTW process | 0 21 * * 0 |
TOTW_MIN_GAMES_PLAYED |
number |
Minimum games played to be considered for TOTW | 5 |
Example .env:
MONGO_URL=mongodb://localhost:27017/tpcs
CLUBID=290776
PLATFORM=common-gen5
WORKER_INTERVAL=300
FORCE_RECALCULATE=false
RABBITMQ_URL=amqp://localhost
TZ=Europe/Madrid
TOTW_CRON_SCHEDULE="0 21 * * 0"
TOTW_MIN_GAMES_PLAYED=5MongoDB:
# Using Docker
docker run -d -p 27017:27017 --name mongodb mongo:latestRabbitMQ:
# Using Docker
docker run -d -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:3-managementapps/
βββ api/ # REST API
β βββ src/
β βββ controllers/ # Controllers
β βββ models/ # MongoDB Schemas
β βββ interfaces/ # TypeScript interfaces
β βββ routes/ # Route definitions
β βββ services/ # Business logic
β βββ middleware/ # Middlewares
β βββ database/ # Database configuration
β βββ app.ts # Entry point
βββ web/ # Astro Frontend
β βββ src/
β βββ components/ # Vue and Astro components
β βββ pages/ # Astro routes
β βββ layouts/ # Layouts
β βββ services/ # HTTP services
β βββ interfaces/ # TypeScript types
β βββ i18n/ # Translations
β βββ scripts/ # Shared scripts
βββ worker/ # Background Jobs
βββ src/
βββ controllers/
βββ services/
βββ jobs/
βββ events/
- Development:
http://localhost:80
GET /- General information about routes
Engine: MongoDB
Main Collections:
clubs- Club informationclubmembers- Club membersmatches- Match recordsplayerstats- Player statisticsachievements- Unlocked achievementstotw- Team of the Week
Both main applications include Dockerfile for containerization:
# Build API image
cd apps/api
docker build -t tpcs-api .
# Build Worker image
cd apps/worker
docker build -t tpcs-worker .- CORS: Configured for production (
https://www.casemurocity.org) - Error Handling: Centralized error handling middleware
- Validation: Strong TypeScript schemas and types
| Component | Technologies |
|---|---|
| API Backend | Express.js, TypeScript, MongoDB, Mongoose |
| Frontend Web | Astro, Vue.js, Tailwind CSS, DaisyUI |
| Build Tools | TypeScript, pnpm, Webpack |
el_trueno
This project is licensed under the MIT License.
Contributions are welcome. Please:
- Fork the repository
- Create a branch for your feature (
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