Quick Start Guide
Get your first Gati application running in under 5 minutes!
Prerequisites
- Node.js 20 or higher
- pnpm (recommended) or npm
- Docker (for local Kubernetes deployment)
# Check your versions
node --version # Should be v20.0.0 or higher
pnpm --version # Should be 8.0.0 or higherStep 1: Create Your Project
Use gatic to create a new Gati application:
npx gatic create my-first-appYou'll see:
🚀 Creating Gati project: my-first-app
✓ Copying template files...
✓ Initializing package.json...
✓ Installing dependencies...
✨ Project created successfully!
Next steps:
cd my-first-app
pnpm devThis creates a complete project structure:
my-first-app/
├── src/
│ ├── index.ts # App entry point
│ ├── handlers/
│ │ └── hello.ts # Example handler
│ └── modules/ # Reusable modules
├── gati.config.ts # Gati configuration
├── package.json
├── tsconfig.json
└── README.mdStep 2: Start Development Server
cd my-first-app
pnpm devOutput:
🚀 Gati development server starting...
✓ Loaded 1 handler
✓ Server running at http://localhost:3000
✓ Hot reload enabled
Press Ctrl+C to stopStep 3: Test Your First Handler
Open your browser or use curl:
curl http://localhost:3000/api/helloResponse:
{
"message": "Hello from Gati!",
"timestamp": "2025-11-12T10:30:00.000Z"
}Step 4: Create a New Handler
Create src/handlers/users/[id].ts:
import type { Handler } from '@gati-framework/runtime';
// HTTP method (optional, defaults to GET)
export const METHOD = 'GET';
// Handler function
export const handler: Handler = (req, res) => {
const userId = req.params.id;
// Example: fetch user from database
const user = {
id: userId,
name: 'John Doe',
email: 'john@example.com'
};
res.json({ user });
};The handler is automatically discovered and available at /api/users/:id with hot reloading enabled.
Test it:
curl http://localhost:3000/api/users/123Response:
{
"user": {
"id": "123",
"name": "John Doe",
"email": "john@example.com"
}
}Step 5: Add Query Parameters
Update src/handlers/users/[id].ts:
export const METHOD = 'GET';
export const handler: Handler = (req, res) => {
const userId = req.params.id;
const includeOrders = req.query.includeOrders === 'true';
const user = {
id: userId,
name: 'John Doe',
email: 'john@example.com',
...(includeOrders && {
orders: [
{ id: 1, total: 99.99 },
{ id: 2, total: 149.99 }
]
})
};
res.json({ user });
};Notice how the file automatically reloads when you save - no server restart needed!
Test with query params:
curl http://localhost:3000/api/users/123?includeOrders=trueStep 6: Build for Production
pnpm buildThis creates an optimized production build in dist/:
✓ TypeScript compiled successfully
✓ Build output: dist/Step 7: Deploy to Local Kubernetes
Ensure Docker is running, then:
gati deploy dev --localGati will:
- ✅ Create a local Kubernetes cluster (kind)
- ✅ Build Docker image
- ✅ Deploy your application
- ✅ Wait for rollout to complete
- ✅ Run health checks
Output:
🚀 Deploying to local Kubernetes...
✓ kind cluster created
✓ Docker image built: my-first-app:latest
✓ Image loaded into cluster
✓ Namespace created: my-first-app-dev
✓ Deployment created
✓ Waiting for rollout...
✓ Deployment ready (1/1 pods)
✓ Health check passed
🎉 Deployment successful!
Access your app:
kubectl port-forward -n my-first-app-dev svc/my-first-app 8080:3000
Then visit: http://localhost:8080Step 8: Access Your Deployed App
kubectl port-forward -n my-first-app-dev svc/my-first-app 8080:3000Now test:
curl http://localhost:8080/api/helloQuick Reference
Common Commands
# Development
pnpm dev # Start dev server with hot reload
pnpm build # Build for production
pnpm start # Start production server
# Deployment
gati deploy dev --local # Deploy to local K8s
gati deploy dev --local --port-forward # Deploy with auto port-forward
gati deploy dev --dry-run # Generate manifests only
# Testing
pnpm test # Run tests
pnpm typecheck # Type checkingFile Structure
src/
├── index.ts # App initialization
├── handlers/ # API handlers (auto-discovered)
│ ├── hello.ts # GET /api/hello
│ └── users.ts # GET /api/users/:id
├── modules/ # Reusable modules
│ └── database.ts # Example: database module
└── middleware/ # Custom middleware (optional)
└── auth.ts # Example: auth middlewareHandler Conventions
Handlers are automatically mapped to routes based on their filename:
| File | Route |
|---|---|
handlers/hello.ts | /api/hello |
handlers/users/[id].ts | /api/users/:id |
handlers/posts/create.ts | /api/posts/create |
handlers/posts/[id]/comments.ts | /api/posts/:id/comments |
New Features:
- 🔥 Hot Reloading: Changes appear instantly (50-200ms)
- 📦 Manifest System: Individual file manifests for fast updates
- 🚀 Auto Port Detection: Finds available ports automatically
- 📊 Built-in Health Checks:
/healthendpoint included
Next Steps
Learn More
- Getting Started Guide - Comprehensive tutorial
- Handlers Guide - Deep dive into handlers
- Modules Guide - Create reusable modules
- Deployment Guide - Advanced deployment options
Explore Examples
- Hello World - Basic example
- REST API - Full REST API example
Join the Community
- GitHub - Source code
- Issues - Report bugs
- Discussions - Ask questions
Troubleshooting
Port 3000 Already in Use
# Change port in gati.config.ts
export default {
port: 3001
};Docker Not Running
# Start Docker Desktop or Docker daemon
# On Windows: Start Docker Desktop
# On Mac: Start Docker Desktop
# On Linux: sudo systemctl start dockerBuild Errors
# Clean and reinstall dependencies
rm -rf node_modules dist
pnpm install
pnpm buildSummary
You've successfully:
- ✅ Created a Gati project
- ✅ Started the development server
- ✅ Created API handlers
- ✅ Built for production
- ✅ Deployed to Kubernetes
Total time: ~5 minutes ⚡
Ready to build something awesome? Head to the Getting Started Guide for more advanced features!
Last Updated: November 12, 2025