@stackweld/templates 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +57 -0
- package/package.json +17 -11
- package/.turbo/turbo-build.log +0 -4
- package/.turbo/turbo-lint.log +0 -694
- package/.turbo/turbo-test.log +0 -15
- package/.turbo/turbo-typecheck.log +0 -4
- package/dist/__tests__/templates.test.d.ts.map +0 -1
- package/dist/__tests__/templates.test.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/templates/astro-landing.d.ts.map +0 -1
- package/dist/templates/astro-landing.js.map +0 -1
- package/dist/templates/django-react.d.ts.map +0 -1
- package/dist/templates/django-react.js.map +0 -1
- package/dist/templates/django-rest-api.d.ts.map +0 -1
- package/dist/templates/django-rest-api.js.map +0 -1
- package/dist/templates/express-api.d.ts.map +0 -1
- package/dist/templates/express-api.js.map +0 -1
- package/dist/templates/fastapi-react.d.ts.map +0 -1
- package/dist/templates/fastapi-react.js.map +0 -1
- package/dist/templates/go-microservice.d.ts.map +0 -1
- package/dist/templates/go-microservice.js.map +0 -1
- package/dist/templates/hono-microservice.d.ts.map +0 -1
- package/dist/templates/hono-microservice.js.map +0 -1
- package/dist/templates/htmx-django.d.ts.map +0 -1
- package/dist/templates/htmx-django.js.map +0 -1
- package/dist/templates/laravel-app.d.ts.map +0 -1
- package/dist/templates/laravel-app.js.map +0 -1
- package/dist/templates/mern-stack.d.ts.map +0 -1
- package/dist/templates/mern-stack.js.map +0 -1
- package/dist/templates/monorepo-starter.d.ts.map +0 -1
- package/dist/templates/monorepo-starter.js.map +0 -1
- package/dist/templates/nestjs-api.d.ts.map +0 -1
- package/dist/templates/nestjs-api.js.map +0 -1
- package/dist/templates/nuxt3-app.d.ts.map +0 -1
- package/dist/templates/nuxt3-app.js.map +0 -1
- package/dist/templates/python-ai-lab.d.ts.map +0 -1
- package/dist/templates/python-ai-lab.js.map +0 -1
- package/dist/templates/remix-fullstack.d.ts.map +0 -1
- package/dist/templates/remix-fullstack.js.map +0 -1
- package/dist/templates/saas-starter.d.ts.map +0 -1
- package/dist/templates/saas-starter.js.map +0 -1
- package/dist/templates/solidstart-app.d.ts.map +0 -1
- package/dist/templates/solidstart-app.js.map +0 -1
- package/dist/templates/sveltekit-fullstack.d.ts.map +0 -1
- package/dist/templates/sveltekit-fullstack.js.map +0 -1
- package/dist/templates/t3-stack.d.ts.map +0 -1
- package/dist/templates/t3-stack.js.map +0 -1
- package/dist/templates/tauri-desktop.d.ts.map +0 -1
- package/dist/templates/tauri-desktop.js.map +0 -1
- package/src/__tests__/templates.test.ts +0 -98
- package/src/index.ts +0 -97
- package/src/templates/astro-landing.ts +0 -40
- package/src/templates/django-react.ts +0 -127
- package/src/templates/django-rest-api.ts +0 -99
- package/src/templates/express-api.ts +0 -147
- package/src/templates/fastapi-react.ts +0 -122
- package/src/templates/go-microservice.ts +0 -133
- package/src/templates/hono-microservice.ts +0 -81
- package/src/templates/htmx-django.ts +0 -100
- package/src/templates/laravel-app.ts +0 -96
- package/src/templates/mern-stack.ts +0 -126
- package/src/templates/monorepo-starter.ts +0 -138
- package/src/templates/nestjs-api.ts +0 -112
- package/src/templates/nuxt3-app.ts +0 -78
- package/src/templates/python-ai-lab.ts +0 -155
- package/src/templates/remix-fullstack.ts +0 -80
- package/src/templates/saas-starter.ts +0 -131
- package/src/templates/solidstart-app.ts +0 -73
- package/src/templates/sveltekit-fullstack.ts +0 -90
- package/src/templates/t3-stack.ts +0 -94
- package/src/templates/tauri-desktop.ts +0 -57
- package/tsconfig.json +0 -10
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import type { Template } from "@stackweld/core";
|
|
2
|
-
|
|
3
|
-
export const djangoRestApi: Template = {
|
|
4
|
-
id: "django-rest-api",
|
|
5
|
-
name: "Django REST API",
|
|
6
|
-
description:
|
|
7
|
-
"Production-ready REST API with Django, Django REST Framework, PostgreSQL, and Redis",
|
|
8
|
-
technologyIds: ["django", "python", "postgresql", "redis"],
|
|
9
|
-
profile: "standard",
|
|
10
|
-
scaffoldSteps: [
|
|
11
|
-
{
|
|
12
|
-
name: "Create virtual environment",
|
|
13
|
-
command: "python3 -m venv {{projectName}}/.venv",
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: "Create Django project",
|
|
17
|
-
command:
|
|
18
|
-
"{{projectName}}/.venv/bin/pip install django djangorestframework && {{projectName}}/.venv/bin/django-admin startproject config {{projectName}}",
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: "Install additional dependencies",
|
|
22
|
-
command:
|
|
23
|
-
"{{projectName}}/.venv/bin/pip install psycopg2-binary django-redis django-cors-headers python-dotenv",
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
overrides: [
|
|
27
|
-
{
|
|
28
|
-
path: ".env.example",
|
|
29
|
-
content: [
|
|
30
|
-
"DEBUG=True",
|
|
31
|
-
"SECRET_KEY=change-me-in-production",
|
|
32
|
-
"DATABASE_URL=postgresql://postgres:postgres@localhost:5432/{{projectName}}",
|
|
33
|
-
"REDIS_URL=redis://localhost:6379/0",
|
|
34
|
-
"ALLOWED_HOSTS=localhost,127.0.0.1",
|
|
35
|
-
"CORS_ALLOWED_ORIGINS=http://localhost:3000",
|
|
36
|
-
].join("\n"),
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
path: "docker-compose.yml",
|
|
40
|
-
content: [
|
|
41
|
-
"services:",
|
|
42
|
-
" db:",
|
|
43
|
-
" image: postgres:17",
|
|
44
|
-
" restart: unless-stopped",
|
|
45
|
-
" ports:",
|
|
46
|
-
' - "5432:5432"',
|
|
47
|
-
" environment:",
|
|
48
|
-
" POSTGRES_USER: postgres",
|
|
49
|
-
" POSTGRES_PASSWORD: postgres",
|
|
50
|
-
" POSTGRES_DB: {{projectName}}",
|
|
51
|
-
" volumes:",
|
|
52
|
-
" - pgdata:/var/lib/postgresql/data",
|
|
53
|
-
" healthcheck:",
|
|
54
|
-
' test: ["CMD-SHELL", "pg_isready -U postgres"]',
|
|
55
|
-
" interval: 5s",
|
|
56
|
-
" timeout: 5s",
|
|
57
|
-
" retries: 5",
|
|
58
|
-
"",
|
|
59
|
-
" redis:",
|
|
60
|
-
" image: redis:7-alpine",
|
|
61
|
-
" restart: unless-stopped",
|
|
62
|
-
" ports:",
|
|
63
|
-
' - "6379:6379"',
|
|
64
|
-
" healthcheck:",
|
|
65
|
-
' test: ["CMD", "redis-cli", "ping"]',
|
|
66
|
-
" interval: 5s",
|
|
67
|
-
" timeout: 5s",
|
|
68
|
-
" retries: 5",
|
|
69
|
-
"",
|
|
70
|
-
"volumes:",
|
|
71
|
-
" pgdata:",
|
|
72
|
-
].join("\n"),
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
path: "requirements.txt",
|
|
76
|
-
content: [
|
|
77
|
-
"django>=5.1",
|
|
78
|
-
"djangorestframework>=3.15",
|
|
79
|
-
"psycopg2-binary>=2.9",
|
|
80
|
-
"django-redis>=5.4",
|
|
81
|
-
"django-cors-headers>=4.4",
|
|
82
|
-
"python-dotenv>=1.0",
|
|
83
|
-
"gunicorn>=22.0",
|
|
84
|
-
].join("\n"),
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
hooks: [
|
|
88
|
-
{
|
|
89
|
-
timing: "post-scaffold",
|
|
90
|
-
name: "Freeze requirements",
|
|
91
|
-
command: "cd {{projectName}} && .venv/bin/pip freeze > requirements.lock",
|
|
92
|
-
description: "Generate locked requirements file",
|
|
93
|
-
requiresConfirmation: false,
|
|
94
|
-
},
|
|
95
|
-
],
|
|
96
|
-
variables: {
|
|
97
|
-
projectName: "my-django-api",
|
|
98
|
-
},
|
|
99
|
-
};
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import type { Template } from "@stackweld/core";
|
|
2
|
-
|
|
3
|
-
export const expressApi: Template = {
|
|
4
|
-
id: "express-api",
|
|
5
|
-
name: "Express API",
|
|
6
|
-
description:
|
|
7
|
-
"Production-ready Express.js REST API with TypeScript, Prisma, PostgreSQL, Redis, and Docker",
|
|
8
|
-
technologyIds: ["express", "nodejs", "typescript", "prisma", "postgresql", "redis", "docker"],
|
|
9
|
-
profile: "production",
|
|
10
|
-
scaffoldSteps: [
|
|
11
|
-
{
|
|
12
|
-
name: "Create project directory",
|
|
13
|
-
command: "mkdir -p {{projectName}}/src",
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: "Initialize Node.js project",
|
|
17
|
-
command: "cd {{projectName}} && npm init -y",
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: "Install dependencies",
|
|
21
|
-
command:
|
|
22
|
-
"cd {{projectName}} && npm install express cors helmet dotenv ioredis @prisma/client",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: "Install dev dependencies",
|
|
26
|
-
command:
|
|
27
|
-
"cd {{projectName}} && npm install -D typescript @types/node @types/express @types/cors tsx prisma",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: "Initialize TypeScript",
|
|
31
|
-
command:
|
|
32
|
-
"cd {{projectName}} && npx tsc --init --outDir dist --rootDir src --strict --esModuleInterop --resolveJsonModule",
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: "Initialize Prisma",
|
|
36
|
-
command: "cd {{projectName}} && npx prisma init --datasource-provider postgresql",
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
overrides: [
|
|
40
|
-
{
|
|
41
|
-
path: ".env.example",
|
|
42
|
-
content: [
|
|
43
|
-
"PORT=3000",
|
|
44
|
-
"NODE_ENV=development",
|
|
45
|
-
"DATABASE_URL=postgresql://postgres:postgres@localhost:5432/{{projectName}}",
|
|
46
|
-
"REDIS_URL=redis://localhost:6379",
|
|
47
|
-
"CORS_ORIGIN=http://localhost:5173",
|
|
48
|
-
].join("\n"),
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
path: "docker-compose.yml",
|
|
52
|
-
content: [
|
|
53
|
-
"services:",
|
|
54
|
-
" db:",
|
|
55
|
-
" image: postgres:17",
|
|
56
|
-
" restart: unless-stopped",
|
|
57
|
-
" ports:",
|
|
58
|
-
' - "5432:5432"',
|
|
59
|
-
" environment:",
|
|
60
|
-
" POSTGRES_USER: postgres",
|
|
61
|
-
" POSTGRES_PASSWORD: postgres",
|
|
62
|
-
" POSTGRES_DB: {{projectName}}",
|
|
63
|
-
" volumes:",
|
|
64
|
-
" - pgdata:/var/lib/postgresql/data",
|
|
65
|
-
" healthcheck:",
|
|
66
|
-
' test: ["CMD-SHELL", "pg_isready -U postgres"]',
|
|
67
|
-
" interval: 5s",
|
|
68
|
-
" timeout: 5s",
|
|
69
|
-
" retries: 5",
|
|
70
|
-
"",
|
|
71
|
-
" redis:",
|
|
72
|
-
" image: redis:7-alpine",
|
|
73
|
-
" restart: unless-stopped",
|
|
74
|
-
" ports:",
|
|
75
|
-
' - "6379:6379"',
|
|
76
|
-
" healthcheck:",
|
|
77
|
-
' test: ["CMD", "redis-cli", "ping"]',
|
|
78
|
-
" interval: 5s",
|
|
79
|
-
" timeout: 5s",
|
|
80
|
-
" retries: 5",
|
|
81
|
-
"",
|
|
82
|
-
"volumes:",
|
|
83
|
-
" pgdata:",
|
|
84
|
-
].join("\n"),
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
path: "Dockerfile",
|
|
88
|
-
content: [
|
|
89
|
-
"FROM node:22-alpine AS builder",
|
|
90
|
-
"WORKDIR /app",
|
|
91
|
-
"COPY package*.json ./",
|
|
92
|
-
"RUN npm ci",
|
|
93
|
-
"COPY . .",
|
|
94
|
-
"RUN npx prisma generate",
|
|
95
|
-
"RUN npx tsc",
|
|
96
|
-
"",
|
|
97
|
-
"FROM node:22-alpine",
|
|
98
|
-
"WORKDIR /app",
|
|
99
|
-
"COPY package*.json ./",
|
|
100
|
-
"RUN npm ci --omit=dev",
|
|
101
|
-
"COPY --from=builder /app/dist ./dist",
|
|
102
|
-
"COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma",
|
|
103
|
-
"COPY prisma ./prisma",
|
|
104
|
-
"EXPOSE 3000",
|
|
105
|
-
'CMD ["node", "dist/index.js"]',
|
|
106
|
-
].join("\n"),
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
path: "src/index.ts",
|
|
110
|
-
content: [
|
|
111
|
-
'import express from "express";',
|
|
112
|
-
'import cors from "cors";',
|
|
113
|
-
'import helmet from "helmet";',
|
|
114
|
-
'import dotenv from "dotenv";',
|
|
115
|
-
"",
|
|
116
|
-
"dotenv.config();",
|
|
117
|
-
"",
|
|
118
|
-
"const app = express();",
|
|
119
|
-
"const port = process.env.PORT || 3000;",
|
|
120
|
-
"",
|
|
121
|
-
"app.use(helmet());",
|
|
122
|
-
"app.use(cors({ origin: process.env.CORS_ORIGIN }));",
|
|
123
|
-
"app.use(express.json());",
|
|
124
|
-
"",
|
|
125
|
-
'app.get("/health", (_req, res) => {',
|
|
126
|
-
' res.json({ status: "ok" });',
|
|
127
|
-
"});",
|
|
128
|
-
"",
|
|
129
|
-
"app.listen(port, () => {",
|
|
130
|
-
" console.log(`Server running on port ${port}`);",
|
|
131
|
-
"});",
|
|
132
|
-
].join("\n"),
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
|
-
hooks: [
|
|
136
|
-
{
|
|
137
|
-
timing: "post-scaffold",
|
|
138
|
-
name: "Generate Prisma client",
|
|
139
|
-
command: "cd {{projectName}} && npx prisma generate",
|
|
140
|
-
description: "Generate the Prisma client from schema",
|
|
141
|
-
requiresConfirmation: false,
|
|
142
|
-
},
|
|
143
|
-
],
|
|
144
|
-
variables: {
|
|
145
|
-
projectName: "my-express-api",
|
|
146
|
-
},
|
|
147
|
-
};
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import type { Template } from "@stackweld/core";
|
|
2
|
-
|
|
3
|
-
export const fastapiReact: Template = {
|
|
4
|
-
id: "fastapi-react",
|
|
5
|
-
name: "FastAPI + React",
|
|
6
|
-
description: "Full-stack app with FastAPI backend, React frontend, PostgreSQL, and Docker",
|
|
7
|
-
technologyIds: [
|
|
8
|
-
"fastapi",
|
|
9
|
-
"python",
|
|
10
|
-
"react",
|
|
11
|
-
"nodejs",
|
|
12
|
-
"typescript",
|
|
13
|
-
"postgresql",
|
|
14
|
-
"tailwindcss",
|
|
15
|
-
],
|
|
16
|
-
profile: "standard",
|
|
17
|
-
scaffoldSteps: [
|
|
18
|
-
{
|
|
19
|
-
name: "Create project directory",
|
|
20
|
-
command: "mkdir -p {{projectName}}/{backend,frontend}",
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
name: "Setup Python backend",
|
|
24
|
-
command:
|
|
25
|
-
"python3 -m venv {{projectName}}/backend/.venv && {{projectName}}/backend/.venv/bin/pip install fastapi uvicorn sqlalchemy psycopg2-binary alembic python-dotenv",
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: "Create React frontend",
|
|
29
|
-
command: "npx create-vite@latest {{projectName}}/frontend -- --template react-ts",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
name: "Install Tailwind in frontend",
|
|
33
|
-
command: "cd {{projectName}}/frontend && npm install -D tailwindcss @tailwindcss/vite",
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
overrides: [
|
|
37
|
-
{
|
|
38
|
-
path: ".env.example",
|
|
39
|
-
content: [
|
|
40
|
-
"# Backend",
|
|
41
|
-
"DATABASE_URL=postgresql://postgres:postgres@localhost:5432/{{projectName}}",
|
|
42
|
-
"BACKEND_HOST=0.0.0.0",
|
|
43
|
-
"BACKEND_PORT=8000",
|
|
44
|
-
"CORS_ORIGINS=http://localhost:5173",
|
|
45
|
-
"",
|
|
46
|
-
"# Frontend",
|
|
47
|
-
"VITE_API_URL=http://localhost:8000",
|
|
48
|
-
].join("\n"),
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
path: "docker-compose.yml",
|
|
52
|
-
content: [
|
|
53
|
-
"services:",
|
|
54
|
-
" db:",
|
|
55
|
-
" image: postgres:17",
|
|
56
|
-
" restart: unless-stopped",
|
|
57
|
-
" ports:",
|
|
58
|
-
' - "5432:5432"',
|
|
59
|
-
" environment:",
|
|
60
|
-
" POSTGRES_USER: postgres",
|
|
61
|
-
" POSTGRES_PASSWORD: postgres",
|
|
62
|
-
" POSTGRES_DB: {{projectName}}",
|
|
63
|
-
" volumes:",
|
|
64
|
-
" - pgdata:/var/lib/postgresql/data",
|
|
65
|
-
" healthcheck:",
|
|
66
|
-
' test: ["CMD-SHELL", "pg_isready -U postgres"]',
|
|
67
|
-
" interval: 5s",
|
|
68
|
-
" timeout: 5s",
|
|
69
|
-
" retries: 5",
|
|
70
|
-
"",
|
|
71
|
-
"volumes:",
|
|
72
|
-
" pgdata:",
|
|
73
|
-
].join("\n"),
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
path: "backend/requirements.txt",
|
|
77
|
-
content: [
|
|
78
|
-
"fastapi>=0.115",
|
|
79
|
-
"uvicorn[standard]>=0.30",
|
|
80
|
-
"sqlalchemy>=2.0",
|
|
81
|
-
"psycopg2-binary>=2.9",
|
|
82
|
-
"alembic>=1.13",
|
|
83
|
-
"python-dotenv>=1.0",
|
|
84
|
-
].join("\n"),
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
path: "backend/main.py",
|
|
88
|
-
content: [
|
|
89
|
-
"from fastapi import FastAPI",
|
|
90
|
-
"from fastapi.middleware.cors import CORSMiddleware",
|
|
91
|
-
"import os",
|
|
92
|
-
"",
|
|
93
|
-
'app = FastAPI(title="{{projectName}}")',
|
|
94
|
-
"",
|
|
95
|
-
"app.add_middleware(",
|
|
96
|
-
" CORSMiddleware,",
|
|
97
|
-
' allow_origins=os.getenv("CORS_ORIGINS", "http://localhost:5173").split(","),',
|
|
98
|
-
" allow_credentials=True,",
|
|
99
|
-
' allow_methods=["*"],',
|
|
100
|
-
' allow_headers=["*"],',
|
|
101
|
-
")",
|
|
102
|
-
"",
|
|
103
|
-
"",
|
|
104
|
-
'@app.get("/health")',
|
|
105
|
-
"def health():",
|
|
106
|
-
' return {"status": "ok"}',
|
|
107
|
-
].join("\n"),
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
hooks: [
|
|
111
|
-
{
|
|
112
|
-
timing: "post-scaffold",
|
|
113
|
-
name: "Install frontend dependencies",
|
|
114
|
-
command: "cd {{projectName}}/frontend && npm install",
|
|
115
|
-
description: "Install npm dependencies for the React frontend",
|
|
116
|
-
requiresConfirmation: false,
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
|
-
variables: {
|
|
120
|
-
projectName: "my-fullstack-app",
|
|
121
|
-
},
|
|
122
|
-
};
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import type { Template } from "@stackweld/core";
|
|
2
|
-
|
|
3
|
-
export const goMicroservice: Template = {
|
|
4
|
-
id: "go-microservice",
|
|
5
|
-
name: "Go Microservice",
|
|
6
|
-
description: "Lightweight Go microservice with Gin, PostgreSQL, Docker, and health checks",
|
|
7
|
-
technologyIds: ["go", "gin", "postgresql", "redis", "docker"],
|
|
8
|
-
profile: "production",
|
|
9
|
-
scaffoldSteps: [
|
|
10
|
-
{
|
|
11
|
-
name: "Create project directory",
|
|
12
|
-
command: "mkdir -p {{projectName}}/{cmd/server,internal/{handlers,models,middleware},pkg}",
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: "Initialize Go module",
|
|
16
|
-
command: "cd {{projectName}} && go mod init {{moduleName}}",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: "Install dependencies",
|
|
20
|
-
command:
|
|
21
|
-
"cd {{projectName}} && go get github.com/gin-gonic/gin github.com/lib/pq github.com/redis/go-redis/v9 github.com/joho/godotenv",
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
overrides: [
|
|
25
|
-
{
|
|
26
|
-
path: ".env.example",
|
|
27
|
-
content: [
|
|
28
|
-
"PORT=8080",
|
|
29
|
-
"GIN_MODE=debug",
|
|
30
|
-
"DATABASE_URL=postgresql://postgres:postgres@localhost:5432/{{projectName}}",
|
|
31
|
-
"REDIS_URL=redis://localhost:6379/0",
|
|
32
|
-
].join("\n"),
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
path: "docker-compose.yml",
|
|
36
|
-
content: [
|
|
37
|
-
"services:",
|
|
38
|
-
" db:",
|
|
39
|
-
" image: postgres:17",
|
|
40
|
-
" restart: unless-stopped",
|
|
41
|
-
" ports:",
|
|
42
|
-
' - "5432:5432"',
|
|
43
|
-
" environment:",
|
|
44
|
-
" POSTGRES_USER: postgres",
|
|
45
|
-
" POSTGRES_PASSWORD: postgres",
|
|
46
|
-
" POSTGRES_DB: {{projectName}}",
|
|
47
|
-
" volumes:",
|
|
48
|
-
" - pgdata:/var/lib/postgresql/data",
|
|
49
|
-
" healthcheck:",
|
|
50
|
-
' test: ["CMD-SHELL", "pg_isready -U postgres"]',
|
|
51
|
-
" interval: 5s",
|
|
52
|
-
" timeout: 5s",
|
|
53
|
-
" retries: 5",
|
|
54
|
-
"",
|
|
55
|
-
" redis:",
|
|
56
|
-
" image: redis:7-alpine",
|
|
57
|
-
" restart: unless-stopped",
|
|
58
|
-
" ports:",
|
|
59
|
-
' - "6379:6379"',
|
|
60
|
-
" healthcheck:",
|
|
61
|
-
' test: ["CMD", "redis-cli", "ping"]',
|
|
62
|
-
" interval: 5s",
|
|
63
|
-
" timeout: 5s",
|
|
64
|
-
" retries: 5",
|
|
65
|
-
"",
|
|
66
|
-
"volumes:",
|
|
67
|
-
" pgdata:",
|
|
68
|
-
].join("\n"),
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
path: "Dockerfile",
|
|
72
|
-
content: [
|
|
73
|
-
"FROM golang:1.23-alpine AS builder",
|
|
74
|
-
"WORKDIR /app",
|
|
75
|
-
"COPY go.mod go.sum ./",
|
|
76
|
-
"RUN go mod download",
|
|
77
|
-
"COPY . .",
|
|
78
|
-
"RUN CGO_ENABLED=0 go build -o server ./cmd/server",
|
|
79
|
-
"",
|
|
80
|
-
"FROM alpine:3.19",
|
|
81
|
-
"RUN apk --no-cache add ca-certificates",
|
|
82
|
-
"WORKDIR /app",
|
|
83
|
-
"COPY --from=builder /app/server .",
|
|
84
|
-
"EXPOSE 8080",
|
|
85
|
-
'CMD ["./server"]',
|
|
86
|
-
].join("\n"),
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
path: "cmd/server/main.go",
|
|
90
|
-
content: [
|
|
91
|
-
"package main",
|
|
92
|
-
"",
|
|
93
|
-
"import (",
|
|
94
|
-
'\t"log"',
|
|
95
|
-
'\t"os"',
|
|
96
|
-
"",
|
|
97
|
-
'\t"github.com/gin-gonic/gin"',
|
|
98
|
-
'\t"github.com/joho/godotenv"',
|
|
99
|
-
")",
|
|
100
|
-
"",
|
|
101
|
-
"func main() {",
|
|
102
|
-
"\tgodotenv.Load()",
|
|
103
|
-
"",
|
|
104
|
-
'\tport := os.Getenv("PORT")',
|
|
105
|
-
'\tif port == "" {',
|
|
106
|
-
'\t\tport = "8080"',
|
|
107
|
-
"\t}",
|
|
108
|
-
"",
|
|
109
|
-
"\tr := gin.Default()",
|
|
110
|
-
"",
|
|
111
|
-
'\tr.GET("/health", func(c *gin.Context) {',
|
|
112
|
-
'\t\tc.JSON(200, gin.H{"status": "ok"})',
|
|
113
|
-
"\t})",
|
|
114
|
-
"",
|
|
115
|
-
'\tlog.Fatal(r.Run(":" + port))',
|
|
116
|
-
"}",
|
|
117
|
-
].join("\n"),
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
hooks: [
|
|
121
|
-
{
|
|
122
|
-
timing: "post-scaffold",
|
|
123
|
-
name: "Tidy Go modules",
|
|
124
|
-
command: "cd {{projectName}} && go mod tidy",
|
|
125
|
-
description: "Clean up Go module dependencies",
|
|
126
|
-
requiresConfirmation: false,
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
variables: {
|
|
130
|
-
projectName: "my-go-service",
|
|
131
|
-
moduleName: "github.com/user/my-go-service",
|
|
132
|
-
},
|
|
133
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import type { Template } from "@stackweld/core";
|
|
2
|
-
|
|
3
|
-
export const honoMicroservice: Template = {
|
|
4
|
-
id: "hono-microservice",
|
|
5
|
-
name: "Hono Microservice",
|
|
6
|
-
description: "Lightweight Hono microservice with Bun runtime, PostgreSQL, and Docker",
|
|
7
|
-
technologyIds: ["hono", "nodejs", "typescript", "postgresql", "docker"],
|
|
8
|
-
profile: "lightweight",
|
|
9
|
-
scaffoldSteps: [
|
|
10
|
-
{
|
|
11
|
-
name: "Create Hono project",
|
|
12
|
-
command: "npm create hono@latest {{projectName}} -- --template bun",
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: "Install database dependencies",
|
|
16
|
-
command: "cd {{projectName}} && bun add postgres dotenv",
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
overrides: [
|
|
20
|
-
{
|
|
21
|
-
path: ".env.example",
|
|
22
|
-
content: [
|
|
23
|
-
"PORT=3000",
|
|
24
|
-
"DATABASE_URL=postgresql://postgres:postgres@localhost:5432/{{projectName}}",
|
|
25
|
-
].join("\n"),
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
path: "docker-compose.yml",
|
|
29
|
-
content: [
|
|
30
|
-
"services:",
|
|
31
|
-
" db:",
|
|
32
|
-
" image: postgres:17",
|
|
33
|
-
" restart: unless-stopped",
|
|
34
|
-
" ports:",
|
|
35
|
-
' - "5432:5432"',
|
|
36
|
-
" environment:",
|
|
37
|
-
" POSTGRES_USER: postgres",
|
|
38
|
-
" POSTGRES_PASSWORD: postgres",
|
|
39
|
-
" POSTGRES_DB: {{projectName}}",
|
|
40
|
-
" volumes:",
|
|
41
|
-
" - pgdata:/var/lib/postgresql/data",
|
|
42
|
-
" healthcheck:",
|
|
43
|
-
' test: ["CMD-SHELL", "pg_isready -U postgres"]',
|
|
44
|
-
" interval: 5s",
|
|
45
|
-
" timeout: 5s",
|
|
46
|
-
" retries: 5",
|
|
47
|
-
"",
|
|
48
|
-
"volumes:",
|
|
49
|
-
" pgdata:",
|
|
50
|
-
].join("\n"),
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
path: "Dockerfile",
|
|
54
|
-
content: [
|
|
55
|
-
"FROM oven/bun:1 AS builder",
|
|
56
|
-
"WORKDIR /app",
|
|
57
|
-
"COPY package.json bun.lockb ./",
|
|
58
|
-
"RUN bun install --frozen-lockfile",
|
|
59
|
-
"COPY . .",
|
|
60
|
-
"",
|
|
61
|
-
"FROM oven/bun:1-slim",
|
|
62
|
-
"WORKDIR /app",
|
|
63
|
-
"COPY --from=builder /app .",
|
|
64
|
-
"EXPOSE 3000",
|
|
65
|
-
'CMD ["bun", "run", "src/index.ts"]',
|
|
66
|
-
].join("\n"),
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
hooks: [
|
|
70
|
-
{
|
|
71
|
-
timing: "post-scaffold",
|
|
72
|
-
name: "Install dependencies",
|
|
73
|
-
command: "cd {{projectName}} && bun install",
|
|
74
|
-
description: "Install all Bun dependencies",
|
|
75
|
-
requiresConfirmation: false,
|
|
76
|
-
},
|
|
77
|
-
],
|
|
78
|
-
variables: {
|
|
79
|
-
projectName: "my-hono-service",
|
|
80
|
-
},
|
|
81
|
-
};
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import type { Template } from "@stackweld/core";
|
|
2
|
-
|
|
3
|
-
export const htmxDjango: Template = {
|
|
4
|
-
id: "htmx-django",
|
|
5
|
-
name: "HTMX + Django",
|
|
6
|
-
description:
|
|
7
|
-
"Server-rendered Django app with HTMX for interactivity, Tailwind CSS, and PostgreSQL — minimal JavaScript",
|
|
8
|
-
technologyIds: ["htmx", "django", "python", "postgresql", "tailwindcss"],
|
|
9
|
-
profile: "lightweight",
|
|
10
|
-
scaffoldSteps: [
|
|
11
|
-
{
|
|
12
|
-
name: "Create project directory",
|
|
13
|
-
command: "mkdir -p {{projectName}}",
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: "Setup Python virtual environment",
|
|
17
|
-
command: "python3 -m venv {{projectName}}/.venv",
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: "Install Python dependencies",
|
|
21
|
-
command:
|
|
22
|
-
"{{projectName}}/.venv/bin/pip install django psycopg2-binary django-htmx python-dotenv gunicorn whitenoise",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: "Create Django project",
|
|
26
|
-
command: "{{projectName}}/.venv/bin/django-admin startproject config {{projectName}}",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: "Install Tailwind standalone CLI",
|
|
30
|
-
command:
|
|
31
|
-
"cd {{projectName}} && mkdir -p static/css && curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 && chmod +x tailwindcss-linux-x64",
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
overrides: [
|
|
35
|
-
{
|
|
36
|
-
path: ".env.example",
|
|
37
|
-
content: [
|
|
38
|
-
"DEBUG=True",
|
|
39
|
-
"SECRET_KEY=change-me-in-production",
|
|
40
|
-
"DATABASE_URL=postgresql://postgres:postgres@localhost:5432/{{projectName}}",
|
|
41
|
-
"ALLOWED_HOSTS=localhost,127.0.0.1",
|
|
42
|
-
].join("\n"),
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
path: "docker-compose.yml",
|
|
46
|
-
content: [
|
|
47
|
-
"services:",
|
|
48
|
-
" db:",
|
|
49
|
-
" image: postgres:17",
|
|
50
|
-
" restart: unless-stopped",
|
|
51
|
-
" ports:",
|
|
52
|
-
' - "5432:5432"',
|
|
53
|
-
" environment:",
|
|
54
|
-
" POSTGRES_USER: postgres",
|
|
55
|
-
" POSTGRES_PASSWORD: postgres",
|
|
56
|
-
" POSTGRES_DB: {{projectName}}",
|
|
57
|
-
" volumes:",
|
|
58
|
-
" - pgdata:/var/lib/postgresql/data",
|
|
59
|
-
" healthcheck:",
|
|
60
|
-
' test: ["CMD-SHELL", "pg_isready -U postgres"]',
|
|
61
|
-
" interval: 5s",
|
|
62
|
-
" timeout: 5s",
|
|
63
|
-
" retries: 5",
|
|
64
|
-
"",
|
|
65
|
-
"volumes:",
|
|
66
|
-
" pgdata:",
|
|
67
|
-
].join("\n"),
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
path: "requirements.txt",
|
|
71
|
-
content: [
|
|
72
|
-
"django>=5.1",
|
|
73
|
-
"psycopg2-binary>=2.9",
|
|
74
|
-
"django-htmx>=1.19",
|
|
75
|
-
"python-dotenv>=1.0",
|
|
76
|
-
"gunicorn>=22.0",
|
|
77
|
-
"whitenoise>=6.7",
|
|
78
|
-
].join("\n"),
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
hooks: [
|
|
82
|
-
{
|
|
83
|
-
timing: "post-scaffold",
|
|
84
|
-
name: "Run initial migrations",
|
|
85
|
-
command: "cd {{projectName}} && .venv/bin/python manage.py migrate",
|
|
86
|
-
description: "Run Django migrations (requires running PostgreSQL)",
|
|
87
|
-
requiresConfirmation: true,
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
timing: "post-scaffold",
|
|
91
|
-
name: "Freeze requirements",
|
|
92
|
-
command: "cd {{projectName}} && .venv/bin/pip freeze > requirements.lock",
|
|
93
|
-
description: "Generate locked requirements file",
|
|
94
|
-
requiresConfirmation: false,
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
variables: {
|
|
98
|
-
projectName: "my-htmx-app",
|
|
99
|
-
},
|
|
100
|
-
};
|