A modern full-stack web application for the Brackeys Discord community, built with TanStack Start, React 19, and a self-hosted backend stack.
# 1. Install dependencies
bun install
# 2. Build SpacetimeDB module (first time only)
cd spacetime-db
cargo build --release --target wasm32-unknown-unknown
cd ..
# 3. Configure environment
cp .env.example .env
# Edit .env with your Clerk keys
# 4. Start backend services (requires Docker)
docker-compose up -d
# 5. Start development server
bun run dev
Visit http://localhost:3000 to see your app!
brackeys/
βββ hasura/ # Hasura GraphQL metadata & migrations
βββ spacetime-db/ # SpacetimeDB Rust module (WASM)
βββ src/
β βββ routes/ # File-based routes (TanStack Router)
β β βββ index.tsx # Home page
β β βββ login.tsx # Login page
β β βββ profile.tsx # User profile
β β βββ sandbox.tsx # Real-time canvas
β β βββ resources.tsx # Games & tools
β β βββ collaborations/ # Collaboration marketplace
β β βββ auth/ # Auth flow pages
β β βββ api/ # API routes (webhooks, etc.)
β βββ components/ # React components
β β βββ auth/ # Auth guards, login button
β β βββ collaborations/ # Collab cards, filters
β β βββ games/ # Games (Snake, etc.)
β β βββ home/ # Hero, features, CTA
β β βββ layout/ # Header, footer, main layout
β β βββ resources/ # Resource cards, filters
β β βββ sandbox/ # Canvas, cursors, messages
β β βββ ui/ # Reusable UI (Button, Input, Modal)
β βββ context/ # React Context providers
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utilities & configurations
β βββ server/ # Server functions
β β βββ auth/ # Discord sync
β β βββ webhooks/ # Clerk webhooks
β β βββ graphql/ # GraphQL wrappers
β βββ styles.css # Global styles
βββ docs/ # Comprehensive documentation
βββ .storybook/ # Storybook configuration
βββ mise.toml # Development tooling
TanStack Start supports flexible server-side rendering. Routes use Full SSR by default.
Everything rendered server-side for best SEO and initial load:
export const Route = createFileRoute('/my-route')({
component: MyComponent,
});
Server fetches data, client renders UI (hybrid approach):
export const Route = createFileRoute('/my-route')({
ssr: 'data-only',
component: MyComponent,
loader: async () => {
return await fetchDataServerSide();
},
});
Fully client-side rendering (like traditional React):
export const Route = createFileRoute('/my-route')({
ssr: false,
component: MyComponent,
});
user.created or session.created/auth/entry for guild validationSee docs/AUTH_FLOW.md for details.
All development tasks are managed through mise or bun scripts:
# Core Development
mise run dev # Start all services (Hasura + Frontend)
mise run dev-frontend # Frontend only
mise run dev-hasura # Hasura only
# Code Quality
bun run lint # Run linting
bun run lint:fix # Fix linting issues
bun run format # Format code
bun run format:check # Check formatting
bun run check # Run all checks
# Building & Generation
bun run build # Production build
bun run graphql-codegen # Generate GraphQL types
bun run storybook # Component documentation
# Versioning & Commits
bun run commit # Commitizen (conventional commits)
bun run release # Create version release
mise run pre-commit # Run all pre-commit checks
# Utilities
mise run check # Verify tool installation
mise run doctor # Health check
mise run clean # Clean generated files
mise tasks # List all available tasks
Create a .env file based on .env.example:
# Clerk Authentication
VITE_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...
CLERK_WEBHOOK_SECRET=whsec_...
# Hasura GraphQL
VITE_HASURA_GRAPHQL_URL=http://localhost:3280/graphql
HASURA_GRAPHQL_ADMIN_SECRET=your_secret
HASURA_GRAPHQL_JWT_SECRET=your_jwt_secret
# SpacetimeDB
VITE_SPACETIME_HOST=wss://localhost:3000
VITE_SPACETIME_MODULE=brackeys-sandbox
# Discord
VITE_BRACKEYS_GUILD_ID=240491168985399296
DISCORD_GUILD_ID=240491168985399296
# Run tests
bun run test
# Type check
bunx tsc --noEmit
# Storybook (visual testing)
bun run storybook
# E2E tests (Playwright)
bunx playwright test
curl https://mise.run | sh
echo 'eval "$(mise activate bash)"' >> ~/.bashrc
source ~/.bashrc
# Find and kill process using port 3000
lsof -i :3000 # macOS/Linux
netstat -ano | findstr :3000 # Windows
# Rebuild the Rust module
cd spacetime-db
cargo clean
cargo build --release --target wasm32-unknown-unknown
cd ..
See docs/DEVELOPMENT_SETUP.md for more troubleshooting.
All managed via Docker Compose:
#ffa949#d2356b#5865f2 (with variants 100-900)#5865f2.bg-dot-pattern, .bg-line-pattern.pattern-mask-radial, .pattern-mask-fade-in/out.custom-scrollbarbun run build
# Deploy to Vercel
cd hasura
ddn supergraph build create
bun run build-storybook
# Auto-deployed via GitHub Actions
# 1. Create a feature branch
git checkout -b feature/my-feature
# 2. Make changes
# ...
# 3. Commit with Commitizen
bun run commit
# 4. Push and create PR
git push origin feature/my-feature
MIT License - see LICENSE file for details.
Built with β€οΈ by the Brackeys Community