This guide covers how to set up your development environment and contribute to Sigmagit.
- Bun 1.3.5 or higher (JavaScript runtime and package manager)
- Node.js 18+ (for some tooling)
- PostgreSQL 15+ (for local development)
- Redis 7+ (optional, for caching and webhooks)
- Git (for version control)
- Clone the repository:
git clone https://git.sigmagaming.net/SigmaGaming/SimgaGit-v2
.git cd sigmagit
2. Install dependencies:
```bash
bun install
-
Set up environment variables:
cp .env.example .env # Edit .env with your configuration -
Initialize the database:
bun run db:push
-
Start the development servers:
# Start web app + API server (ports 3000, 3001) bun run dev:web # Or start mobile app + API server (ports 8081, 3001) bun run dev:mobile
# Run all tests
cd apps/web && bun run test
# Run specific test pattern
cd apps/web && bunx vitest run <pattern>
# Watch mode for development
cd apps/web && bunx vitest watch# Lint all packages
bun run lint
# Or via turbo
turbo lint
# Type check (package-specific)
cd apps/web && bun run typecheck# Build all applications
bun run build
# Build all via turbo
turbo build- Modify
packages/db/src/schema.ts - Generate migrations:
bun run db:generate
- Apply migrations:
bun run db:migrate
bun run db:studiobun install- Install all dependenciesbun run dev:web- Start web app + APIbun run dev:mobile- Start mobile app + APIbun run build- Build all appsbun run lint- Lint all packagesbun run db:push- Push schema to databasebun run db:generate- Generate Drizzle migrationsbun run db:migrate- Apply migrationsbun run db:studio- Open Drizzle Studio
bun run dev- Start development serverbun run build- Build for productionbun run test- Run testsbun run lint- Lint codebun run typecheck- TypeScript type check
bun run dev- Start API serverbun run build- Build for productionbun run lint- Lint codebun run typecheck- TypeScript type check
bun run dev- Start bot in watch modebun run start- Start bot normallybun run register- Register slash commands
bun run push- Push schema changesbun run generate- Generate migrationsbun run migrate- Apply migrationsbun run studio- Open Drizzle Studio
We use Prettier for code formatting with the following conventions:
- Line width: 100 characters
- Indentation: 2 spaces (no tabs)
- Semicolons: required
- Quotes: single quotes
- Imports are auto-sorted
To format code:
bunx prettier --write .sigmagit/
├── apps/
│ ├── web/ # TanStack Start web application
│ ├── mobile/ # Expo React Native app
│ ├── api/ # Hono API server
│ └── discord-bot/ # Discord.js bot
├── packages/
│ ├── db/ # Drizzle ORM schema
│ ├── lib/ # Shared utilities
│ └── hooks/ # React Query hooks
├── docs/ # Documentation
└── AGENTS.md # Agent development guidelines
- Define types in relevant package
- Add database schema if needed
- Create API routes in
apps/api/src/routes/ - Add React Query hooks in
packages/hooks/src/ - Build UI components in
apps/web/ - Write tests for new functionality
- Update documentation
If ports 3000, 3001, or 8081 are already in use:
- Kill the process:
lsof -ti:3000 | xargs kill - Or change ports in environment variables
- Ensure PostgreSQL is running
- Check
DATABASE_URLin.env - Verify database exists:
psql -U postgres -l
- Clear node_modules:
rm -rf node_modules && bun install - Rebuild packages:
turbo build
- Check existing documentation in
docs/ - Review
AGENTS.mdfor agent-specific guidelines - Look at existing code for patterns and conventions