Getting Started
This guide will help you set up your development environment and get True Life running locally.
Prerequisites
Before you begin, ensure you have the following installed:
- Node.js 22+ - Download
- pnpm 10+ - Install with
npm install -g pnpm - Docker - For MongoDB and observability stack
- FiveM Server - For running the game server
Installation
1. Clone the Repository
git clone https://github.com/true-life/true_life.git
cd true_life
2. Install Dependencies
pnpm install
3. Start Infrastructure
Start MongoDB (required):
docker compose up -d mongo
Optionally, start the full observability stack:
docker compose up -d otel-collector tempo loki grafana
4. Generate Assets
pnpm gen
5. Start Development
Start all development servers:
pnpm dev
This runs three processes in parallel:
- Client build - Rollup watching
src/for client changes - Server build - Rollup watching
src/for server changes - UI dev server - Vite dev server at
http://127.0.0.1:3000
Development Commands
| Command | Description |
|---|---|
pnpm dev | Full dev environment (client + server + UI) |
pnpm dev:client | Client build only with watch |
pnpm dev:server | Server build only with watch |
pnpm dev:ui | UI dev server only |
pnpm build | Production build (all targets) |
pnpm typecheck | Type check runtime code |
pnpm lint | ESLint + typecheck |
pnpm format | Format with Prettier |
pnpm test | Run UI tests |
Project Configuration
Environment Variables
Create a .env file in the project root:
# MongoDB
MONGO_INITDB_ROOT_USERNAME=admin
MONGO_INITDB_ROOT_PASSWORD=changeme
# Grafana (optional)
GRAFANA_ADMIN_USER=admin
GRAFANA_ADMIN_PASSWORD=admin
FiveM Server Configuration
Add to your server.cfg:
# Development mode
set dev_mode "true"
set dev_features "" # Empty = load all modules
# MongoDB connection
set mongodb_uri "mongodb://admin:changeme@localhost:27017"
set mongodb_database "true_life"
# OpenTelemetry (optional)
set otel_enabled "true"
set otel_endpoint "http://localhost:4318"
Accessing Services
| Service | URL | Description |
|---|---|---|
| UI Dev Server | http://127.0.0.1:3000 | Vite HMR dev server |
| Grafana | http://localhost:3001 | Dashboards and traces |
| Prometheus | http://localhost:9090 | Metrics |
| Live Map | http://localhost:3002 | Interactive player map |
| Documentation | http://localhost:3003 | This documentation |
Next Steps
- Read the Architecture Overview to understand the framework
- Follow the Creating Modules guide to build your first module
- Explore the API Reference for detailed documentation