Initial monorepo scaffold
Turborepo + pnpm monorepo for k3s homelab cluster on Intel NUCs. - Apps: Next.js web frontend, Express API (TypeScript, Dockerfiles, k8s manifests) - Packages: shared UI, ESLint config, TypeScript config, Drizzle DB schemas - Infra/Ansible: bare-metal provisioning with roles for common, k3s-server, k3s-agent, hardening - Infra/Kubernetes: ArgoCD GitOps (app-of-apps + ApplicationSets), platform components (cert-manager, Traefik, CloudNativePG, Valkey, Longhorn, Sealed Secrets), namespaces - Observability: kube-prometheus-stack, Loki, Promtail as ArgoCD Applications - CI/CD: GitHub Actions for PR builds, preview deploys, production deploys - DX: Taskfile, utility scripts, copier templates, Ubiquiti network docs
This commit is contained in:
12
templates/nextjs-app/copier.yaml
Normal file
12
templates/nextjs-app/copier.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
_min_copier_version: "9.0.0"
|
||||
app_name:
|
||||
type: str
|
||||
help: "Application name (kebab-case)"
|
||||
port:
|
||||
type: int
|
||||
default: 3000
|
||||
help: "Port number"
|
||||
title:
|
||||
type: str
|
||||
default: "My App"
|
||||
help: "Page title"
|
||||
23
templates/nextjs-app/{{app_name}}/package.json.jinja
Normal file
23
templates/nextjs-app/{{app_name}}/package.json.jinja
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@homelab/{{ app_name }}",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --port {{ port }}",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
"test": "echo \"no tests yet\""
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "^15.1.0",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.10.0",
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-dom": "^19.0.0",
|
||||
"typescript": "^5.7.0"
|
||||
}
|
||||
}
|
||||
7
templates/nextjs-app/{{app_name}}/src/app/page.tsx.jinja
Normal file
7
templates/nextjs-app/{{app_name}}/src/app/page.tsx.jinja
Normal file
@@ -0,0 +1,7 @@
|
||||
export default function Home() {
|
||||
return (
|
||||
<main style={{ padding: "2rem", fontFamily: "system-ui, sans-serif" }}>
|
||||
<h1>{{ title }}</h1>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
12
templates/node-api/copier.yaml
Normal file
12
templates/node-api/copier.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
_min_copier_version: "9.0.0"
|
||||
app_name:
|
||||
type: str
|
||||
help: "Application name (kebab-case)"
|
||||
port:
|
||||
type: int
|
||||
default: 4000
|
||||
help: "Port number"
|
||||
description:
|
||||
type: str
|
||||
default: "A Node.js API service"
|
||||
help: "Short description"
|
||||
24
templates/node-api/{{app_name}}/package.json.jinja
Normal file
24
templates/node-api/{{app_name}}/package.json.jinja
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@homelab/{{ app_name }}",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "tsx watch src/index.ts",
|
||||
"build": "tsup src/index.ts --format cjs --outDir dist",
|
||||
"start": "node dist/index.js",
|
||||
"lint": "tsc --noEmit",
|
||||
"test": "echo \"no tests yet\""
|
||||
},
|
||||
"dependencies": {
|
||||
"express": "^4.21.0",
|
||||
"cors": "^2.8.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^5.0.0",
|
||||
"@types/cors": "^2.8.17",
|
||||
"@types/node": "^22.10.0",
|
||||
"tsup": "^8.3.0",
|
||||
"tsx": "^4.19.0",
|
||||
"typescript": "^5.7.0"
|
||||
}
|
||||
}
|
||||
20
templates/node-api/{{app_name}}/src/index.ts.jinja
Normal file
20
templates/node-api/{{app_name}}/src/index.ts.jinja
Normal file
@@ -0,0 +1,20 @@
|
||||
import express from "express";
|
||||
import cors from "cors";
|
||||
|
||||
const app = express();
|
||||
const port = process.env.PORT || {{ port }};
|
||||
|
||||
app.use(cors());
|
||||
app.use(express.json());
|
||||
|
||||
app.get("/health", (_req, res) => {
|
||||
res.json({ status: "ok", timestamp: new Date().toISOString() });
|
||||
});
|
||||
|
||||
app.get("/api", (_req, res) => {
|
||||
res.json({ message: "{{ description }}", version: "0.1.0" });
|
||||
});
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`{{ app_name }} running on port ${port}`);
|
||||
});
|
||||
Reference in New Issue
Block a user