feat: turbostarter boilerplate

Production-ready Next.js boilerplate with:
- Runtime env validation (fail-fast on missing vars)
- Feature-gated config (S3, Stripe, email, OAuth)
- Docker + Coolify deployment pipeline
- PostgreSQL + pgvector, MinIO S3, Better Auth
- TypeScript strict mode (no ignoreBuildErrors)
- i18n (en/es), AI modules, billing, monitoring

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-02-02 17:29:12 +00:00
commit 3527e732d4
1618 changed files with 338230 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
import { logger } from "@turbostarter/shared/logger";
import { env } from "./env";
import type { AnalyticsProviderServerStrategy } from "@turbostarter/analytics";
export const { track } = {
track: (event, data) => {
const hostname =
typeof data?.hostname === "string" ? data.hostname : undefined;
const language =
typeof data?.language === "string" ? data.language : undefined;
const referrer =
typeof data?.referrer === "string" ? data.referrer : undefined;
const screen = typeof data?.screen === "string" ? data.screen : undefined;
const title = typeof data?.title === "string" ? data.title : undefined;
const url = typeof data?.url === "string" ? data.url : "app://server-side";
void fetch(`${env.UMAMI_API_HOST}/api/send`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-umami-api-key": env.UMAMI_API_KEY ?? "",
},
body: JSON.stringify({
type: "event",
payload: {
website: env.NEXT_PUBLIC_UMAMI_WEBSITE_ID,
name: event,
url: url,
...(hostname && { hostname }),
...(language && { language }),
...(referrer && { referrer }),
...(screen && { screen }),
...(title && { title }),
data,
},
}),
}).then((res) => {
if (!res.ok) {
logger.error("Failed to post event to Umami: ", res);
}
});
},
} satisfies AnalyticsProviderServerStrategy;