Lesson 2: Selecting the Stack
Choosing technologies and documenting them in Containers.
Lesson 2: Selecting the Stack
We have our domains. Now we need to pick the tools to build them.
The Stack
- Frontend: Next.js (React) - Great for SEO and performance.
- Backend: Go (Golang) - High performance, great concurrency for e-commerce.
- Database: PostgreSQL - Reliable, ACID compliant (critical for money).
Modeling in Sruja
We define these choices in our container definitions.
import { * } from 'sruja.ai/stdlib'
Platform = system "E-Commerce Platform" {
WebApp = container "Storefront & Admin" {
technology "Next.js, TypeScript"
description "The user-facing application."
}
API = container "Core API" {
technology "Go, Gin"
description "REST API handling business logic."
}
Database = container "Primary DB" {
technology "PostgreSQL 15"
description "Stores orders, products, and users."
}
WebApp -> API "JSON/HTTPS"
API -> Database "SQL/TCP"
}
By documenting technology, we make it clear to new developers what skills they need.