Development Setup
Set up your development environment for maximum productivity with Aya’s monorepo structure.Prerequisites
Before starting, complete the Installation guide for either Docker Compose or Nix.IDE Configuration
Visual Studio Code (Recommended)
Aya includes a.vscode directory with recommended settings and extensions.
Recommended Extensions
.vscode/extensions.json
- Open VS Code
- Press
Cmd/Ctrl + Shift + P - Type “Show Recommended Extensions”
- Click “Install All”
Workspace Settings
.vscode/settings.json
Multi-Root Workspace
For better organization, use a multi-root workspace:aya.code-workspace
code aya.code-workspace
Project Structure Tour
- Root
- Frontend
- Backend
Development Workflow
Starting Services
Code Quality Checks
Run before committing:Pre-commit Hooks
Install Git hooks to run checks automatically:.pre-commit-config.yaml):
- Frontend:
deno lint,deno fmt - Backend:
golangci-lint,gofumpt - General: trailing whitespace, file size, merge conflicts
Hot Reload
Both frontend and backend support hot reload:Frontend (Vite HMR)
Vite provides instant hot module replacement:- Component changes (
.tsx) - CSS module changes (
.module.css) - Route changes (
src/routes/)
- Router configuration changes
deno.jsonchanges- Vite config changes
Backend (Air)
Air watches Go files and rebuilds automatically:.air.toml
.gofile changes- Template changes (
.tpl,.tmpl) - SQL changes (requires
make generatefirst)
Database Development
Accessing PostgreSQL
Running Migrations
Creating Migrations
0011_add_profile_badges.sql
Code Generation (sqlc)
After creating/modifying SQL queries:pkg/api/adapters/*/db.go.
Testing
Frontend Tests
src/lib/locale-utils.test.ts
Backend Tests
pkg/api/business/profiles/get_test.go
Debugging
Frontend Debugging
Browser DevTools
- Open Chrome/Firefox DevTools (F12)
- Go to Sources tab
- Find
src/directory in file tree - Set breakpoints
- Reload page
VS Code Debugger
.vscode/launch.json
Backend Debugging
Delve (Go Debugger)
VS Code Debugger
.vscode/launch.json
Common Tasks
Add a New Route
Add a New API Endpoint
Troubleshooting
Deno import errors in VS Code
Deno import errors in VS Code
Ensure Deno extension is enabled for webclient:Reload VS Code window:
Cmd/Ctrl + Shift + P → “Reload Window”Go imports not resolving
Go imports not resolving
Run Restart Go language server in VS Code.
go mod tidy:Hot reload not working
Hot reload not working
Frontend: Check terminal for Vite errors. Restart with
Ctrl+C and deno task dev.Backend: Check Air logs. Verify .air.toml includes correct file extensions.Database connection errors
Database connection errors
Ensure PostgreSQL is running:
Next Steps
Frontend Development
Build UI with Deno, TanStack Start, and React
Backend Development
Implement business logic and API endpoints
Database Guide
Work with PostgreSQL, migrations, and sqlc
Architecture
Understand the hexagonal architecture