Skip to content

Latest commit

 

History

History
148 lines (111 loc) · 2.6 KB

File metadata and controls

148 lines (111 loc) · 2.6 KB

Quick Start Guide

New Monorepo Structure

vimazing/
├── apps/vimaze/       # Frontend maze game
├── servers/api/       # Backend WebSocket server
└── workspaces/types/  # Shared TypeScript types

Commands

Development

# Run vimaze (frontend)
bun run dev:vimaze
# Opens on http://localhost:5173

# Run API server (backend)
bun run dev:api
# Runs on http://localhost:9000

Building

# Build vimaze for production
bun run build:vimaze

Linting

# Lint vimaze code
bun run lint:vimaze

Using Shared Types

In any app or server:

// Import from the types workspace
import type { MazeCell, Coord } from "types/maze";
import type { GameStatus } from "types/game";
import type { WebSocketMessage } from "types/websocket";
import type { ScoreParams } from "types/score";
import type { KeyLogEntry } from "types/hooks";

Adding a New App

# 1. Create directory
mkdir -p apps/myapp/src

# 2. Create package.json
cat > apps/myapp/package.json << 'EOF'
{
  "name": "myapp",
  "version": "0.0.0",
  "private": true,
  "dependencies": {
    "types": "workspace:*"
  }
}
EOF

# 3. Configure TypeScript paths
cat > apps/myapp/tsconfig.json << 'EOF'
{
  "compilerOptions": {
    "paths": {
      "types/*": ["../../workspaces/types/src/*"]
    }
  }
}
EOF

# 4. Install
bun install

# 5. Add to root scripts (optional)
# Edit package.json and add:
# "dev:myapp": "cd apps/myapp && bun run dev"

Adding a New Type

# 1. Create type file
echo 'export type MyType = { ... }' > workspaces/types/src/mytype.ts

# 2. Add export to package.json
# Edit workspaces/types/package.json:
# "exports": {
#   "./mytype": "./src/mytype.ts"
# }

# 3. Use anywhere
# import type { MyType } from "types/mytype"

Documentation

Troubleshooting

Types not found

bun install

Build errors

rm -rf node_modules
bun install
cd apps/vimaze && bun run build

Port already in use

# Kill process on port 5173 (vimaze)
lsof -ti:5173 | xargs kill -9

# Kill process on port 9000 (API)
lsof -ti:9000 | xargs kill -9

Next Steps

  1. Explore the codebase in apps/vimaze/src/
  2. Check out the types in workspaces/types/src/
  3. Read the full documentation in WORKSPACES.md
  4. Start building!

Need help? Check the documentation or open an issue.