create-launchrail 0.0.0-stage → 0.3.1
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/README.md +39 -2
- package/THIRD_PARTY_LICENSES +43 -0
- package/bin/create-launchrail.mjs +75 -0
- package/bin/project-directory.mjs +7 -0
- package/bin/scaffold.mjs +217 -0
- package/bin/tools.mjs +62 -0
- package/bin/versions.mjs +118 -0
- package/package.json +23 -4
- package/presets/headless/web/ui/button.tsx +16 -0
- package/presets/headless/web/ui/card.tsx +25 -0
- package/template/AGENTS.md +3 -0
- package/template/README.md +3 -0
- package/template/THIRD_PARTY_LICENSES +43 -0
- package/template/apps/mobile/AGENTS.md +11 -0
- package/template/apps/mobile/App.tsx +511 -0
- package/template/apps/mobile/app.json +14 -0
- package/template/apps/mobile/components.json +22 -0
- package/template/apps/mobile/global.css +54 -0
- package/template/apps/mobile/index.ts +4 -0
- package/template/apps/mobile/metro.config.js +7 -0
- package/template/apps/mobile/package.json +47 -0
- package/template/apps/mobile/src/auth.ts +19 -0
- package/template/apps/mobile/src/components/native-controls.tsx +12 -0
- package/template/apps/mobile/src/components/ui/button.tsx +108 -0
- package/template/apps/mobile/src/components/ui/card.tsx +66 -0
- package/template/apps/mobile/src/components/ui/input.tsx +33 -0
- package/template/apps/mobile/src/components/ui/text.tsx +89 -0
- package/template/apps/mobile/src/css.d.ts +1 -0
- package/template/apps/mobile/src/lib/utils.ts +6 -0
- package/template/apps/mobile/src/query.tsx +16 -0
- package/template/apps/mobile/src/server-url.ts +20 -0
- package/template/apps/mobile/src/trpc.tsx +47 -0
- package/template/apps/mobile/src/uniwind-types.d.ts +7 -0
- package/template/apps/mobile/tsconfig.json +21 -0
- package/template/apps/web/components.json +15 -0
- package/template/apps/web/drizzle/0000_auth.sql +53 -0
- package/template/apps/web/drizzle/meta/0000_snapshot.json +374 -0
- package/template/apps/web/drizzle/meta/_journal.json +13 -0
- package/template/apps/web/drizzle.config.ts +11 -0
- package/template/apps/web/next.config.ts +11 -0
- package/template/apps/web/package.json +48 -0
- package/template/apps/web/postcss.config.mjs +3 -0
- package/template/apps/web/src/app/api/auth/[...all]/route.ts +7 -0
- package/template/apps/web/src/app/api/trpc/[trpc]/route.ts +53 -0
- package/template/apps/web/src/app/globals.css +250 -0
- package/template/apps/web/src/app/layout.tsx +31 -0
- package/template/apps/web/src/app/page.tsx +35 -0
- package/template/apps/web/src/app/starter-demo.tsx +258 -0
- package/template/apps/web/src/components/ui/button.tsx +57 -0
- package/template/apps/web/src/components/ui/card.tsx +102 -0
- package/template/apps/web/src/lib/auth-client.ts +5 -0
- package/template/apps/web/src/lib/query.tsx +23 -0
- package/template/apps/web/src/lib/trpc.tsx +29 -0
- package/template/apps/web/src/lib/utils.ts +6 -0
- package/template/apps/web/src/server/auth.ts +44 -0
- package/template/apps/web/src/server/db.ts +38 -0
- package/template/apps/web/src/server/schema.ts +87 -0
- package/template/apps/web/tsconfig.json +31 -0
- package/template/compose.yaml +18 -0
- package/template/gitignore.template +32 -0
- package/template/package.json +22 -0
- package/template/packages/api/package.json +21 -0
- package/template/packages/api/src/hello.ts +5 -0
- package/template/packages/api/src/index.ts +45 -0
- package/template/packages/api/tsconfig.json +4 -0
- package/template/pnpm-workspace.yaml +5 -0
- package/template/theme/tokens.css +40 -0
- package/template/tsconfig.base.json +14 -0
- package/template/turbo.json +12 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cn } from "@/lib/utils"
|
|
3
|
+
|
|
4
|
+
function Card({
|
|
5
|
+
className,
|
|
6
|
+
size = "default",
|
|
7
|
+
...props
|
|
8
|
+
}: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
|
|
9
|
+
return (
|
|
10
|
+
<div
|
|
11
|
+
data-slot="card"
|
|
12
|
+
data-size={size}
|
|
13
|
+
className={cn(
|
|
14
|
+
"group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
|
|
15
|
+
className
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
23
|
+
return (
|
|
24
|
+
<div
|
|
25
|
+
data-slot="card-header"
|
|
26
|
+
className={cn(
|
|
27
|
+
"group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",
|
|
28
|
+
className
|
|
29
|
+
)}
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
36
|
+
return (
|
|
37
|
+
<div
|
|
38
|
+
data-slot="card-title"
|
|
39
|
+
className={cn(
|
|
40
|
+
"font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",
|
|
41
|
+
className
|
|
42
|
+
)}
|
|
43
|
+
{...props}
|
|
44
|
+
/>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
49
|
+
return (
|
|
50
|
+
<div
|
|
51
|
+
data-slot="card-description"
|
|
52
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
53
|
+
{...props}
|
|
54
|
+
/>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
59
|
+
return (
|
|
60
|
+
<div
|
|
61
|
+
data-slot="card-action"
|
|
62
|
+
className={cn(
|
|
63
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
64
|
+
className
|
|
65
|
+
)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
72
|
+
return (
|
|
73
|
+
<div
|
|
74
|
+
data-slot="card-content"
|
|
75
|
+
className={cn("px-(--card-spacing)", className)}
|
|
76
|
+
{...props}
|
|
77
|
+
/>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
82
|
+
return (
|
|
83
|
+
<div
|
|
84
|
+
data-slot="card-footer"
|
|
85
|
+
className={cn(
|
|
86
|
+
"flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",
|
|
87
|
+
className
|
|
88
|
+
)}
|
|
89
|
+
{...props}
|
|
90
|
+
/>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export {
|
|
95
|
+
Card,
|
|
96
|
+
CardHeader,
|
|
97
|
+
CardFooter,
|
|
98
|
+
CardTitle,
|
|
99
|
+
CardAction,
|
|
100
|
+
CardDescription,
|
|
101
|
+
CardContent,
|
|
102
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
4
|
+
import { QueryClient, QueryClientProvider, useQuery } from "@tanstack/react-query";
|
|
5
|
+
import { type ReactNode, useState } from "react";
|
|
6
|
+
|
|
7
|
+
export function QueryProvider({ children }: { children: ReactNode }) {
|
|
8
|
+
const [client] = useState(() => new QueryClient());
|
|
9
|
+
return <QueryClientProvider client={client}>{children}</QueryClientProvider>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function QueryDemo() {
|
|
13
|
+
const query = useQuery({
|
|
14
|
+
queryKey: ["starter"],
|
|
15
|
+
queryFn: async () => "TanStack Query is ready.",
|
|
16
|
+
});
|
|
17
|
+
return (
|
|
18
|
+
<Card>
|
|
19
|
+
<CardHeader><CardTitle>Client queries</CardTitle></CardHeader>
|
|
20
|
+
<CardContent><p role="status">{query.data ?? "Loading…"}</p></CardContent>
|
|
21
|
+
</Card>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { AppRouter } from "@launchrail/api";
|
|
4
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
5
|
+
import { createTRPCClient, httpBatchLink } from "@trpc/client";
|
|
6
|
+
import { createTRPCContext } from "@trpc/tanstack-react-query";
|
|
7
|
+
import { type ReactNode, useState } from "react";
|
|
8
|
+
import superjson from "superjson";
|
|
9
|
+
|
|
10
|
+
const { TRPCProvider, useTRPC } = createTRPCContext<AppRouter>();
|
|
11
|
+
|
|
12
|
+
export function Providers({ children }: { children: ReactNode }) {
|
|
13
|
+
const [queryClient] = useState(() => new QueryClient());
|
|
14
|
+
const [trpcClient] = useState(() =>
|
|
15
|
+
createTRPCClient<AppRouter>({
|
|
16
|
+
links: [httpBatchLink({ url: "/api/trpc", transformer: superjson })],
|
|
17
|
+
}),
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<QueryClientProvider client={queryClient}>
|
|
22
|
+
<TRPCProvider queryClient={queryClient} trpcClient={trpcClient}>
|
|
23
|
+
{children}
|
|
24
|
+
</TRPCProvider>
|
|
25
|
+
</QueryClientProvider>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { useTRPC };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
|
|
3
|
+
/* @if expo */
|
|
4
|
+
import { expo } from "@better-auth/expo";
|
|
5
|
+
/* @end */
|
|
6
|
+
import { betterAuth } from "better-auth";
|
|
7
|
+
import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
|
8
|
+
|
|
9
|
+
import { getDb } from "./db";
|
|
10
|
+
import * as schema from "./schema";
|
|
11
|
+
|
|
12
|
+
let auth: ReturnType<typeof initAuth>;
|
|
13
|
+
|
|
14
|
+
function initAuth() {
|
|
15
|
+
const { LAUNCHRAIL_APP_SCHEME = "launchrail", BETTER_AUTH_SECRET, BETTER_AUTH_URL } = process.env;
|
|
16
|
+
if (
|
|
17
|
+
!BETTER_AUTH_SECRET ||
|
|
18
|
+
BETTER_AUTH_SECRET.length < 32 ||
|
|
19
|
+
BETTER_AUTH_SECRET === "replace-with-generated-secret"
|
|
20
|
+
) {
|
|
21
|
+
throw new Error(
|
|
22
|
+
"Set BETTER_AUTH_SECRET to a random value of at least 32 characters.",
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
if (!BETTER_AUTH_URL) {
|
|
26
|
+
throw new Error("Set BETTER_AUTH_URL to the server's public origin.");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return betterAuth({
|
|
30
|
+
baseURL: BETTER_AUTH_URL,
|
|
31
|
+
secret: BETTER_AUTH_SECRET,
|
|
32
|
+
database: drizzleAdapter(getDb(), { provider: "pg", schema }),
|
|
33
|
+
emailAndPassword: { enabled: true },
|
|
34
|
+
/* @if expo */
|
|
35
|
+
trustedOrigins: [`${LAUNCHRAIL_APP_SCHEME}://`],
|
|
36
|
+
plugins: [expo()],
|
|
37
|
+
/* @end */
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function getAuth() {
|
|
42
|
+
auth ??= initAuth();
|
|
43
|
+
return auth;
|
|
44
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
|
|
3
|
+
/* @if drizzle */
|
|
4
|
+
import { drizzle } from "drizzle-orm/postgres-js";
|
|
5
|
+
/* @end */
|
|
6
|
+
import postgres from "postgres";
|
|
7
|
+
|
|
8
|
+
/* @if drizzle */
|
|
9
|
+
import * as schema from "./schema";
|
|
10
|
+
/* @end */
|
|
11
|
+
|
|
12
|
+
let database: ReturnType<typeof connect>;
|
|
13
|
+
|
|
14
|
+
function connect() {
|
|
15
|
+
const databaseUrl = process.env.DATABASE_URL;
|
|
16
|
+
if (!databaseUrl) {
|
|
17
|
+
throw new Error("Set DATABASE_URL in apps/web/.env.local.");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const globalForDb = globalThis as typeof globalThis & {
|
|
21
|
+
launchrailPostgres?: ReturnType<typeof postgres>;
|
|
22
|
+
};
|
|
23
|
+
const connection = globalForDb.launchrailPostgres ?? postgres(databaseUrl);
|
|
24
|
+
if (process.env.NODE_ENV === "development") {
|
|
25
|
+
globalForDb.launchrailPostgres = connection;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* @if drizzle */
|
|
29
|
+
return drizzle(connection, { schema });
|
|
30
|
+
/* @else */
|
|
31
|
+
return connection;
|
|
32
|
+
/* @end */
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function getDb() {
|
|
36
|
+
database ??= connect();
|
|
37
|
+
return database;
|
|
38
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { relations } from "drizzle-orm";
|
|
2
|
+
import { boolean, index, pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
|
3
|
+
|
|
4
|
+
export const user = pgTable("user", {
|
|
5
|
+
id: text("id").primaryKey(),
|
|
6
|
+
name: text("name").notNull(),
|
|
7
|
+
email: text("email").notNull().unique(),
|
|
8
|
+
emailVerified: boolean("email_verified").default(false).notNull(),
|
|
9
|
+
image: text("image"),
|
|
10
|
+
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
11
|
+
updatedAt: timestamp("updated_at")
|
|
12
|
+
.defaultNow()
|
|
13
|
+
.$onUpdate(() => new Date())
|
|
14
|
+
.notNull(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const session = pgTable(
|
|
18
|
+
"session",
|
|
19
|
+
{
|
|
20
|
+
id: text("id").primaryKey(),
|
|
21
|
+
expiresAt: timestamp("expires_at").notNull(),
|
|
22
|
+
token: text("token").notNull().unique(),
|
|
23
|
+
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
24
|
+
updatedAt: timestamp("updated_at")
|
|
25
|
+
.$onUpdate(() => new Date())
|
|
26
|
+
.notNull(),
|
|
27
|
+
ipAddress: text("ip_address"),
|
|
28
|
+
userAgent: text("user_agent"),
|
|
29
|
+
userId: text("user_id")
|
|
30
|
+
.notNull()
|
|
31
|
+
.references(() => user.id, { onDelete: "cascade" }),
|
|
32
|
+
},
|
|
33
|
+
(table) => [index("session_user_id_idx").on(table.userId)],
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export const account = pgTable(
|
|
37
|
+
"account",
|
|
38
|
+
{
|
|
39
|
+
id: text("id").primaryKey(),
|
|
40
|
+
accountId: text("account_id").notNull(),
|
|
41
|
+
providerId: text("provider_id").notNull(),
|
|
42
|
+
userId: text("user_id")
|
|
43
|
+
.notNull()
|
|
44
|
+
.references(() => user.id, { onDelete: "cascade" }),
|
|
45
|
+
accessToken: text("access_token"),
|
|
46
|
+
refreshToken: text("refresh_token"),
|
|
47
|
+
idToken: text("id_token"),
|
|
48
|
+
accessTokenExpiresAt: timestamp("access_token_expires_at"),
|
|
49
|
+
refreshTokenExpiresAt: timestamp("refresh_token_expires_at"),
|
|
50
|
+
scope: text("scope"),
|
|
51
|
+
password: text("password"),
|
|
52
|
+
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
53
|
+
updatedAt: timestamp("updated_at")
|
|
54
|
+
.$onUpdate(() => new Date())
|
|
55
|
+
.notNull(),
|
|
56
|
+
},
|
|
57
|
+
(table) => [index("account_user_id_idx").on(table.userId)],
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
export const verification = pgTable(
|
|
61
|
+
"verification",
|
|
62
|
+
{
|
|
63
|
+
id: text("id").primaryKey(),
|
|
64
|
+
identifier: text("identifier").notNull(),
|
|
65
|
+
value: text("value").notNull(),
|
|
66
|
+
expiresAt: timestamp("expires_at").notNull(),
|
|
67
|
+
createdAt: timestamp("created_at").defaultNow().notNull(),
|
|
68
|
+
updatedAt: timestamp("updated_at")
|
|
69
|
+
.defaultNow()
|
|
70
|
+
.$onUpdate(() => new Date())
|
|
71
|
+
.notNull(),
|
|
72
|
+
},
|
|
73
|
+
(table) => [index("verification_identifier_idx").on(table.identifier)],
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
export const userRelations = relations(user, ({ many }) => ({
|
|
77
|
+
accounts: many(account),
|
|
78
|
+
sessions: many(session),
|
|
79
|
+
}));
|
|
80
|
+
|
|
81
|
+
export const accountRelations = relations(account, ({ one }) => ({
|
|
82
|
+
user: one(user, { fields: [account.userId], references: [user.id] }),
|
|
83
|
+
}));
|
|
84
|
+
|
|
85
|
+
export const sessionRelations = relations(session, ({ one }) => ({
|
|
86
|
+
user: one(user, { fields: [session.userId], references: [user.id] }),
|
|
87
|
+
}));
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"jsx": "react-jsx",
|
|
5
|
+
"plugins": [
|
|
6
|
+
{
|
|
7
|
+
"name": "next"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"types": [
|
|
11
|
+
"node"
|
|
12
|
+
],
|
|
13
|
+
"paths": {
|
|
14
|
+
"@/*": [
|
|
15
|
+
"./src/*"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"include": [
|
|
20
|
+
"next-env.d.ts",
|
|
21
|
+
"src/**/*.ts",
|
|
22
|
+
"src/**/*.tsx",
|
|
23
|
+
"next.config.ts",
|
|
24
|
+
"drizzle.config.ts",
|
|
25
|
+
".next/types/**/*.ts",
|
|
26
|
+
".next/dev/types/**/*.ts"
|
|
27
|
+
],
|
|
28
|
+
"exclude": [
|
|
29
|
+
"node_modules"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
services:
|
|
2
|
+
db:
|
|
3
|
+
image: postgres:alpine
|
|
4
|
+
environment:
|
|
5
|
+
POSTGRES_DB: launchrail
|
|
6
|
+
POSTGRES_USER: launchrail
|
|
7
|
+
POSTGRES_PASSWORD: launchrail-local-dev
|
|
8
|
+
ports:
|
|
9
|
+
- "127.0.0.1:${LAUNCHRAIL_DB_PORT:-55432}:5432"
|
|
10
|
+
healthcheck:
|
|
11
|
+
test: ["CMD-SHELL", "pg_isready -U launchrail -d launchrail"]
|
|
12
|
+
interval: 2s
|
|
13
|
+
timeout: 3s
|
|
14
|
+
retries: 15
|
|
15
|
+
volumes:
|
|
16
|
+
- launchrail-postgres:/var/lib/postgresql
|
|
17
|
+
volumes:
|
|
18
|
+
launchrail-postgres:
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
node_modules/
|
|
2
|
+
.next/
|
|
3
|
+
.expo/
|
|
4
|
+
.turbo/
|
|
5
|
+
dist/
|
|
6
|
+
coverage/
|
|
7
|
+
*.tsbuildinfo
|
|
8
|
+
*.log
|
|
9
|
+
.env
|
|
10
|
+
.env.*
|
|
11
|
+
!.env.example
|
|
12
|
+
.DS_Store
|
|
13
|
+
.pnpm-store/
|
|
14
|
+
|
|
15
|
+
# Local native build files and signing credentials
|
|
16
|
+
/apps/mobile/android/**/build/
|
|
17
|
+
/apps/mobile/android/**/.cxx/
|
|
18
|
+
/apps/mobile/android/.gradle/
|
|
19
|
+
/apps/mobile/android/.kotlin/
|
|
20
|
+
/apps/mobile/android/local.properties
|
|
21
|
+
/apps/mobile/ios/Pods/
|
|
22
|
+
/apps/mobile/ios/build/
|
|
23
|
+
/apps/mobile/ios/DerivedData/
|
|
24
|
+
/apps/mobile/ios/.xcode.env.local
|
|
25
|
+
xcuserdata/
|
|
26
|
+
*.xcuserstate
|
|
27
|
+
*.jks
|
|
28
|
+
*.keystore
|
|
29
|
+
!/apps/mobile/android/app/debug.keystore
|
|
30
|
+
*.mobileprovision
|
|
31
|
+
*.p8
|
|
32
|
+
*.p12
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@launchrail/starter",
|
|
3
|
+
"private": true,
|
|
4
|
+
"packageManager": "pnpm@12.23.0",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=24"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"dev": "turbo run dev",
|
|
10
|
+
"dev:web": "pnpm --filter @launchrail/web dev",
|
|
11
|
+
"dev:mobile": "pnpm --filter @launchrail/mobile dev",
|
|
12
|
+
"build": "turbo run build",
|
|
13
|
+
"typecheck": "turbo run typecheck",
|
|
14
|
+
"db:up": "docker compose up -d --wait db",
|
|
15
|
+
"db:down": "docker compose stop db",
|
|
16
|
+
"db:migrate": "pnpm --filter @launchrail/web db:migrate"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"turbo": "2.11.13",
|
|
20
|
+
"typescript": "7.0.2"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@launchrail/api",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./src/index.ts",
|
|
8
|
+
"./hello": "./src/hello.ts"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"typecheck": "tsc --noEmit"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@trpc/server": "11.31.6",
|
|
15
|
+
"superjson": "2.2.7",
|
|
16
|
+
"zod": "4.6.7"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"typescript": "7.0.2"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { helloInput } from "./hello";
|
|
2
|
+
import { initTRPC } from "@trpc/server";
|
|
3
|
+
/* @if auth */
|
|
4
|
+
import { TRPCError } from "@trpc/server";
|
|
5
|
+
/* @end */
|
|
6
|
+
import superjson from "superjson";
|
|
7
|
+
|
|
8
|
+
/* @if auth */
|
|
9
|
+
type Account = { id: string; name: string; email: string };
|
|
10
|
+
/* @end */
|
|
11
|
+
|
|
12
|
+
export type RequestContext = {
|
|
13
|
+
/* @if auth */
|
|
14
|
+
getAccount: () => Promise<Account | null>;
|
|
15
|
+
/* @end */
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const t = initTRPC.context<RequestContext>().create({
|
|
19
|
+
transformer: superjson,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
/* @if auth */
|
|
23
|
+
const protectedProcedure = t.procedure.use(async ({ ctx, next }) => {
|
|
24
|
+
const account = await ctx.getAccount();
|
|
25
|
+
if (!account) {
|
|
26
|
+
throw new TRPCError({ code: "UNAUTHORIZED" });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return next({ ctx: { account } });
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
/* @end */
|
|
33
|
+
|
|
34
|
+
export const appRouter = t.router({
|
|
35
|
+
hello: t.procedure.input(helloInput).query(({ input }) => ({
|
|
36
|
+
greeting: `Hello, ${input.name}!`,
|
|
37
|
+
})),
|
|
38
|
+
/* @if auth */
|
|
39
|
+
account: t.router({
|
|
40
|
+
me: protectedProcedure.query(({ ctx }) => ctx.account),
|
|
41
|
+
}),
|
|
42
|
+
/* @end */
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export type AppRouter = typeof appRouter;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* Colors and corner radius used by the web and mobile kits. */
|
|
2
|
+
@theme static {
|
|
3
|
+
--radius-launchrail: 0.625rem;
|
|
4
|
+
--color-brand-light-background: oklch(1 0 0);
|
|
5
|
+
--color-brand-light-foreground: oklch(0.145 0 0);
|
|
6
|
+
--color-brand-light-card: oklch(1 0 0);
|
|
7
|
+
--color-brand-light-card-foreground: oklch(0.145 0 0);
|
|
8
|
+
--color-brand-light-popover: oklch(1 0 0);
|
|
9
|
+
--color-brand-light-popover-foreground: oklch(0.145 0 0);
|
|
10
|
+
--color-brand-light-primary: oklch(0.205 0 0);
|
|
11
|
+
--color-brand-light-primary-foreground: oklch(0.985 0 0);
|
|
12
|
+
--color-brand-light-secondary: oklch(0.97 0 0);
|
|
13
|
+
--color-brand-light-secondary-foreground: oklch(0.205 0 0);
|
|
14
|
+
--color-brand-light-muted: oklch(0.97 0 0);
|
|
15
|
+
--color-brand-light-muted-foreground: oklch(0.556 0 0);
|
|
16
|
+
--color-brand-light-accent: oklch(0.97 0 0);
|
|
17
|
+
--color-brand-light-accent-foreground: oklch(0.205 0 0);
|
|
18
|
+
--color-brand-light-destructive: oklch(0.577 0.245 27.325);
|
|
19
|
+
--color-brand-light-border: oklch(0.922 0 0);
|
|
20
|
+
--color-brand-light-input: oklch(0.922 0 0);
|
|
21
|
+
--color-brand-light-ring: oklch(0.708 0 0);
|
|
22
|
+
--color-brand-dark-background: oklch(0.145 0 0);
|
|
23
|
+
--color-brand-dark-foreground: oklch(0.985 0 0);
|
|
24
|
+
--color-brand-dark-card: oklch(0.205 0 0);
|
|
25
|
+
--color-brand-dark-card-foreground: oklch(0.985 0 0);
|
|
26
|
+
--color-brand-dark-popover: oklch(0.205 0 0);
|
|
27
|
+
--color-brand-dark-popover-foreground: oklch(0.985 0 0);
|
|
28
|
+
--color-brand-dark-primary: oklch(0.922 0 0);
|
|
29
|
+
--color-brand-dark-primary-foreground: oklch(0.205 0 0);
|
|
30
|
+
--color-brand-dark-secondary: oklch(0.269 0 0);
|
|
31
|
+
--color-brand-dark-secondary-foreground: oklch(0.985 0 0);
|
|
32
|
+
--color-brand-dark-muted: oklch(0.269 0 0);
|
|
33
|
+
--color-brand-dark-muted-foreground: oklch(0.708 0 0);
|
|
34
|
+
--color-brand-dark-accent: oklch(0.269 0 0);
|
|
35
|
+
--color-brand-dark-accent-foreground: oklch(0.985 0 0);
|
|
36
|
+
--color-brand-dark-destructive: oklch(0.704 0.191 22.216);
|
|
37
|
+
--color-brand-dark-border: oklch(1 0 0 / 10%);
|
|
38
|
+
--color-brand-dark-input: oklch(1 0 0 / 15%);
|
|
39
|
+
--color-brand-dark-ring: oklch(0.556 0 0);
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"noUncheckedIndexedAccess": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"isolatedModules": true,
|
|
10
|
+
"verbatimModuleSyntax": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"noEmit": true
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://turbo.build/schema.json",
|
|
3
|
+
"tasks": {
|
|
4
|
+
"dev": { "cache": false, "persistent": true },
|
|
5
|
+
"build": {
|
|
6
|
+
"dependsOn": ["^build"],
|
|
7
|
+
"outputs": [".next/**", "!.next/cache/**", "dist/**"],
|
|
8
|
+
"env": ["DATABASE_URL", "BETTER_AUTH_SECRET", "BETTER_AUTH_URL", "LAUNCHRAIL_APP_SCHEME", "EXPO_PUBLIC_API_URL"]
|
|
9
|
+
},
|
|
10
|
+
"typecheck": { "dependsOn": ["^typecheck"], "outputs": [] }
|
|
11
|
+
}
|
|
12
|
+
}
|