Reference
A working task manager: React frontend, FastAPI backend, PostgreSQL, sign-in through Thinkube Identity, three languages, tests on both sides. Read this when you want to know what a file is for; ask your agent about any of them by name.
Repository layout
| Path | What it is |
|---|---|
|
Catalog entry: title, description, tags, and the parameters asked at deploy time. |
|
What the application is: containers, tests, routes, services, |
|
FastAPI application, Alembic migrations, pytest suite. |
|
React application, Vitest suite, nginx config, container entrypoint. |
|
Two things. |
|
Generated at deploy time. Not in the template; not published back. |
Backend
| Path | What it is |
|---|---|
|
Task CRUD, scoped to the signed-in user. |
|
Thinkube Identity configuration, code exchange, user info, token refresh. |
|
API tokens for calling this app from scripts. |
|
Request authentication. |
|
Settings, read from the environment. |
|
SQLAlchemy models and Pydantic schemas. |
|
Migrations. |
|
The whole suite with no arguments; one file with a file argument. |
Routes are served under /api/v1.
Frontend
| Path | What it is |
|---|---|
|
The |
|
Entry point, theme provider, router, unauthenticated routes. |
|
|
|
|
|
Zustand stores: auth, tasks, tokens. |
|
API client with the token-refresh interceptor. |
|
The OAuth2 code flow against Thinkube Identity. |
|
Reads the variables the deployment published. |
|
English, Spanish and Catalan. |
|
Runs before nginx; writes |
|
Type check, lint, the suite, coverage. |
Stack
| Concern | Choice |
|---|---|
UI |
React 19, TypeScript, Vite |
Components |
|
Styling |
Tailwind CSS 4, light and dark themes |
State |
Zustand |
Routing |
React Router |
Translation |
react-i18next |
Tests |
Vitest and React Testing Library |
API |
FastAPI, SQLAlchemy, Alembic, PostgreSQL |
Sign-in |
Thinkube Identity, OAuth2 authorization code flow |
The layout is TkAppLayout from thinkube-style: a collapsible sidebar with
grouped navigation and a top bar. It is the shell Thinkube Control uses, so
applications built from this template look like the rest of the platform.
What each part demonstrates
| Feature | Where to look |
|---|---|
Reading a deployment’s variables in the browser |
|
Sign-in through Thinkube Identity |
|
Tokens for machine callers |
|
Tests that gate the build |
|
Migrations that run themselves |
|
A database the platform creates for you |
|
Translated interface |
|
Deploy-time behaviour
| Declared | Effect |
|---|---|
|
PostgreSQL database and |
|
Alembic runs on startup |
|
|
|
Tests run in CI before the image is built |
|
The deployment’s name reaches the browser |
|
The platform’s liveness and readiness checks |
Write a template by hand
A template is an application repository with two files at its root.
manifest.yaml describes the template in the catalog and declares what to ask at deploy time:
apiVersion: thinkube.io/v1
kind: TemplateManifest
metadata:
name: tkt-my-template
title: My Application
description: What it is, in one line
version: 1.0.0
author: Your Name
tags: ["webapp", "fastapi"]
parameters: []
thinkube.yaml declares what the application is: its containers, how each is built and tested, its routes and the platform services it needs:
apiVersion: thinkube.io/v1
kind: ThinkubeDeployment
spec:
containers:
- name: backend
build: ./backend
port: 8000
health: /health
test:
enabled: true
command: "./run_tests.sh"
one: "./run_tests.sh <file>"
routes:
- path: /
to: backend
services:
- database
The full field list is in the thinkube.yaml reference. A template that deploys on any cluster:
-
gives every container a health endpoint, which the platform uses to decide whether the app is up;
-
gives every container a
run_tests.shthat runs the whole suite with no arguments and one file with a file argument; -
uses
${CONTAINER_REGISTRY}for base images in its Containerfiles; -
reads what varies from the environment, with no placeholders in the source.
Push it to GitHub and add it to repositories.json in <your account>-metadata, and it appears in the catalog.
Give a template its own deploy page
template-docs/index.html and deploy.html are this template’s deploy page. To give your template one, copy the two files into docs/ in its repository, set templateUrl in deploy.html to your repository, and describe it in the template card above the form. Switch on GitHub Pages with source branch main, folder /docs. The page is then at https://<account>.github.io/<repo>/deploy.html, and anyone with a Thinkube cluster can deploy your template from it.