Starter Templates Reference¶
Complete reference for Airbase starter templates
Starter templates provide pre-configured project structures that help you quickly build and deploy applications on Airbase. Each template includes all necessary configuration files, dependencies, and example code to get you started.
Overview¶
Templates are quick and easy ways to get started building an application on Airbase. Whether it's prototyping an idea, building a proof-of-concept, or laying the foundation for the next big thing, there's a template for you.
What's included in templates: - Pre-configured airbase.json with recommended settings - Production-ready Dockerfile using Airbase base images - .dockerignore and .gitignore files - Example application code demonstrating best practices - Environment variable configuration examples - README with setup instructions
Available Templates¶
Full-Stack Templates¶
airbase-t3-app (Next.js)¶
Type: Full-Stack Web Application
Stack: - Framework: Next.js (React) - Language: TypeScript - Database: PostgreSQL (via Prisma ORM) - Authentication: NextAuth.js - Styling: Tailwind CSS - API: tRPC (type-safe API layer)
Use cases: - Full-stack web applications - Dashboards and admin panels - User-facing web apps with authentication - Apps requiring SSR (Server-Side Rendering)
Link: SGTS GitLab - airbase-t3-app
Instance type: Recommended b.small
Prerequisites: - Node.js 22+ - PostgreSQL database (external)
airbase-streamlit-app (Python)¶
Type: Data Application / Dashboard
Stack: - Framework: Streamlit - Language: Python 3.13 - Data: Pandas, NumPy - Visualization: Plotly, Matplotlib
Use cases: - Data dashboards and visualizations - Internal tools for data analysis - Machine learning model demos - Quick prototypes for data exploration
Link: SGTS GitLab - airbase-streamlit-app
Instance type: Recommended b.small
Prerequisites: - Python 3.13+
Notes: - Streamlit apps typically require at least b.small due to memory requirements - Keep datasets small (<100MB) for optimal performance
Backend API Templates¶
airbase-go-app (Go)¶
Type: Backend REST API
Stack: - Language: Go (Golang) 1.25 - Router: Chi router or Gin (varies by template version) - API Style: RESTful
Use cases: - High-performance REST APIs - Microservices - Backend services for mobile/web apps - System utilities and tools
Link: SGTS GitLab - airbase-go-app
Instance type: Recommended nano to b.small
Prerequisites: - Go 1.25+
Notes: - Go applications typically have lower memory footprint - nano instance may be sufficient for simple APIs
Using a Template¶
Quick Start¶
-
Clone the template repository:
-
Install dependencies:
- Node.js:
npm install - Python:
pip install -r requirements.txt -
Go:
go mod download -
Configure for your project:
- Update
airbase.jsonwith your project handle - Set environment variables in
.env -
Update README with your project details
-
Test locally:
- Node.js:
npm run dev - Python:
streamlit run app.py -
Go:
go run main.go -
Build and deploy:
Customizing Templates¶
Rename project: - Update airbase.json → handle - Update package.json → name (Node.js) - Update README title
Adjust instance type:
Add dependencies: - Node.js: npm install <package> - Python: Add to requirements.txt, run pip install -r requirements.txt - Go: go get <package>, run go mod tidy
Template Structure¶
Standard Template Contents¶
All templates follow this basic structure:
template-name/
├── airbase.json # Airbase configuration
├── Dockerfile # Container build instructions
├── .dockerignore # Files to exclude from Docker build
├── .gitignore # Files to exclude from Git
├── .env.example # Environment variable template
├── README.md # Setup and usage instructions
├── package.json # Dependencies (Node.js)
├── requirements.txt # Dependencies (Python)
├── go.mod # Dependencies (Go)
└── src/ # Application source code
Required Files¶
Every template must include:
-
airbase.json - Airbase project configuration
-
Dockerfile - Using Airbase base images
-
.dockerignore - Exclude unnecessary files
-
README.md - Setup instructions and documentation
Optional but Recommended¶
.env.example- Example environment variables.gitignore- Files to exclude from version controldocker-compose.yml- Local development setup- Tests directory with example tests
Template Categories¶
By Application Type¶
| Category | Templates | Use Cases |
|---|---|---|
| Full-Stack Web | airbase-t3-app | User-facing web apps, dashboards, admin panels |
| Data & Analytics | airbase-streamlit-app | Data dashboards, ML demos, internal tools |
| Backend API | airbase-go-app | REST APIs, microservices, backend services |
| Static Sites | (use Figma Make) | Landing pages, marketing sites, documentation |
By Technology Stack¶
| Stack | Templates |
|---|---|
| Node.js/TypeScript | airbase-t3-app |
| Python | airbase-streamlit-app |
| Go | airbase-go-app |
By Instance Type Requirement¶
| Instance Type | Suitable Templates |
|---|---|
| nano | airbase-go-app (simple APIs) |
| b.small | airbase-t3-app, airbase-streamlit-app, airbase-go-app (standard apps) |
Making Your Own Template¶
Can't find something that catches your eye? Feel free to create your own template from scratch.
Template Requirements¶
To create a shareable Airbase template:
-
Include all required files (airbase.json, Dockerfile, .dockerignore, README.md)
-
Use Airbase base images in Dockerfile:
-
Follow security best practices:
- Set
USER appin Dockerfile - Use
--chown=app:appin COPY commands -
Don't commit secrets or
.envfiles -
Provide clear documentation:
- Prerequisites
- Local development setup
- Deployment instructions
-
Environment variables needed
-
Include example code:
- Health check endpoint (
/health) - Example API routes or pages
- Environment variable usage
- Error handling patterns
Example Template Structure¶
Minimal working template:
my-template/
├── airbase.json
├── Dockerfile
├── .dockerignore
├── .env.example
├── .gitignore
├── README.md
└── src/
└── index.js
README.md should include:
# My Template
## Description
Brief description of what this template provides.
## Prerequisites
- Node.js 22+
- Docker
## Local Development
\```bash
npm install
npm run dev
\```
## Deployment
\```bash
airbase container build
airbase container deploy --yes staging
\```
## Environment Variables
See .env.example for required variables.
Contributing Templates¶
If you'd like to contribute your template to the official Airbase template collection:
- Test thoroughly on Airbase staging environment
- Ensure all documentation is complete
- Submit feedback with template link: go.gov.sg/airbase-feedback
- Include:
- Template name and description
- Use cases and target audience
- Link to GitLab repository
- Recommended instance type
Review criteria: - Follows Airbase best practices - Complete documentation - Uses Airbase base images - Includes working example code - Secure by default (no hardcoded secrets)
Template Maintenance¶
Updating Dependencies¶
Node.js templates:
# Check for outdated packages
npm outdated
# Update to latest compatible versions
npm update
# Update to latest versions (breaking changes possible)
npm install <package>@latest
Python templates:
# Check for outdated packages
pip list --outdated
# Update specific package
pip install --upgrade <package>
# Update requirements.txt
pip freeze > requirements.txt
Go templates:
Updating Base Images¶
When Airbase releases new base image versions:
-
Update Dockerfile:
-
Test locally:
-
Verify application works correctly
-
Update documentation if needed
Troubleshooting Templates¶
Build Fails¶
Problem: Docker build fails with "file not found"
Solution: - Check .dockerignore is not excluding required files - Verify all files referenced in Dockerfile exist - Ensure COPY paths are correct
Application Won't Start¶
Problem: Container exits immediately after deployment
Solution: - Check logs in Airbase Console for staging environment - Verify CMD in Dockerfile is correct - Ensure all dependencies are installed in Dockerfile - Check for missing environment variables
Port Binding Issues¶
Problem: Application not accessible via URL
Solution: - Ensure application binds to process.env.PORT (Node.js) or os.environ.get('PORT') (Python) - Verify EXPOSE port in Dockerfile matches - Check application logs for binding errors
See Also¶
- How-To: Deploy Static Sites (Figma Make) - Alternative for static sites
- How-To: Build and Deploy - Deployment workflow
- Reference: Dockerfile Requirements - Dockerfile specifications
- Reference: Base Images - Available base images
- Examples: All examples section for template usage demonstrations