create-velox-app 0.6.29 → 0.6.31
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/CHANGELOG.md +12 -0
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/templates/auth.d.ts +0 -1
- package/dist/templates/auth.js +0 -1
- package/dist/templates/compiler.d.ts +0 -1
- package/dist/templates/compiler.js +0 -1
- package/dist/templates/index.d.ts +0 -1
- package/dist/templates/index.js +0 -1
- package/dist/templates/placeholders.d.ts +6 -1
- package/dist/templates/placeholders.js +58 -1
- package/dist/templates/rsc.d.ts +0 -1
- package/dist/templates/rsc.js +0 -1
- package/dist/templates/shared/index.d.ts +0 -1
- package/dist/templates/shared/index.js +0 -1
- package/dist/templates/shared/root.d.ts +0 -1
- package/dist/templates/shared/root.js +11 -2
- package/dist/templates/shared/web-base.d.ts +0 -1
- package/dist/templates/shared/web-base.js +0 -1
- package/dist/templates/shared/web-styles.d.ts +0 -1
- package/dist/templates/shared/web-styles.js +0 -1
- package/dist/templates/shared.d.ts +0 -1
- package/dist/templates/shared.js +0 -1
- package/dist/templates/spa.d.ts +0 -1
- package/dist/templates/spa.js +0 -1
- package/dist/templates/trpc.d.ts +0 -1
- package/dist/templates/trpc.js +0 -1
- package/dist/templates/types.d.ts +0 -1
- package/dist/templates/types.js +0 -1
- package/package.json +1 -1
- package/src/templates/source/root/package.json +6 -6
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/templates/auth.d.ts.map +0 -1
- package/dist/templates/auth.js.map +0 -1
- package/dist/templates/compiler.d.ts.map +0 -1
- package/dist/templates/compiler.js.map +0 -1
- package/dist/templates/default.d.ts +0 -12
- package/dist/templates/default.d.ts.map +0 -1
- package/dist/templates/default.js +0 -85
- package/dist/templates/default.js.map +0 -1
- package/dist/templates/fullstack.d.ts +0 -15
- package/dist/templates/fullstack.d.ts.map +0 -1
- package/dist/templates/fullstack.js +0 -110
- package/dist/templates/fullstack.js.map +0 -1
- package/dist/templates/index.d.ts.map +0 -1
- package/dist/templates/index.js.map +0 -1
- package/dist/templates/placeholders.d.ts.map +0 -1
- package/dist/templates/placeholders.js.map +0 -1
- package/dist/templates/rsc.d.ts.map +0 -1
- package/dist/templates/rsc.js.map +0 -1
- package/dist/templates/shared/index.d.ts.map +0 -1
- package/dist/templates/shared/index.js.map +0 -1
- package/dist/templates/shared/root.d.ts.map +0 -1
- package/dist/templates/shared/root.js.map +0 -1
- package/dist/templates/shared/web-base.d.ts.map +0 -1
- package/dist/templates/shared/web-base.js.map +0 -1
- package/dist/templates/shared/web-styles.d.ts.map +0 -1
- package/dist/templates/shared/web-styles.js.map +0 -1
- package/dist/templates/shared.d.ts.map +0 -1
- package/dist/templates/shared.js.map +0 -1
- package/dist/templates/source/api/config/app.d.ts +0 -13
- package/dist/templates/source/api/config/app.d.ts.map +0 -1
- package/dist/templates/source/api/config/app.js +0 -14
- package/dist/templates/source/api/config/app.js.map +0 -1
- package/dist/templates/source/api/config/auth.d.ts +0 -34
- package/dist/templates/source/api/config/auth.d.ts.map +0 -1
- package/dist/templates/source/api/config/auth.js +0 -165
- package/dist/templates/source/api/config/auth.js.map +0 -1
- package/dist/templates/source/api/config/index.auth.d.ts +0 -6
- package/dist/templates/source/api/config/index.auth.d.ts.map +0 -1
- package/dist/templates/source/api/config/index.auth.js +0 -6
- package/dist/templates/source/api/config/index.auth.js.map +0 -1
- package/dist/templates/source/api/config/index.default.d.ts +0 -5
- package/dist/templates/source/api/config/index.default.d.ts.map +0 -1
- package/dist/templates/source/api/config/index.default.js +0 -5
- package/dist/templates/source/api/config/index.default.js.map +0 -1
- package/dist/templates/source/api/database/index.d.ts +0 -9
- package/dist/templates/source/api/database/index.d.ts.map +0 -1
- package/dist/templates/source/api/database/index.js +0 -18
- package/dist/templates/source/api/database/index.js.map +0 -1
- package/dist/templates/source/api/index.auth.d.ts +0 -5
- package/dist/templates/source/api/index.auth.d.ts.map +0 -1
- package/dist/templates/source/api/index.auth.js +0 -59
- package/dist/templates/source/api/index.auth.js.map +0 -1
- package/dist/templates/source/api/index.default.d.ts +0 -5
- package/dist/templates/source/api/index.default.d.ts.map +0 -1
- package/dist/templates/source/api/index.default.js +0 -56
- package/dist/templates/source/api/index.default.js.map +0 -1
- package/dist/templates/source/api/prisma.config.d.ts +0 -9
- package/dist/templates/source/api/prisma.config.d.ts.map +0 -1
- package/dist/templates/source/api/prisma.config.js +0 -15
- package/dist/templates/source/api/prisma.config.js.map +0 -1
- package/dist/templates/source/api/procedures/auth.d.ts +0 -14
- package/dist/templates/source/api/procedures/auth.d.ts.map +0 -1
- package/dist/templates/source/api/procedures/auth.js +0 -221
- package/dist/templates/source/api/procedures/auth.js.map +0 -1
- package/dist/templates/source/api/procedures/health.d.ts +0 -5
- package/dist/templates/source/api/procedures/health.d.ts.map +0 -1
- package/dist/templates/source/api/procedures/health.js +0 -21
- package/dist/templates/source/api/procedures/health.js.map +0 -1
- package/dist/templates/source/api/procedures/index.auth.d.ts +0 -7
- package/dist/templates/source/api/procedures/index.auth.d.ts.map +0 -1
- package/dist/templates/source/api/procedures/index.auth.js +0 -7
- package/dist/templates/source/api/procedures/index.auth.js.map +0 -1
- package/dist/templates/source/api/procedures/index.default.d.ts +0 -6
- package/dist/templates/source/api/procedures/index.default.d.ts.map +0 -1
- package/dist/templates/source/api/procedures/index.default.js +0 -6
- package/dist/templates/source/api/procedures/index.default.js.map +0 -1
- package/dist/templates/source/api/procedures/users.auth.d.ts +0 -7
- package/dist/templates/source/api/procedures/users.auth.d.ts.map +0 -1
- package/dist/templates/source/api/procedures/users.auth.js +0 -111
- package/dist/templates/source/api/procedures/users.auth.js.map +0 -1
- package/dist/templates/source/api/procedures/users.default.d.ts +0 -5
- package/dist/templates/source/api/procedures/users.default.d.ts.map +0 -1
- package/dist/templates/source/api/procedures/users.default.js +0 -86
- package/dist/templates/source/api/procedures/users.default.js.map +0 -1
- package/dist/templates/source/api/schemas/index.d.ts +0 -5
- package/dist/templates/source/api/schemas/index.d.ts.map +0 -1
- package/dist/templates/source/api/schemas/index.js +0 -5
- package/dist/templates/source/api/schemas/index.js.map +0 -1
- package/dist/templates/source/api/schemas/user.d.ts +0 -11
- package/dist/templates/source/api/schemas/user.d.ts.map +0 -1
- package/dist/templates/source/api/schemas/user.js +0 -20
- package/dist/templates/source/api/schemas/user.js.map +0 -1
- package/dist/templates/source/api/tsup.config.d.ts +0 -3
- package/dist/templates/source/api/tsup.config.d.ts.map +0 -1
- package/dist/templates/source/api/tsup.config.js +0 -10
- package/dist/templates/source/api/tsup.config.js.map +0 -1
- package/dist/templates/source/web/main.d.ts +0 -9
- package/dist/templates/source/web/main.d.ts.map +0 -1
- package/dist/templates/source/web/main.js +0 -27
- package/dist/templates/source/web/main.js.map +0 -1
- package/dist/templates/source/web/routes/__root.d.ts +0 -2
- package/dist/templates/source/web/routes/__root.d.ts.map +0 -1
- package/dist/templates/source/web/routes/__root.js +0 -28
- package/dist/templates/source/web/routes/__root.js.map +0 -1
- package/dist/templates/source/web/routes/about.d.ts +0 -2
- package/dist/templates/source/web/routes/about.d.ts.map +0 -1
- package/dist/templates/source/web/routes/about.js +0 -33
- package/dist/templates/source/web/routes/about.js.map +0 -1
- package/dist/templates/source/web/routes/index.auth.d.ts +0 -2
- package/dist/templates/source/web/routes/index.auth.d.ts.map +0 -1
- package/dist/templates/source/web/routes/index.auth.js +0 -159
- package/dist/templates/source/web/routes/index.auth.js.map +0 -1
- package/dist/templates/source/web/routes/index.default.d.ts +0 -2
- package/dist/templates/source/web/routes/index.default.d.ts.map +0 -1
- package/dist/templates/source/web/routes/index.default.js +0 -60
- package/dist/templates/source/web/routes/index.default.js.map +0 -1
- package/dist/templates/source/web/vite.config.d.ts +0 -3
- package/dist/templates/source/web/vite.config.d.ts.map +0 -1
- package/dist/templates/source/web/vite.config.js +0 -22
- package/dist/templates/source/web/vite.config.js.map +0 -1
- package/dist/templates/spa.d.ts.map +0 -1
- package/dist/templates/spa.js.map +0 -1
- package/dist/templates/trpc.d.ts.map +0 -1
- package/dist/templates/trpc.js.map +0 -1
- package/dist/templates/types.d.ts.map +0 -1
- package/dist/templates/types.js.map +0 -1
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* User Procedures
|
|
3
|
-
*/
|
|
4
|
-
import { defineProcedures, procedure, paginationInputSchema, z } from '@veloxts/velox';
|
|
5
|
-
import { CreateUserInput, UpdateUserInput, UserSchema } from '../schemas/user.js';
|
|
6
|
-
function getDb(ctx) {
|
|
7
|
-
return ctx.db;
|
|
8
|
-
}
|
|
9
|
-
function toUserResponse(dbUser) {
|
|
10
|
-
return {
|
|
11
|
-
id: dbUser.id,
|
|
12
|
-
name: dbUser.name,
|
|
13
|
-
email: dbUser.email,
|
|
14
|
-
createdAt: dbUser.createdAt.toISOString(),
|
|
15
|
-
updatedAt: dbUser.updatedAt.toISOString(),
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export const userProcedures = defineProcedures('users', {
|
|
19
|
-
getUser: procedure()
|
|
20
|
-
.input(z.object({ id: z.string().uuid() }))
|
|
21
|
-
.output(UserSchema.nullable())
|
|
22
|
-
.query(async ({ input, ctx }) => {
|
|
23
|
-
const db = getDb(ctx);
|
|
24
|
-
const user = await db.user.findUnique({ where: { id: input.id } });
|
|
25
|
-
return user ? toUserResponse(user) : null;
|
|
26
|
-
}),
|
|
27
|
-
listUsers: procedure()
|
|
28
|
-
.input(paginationInputSchema.optional())
|
|
29
|
-
.output(z.object({
|
|
30
|
-
data: z.array(UserSchema),
|
|
31
|
-
meta: z.object({
|
|
32
|
-
page: z.number(),
|
|
33
|
-
limit: z.number(),
|
|
34
|
-
total: z.number(),
|
|
35
|
-
}),
|
|
36
|
-
}))
|
|
37
|
-
.query(async ({ input, ctx }) => {
|
|
38
|
-
const db = getDb(ctx);
|
|
39
|
-
const page = input?.page ?? 1;
|
|
40
|
-
const limit = input?.limit ?? 10;
|
|
41
|
-
const skip = (page - 1) * limit;
|
|
42
|
-
const [dbUsers, total] = await Promise.all([
|
|
43
|
-
db.user.findMany({ skip, take: limit }),
|
|
44
|
-
db.user.count(),
|
|
45
|
-
]);
|
|
46
|
-
return {
|
|
47
|
-
data: dbUsers.map(toUserResponse),
|
|
48
|
-
meta: { page, limit, total },
|
|
49
|
-
};
|
|
50
|
-
}),
|
|
51
|
-
createUser: procedure()
|
|
52
|
-
.input(CreateUserInput)
|
|
53
|
-
.output(UserSchema)
|
|
54
|
-
.mutation(async ({ input, ctx }) => {
|
|
55
|
-
const db = getDb(ctx);
|
|
56
|
-
const user = await db.user.create({ data: input });
|
|
57
|
-
return toUserResponse(user);
|
|
58
|
-
}),
|
|
59
|
-
updateUser: procedure()
|
|
60
|
-
.input(z.object({ id: z.string().uuid() }).merge(UpdateUserInput))
|
|
61
|
-
.output(UserSchema)
|
|
62
|
-
.mutation(async ({ input, ctx }) => {
|
|
63
|
-
const db = getDb(ctx);
|
|
64
|
-
const { id, ...data } = input;
|
|
65
|
-
const user = await db.user.update({ where: { id }, data });
|
|
66
|
-
return toUserResponse(user);
|
|
67
|
-
}),
|
|
68
|
-
patchUser: procedure()
|
|
69
|
-
.input(z.object({ id: z.string().uuid() }).merge(UpdateUserInput))
|
|
70
|
-
.output(UserSchema)
|
|
71
|
-
.mutation(async ({ input, ctx }) => {
|
|
72
|
-
const db = getDb(ctx);
|
|
73
|
-
const { id, ...data } = input;
|
|
74
|
-
const user = await db.user.update({ where: { id }, data });
|
|
75
|
-
return toUserResponse(user);
|
|
76
|
-
}),
|
|
77
|
-
deleteUser: procedure()
|
|
78
|
-
.input(z.object({ id: z.string().uuid() }))
|
|
79
|
-
.output(z.object({ success: z.boolean() }))
|
|
80
|
-
.mutation(async ({ input, ctx }) => {
|
|
81
|
-
const db = getDb(ctx);
|
|
82
|
-
await db.user.delete({ where: { id: input.id } });
|
|
83
|
-
return { success: true };
|
|
84
|
-
}),
|
|
85
|
-
});
|
|
86
|
-
//# sourceMappingURL=users.default.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"users.default.js","sourceRoot":"","sources":["../../../../../src/templates/source/api/procedures/users.default.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAEvF,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAsBlF,SAAS,KAAK,CAAC,GAAoB;IACjC,OAAO,GAAG,CAAC,EAAc,CAAC;AAC5B,CAAC;AAED,SAAS,cAAc,CAAC,MAAc;IACpC,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,WAAW,EAAE;QACzC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,WAAW,EAAE;KAC1C,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC,OAAO,EAAE;IACtD,OAAO,EAAE,SAAS,EAAE;SACjB,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;SAC1C,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;SAC7B,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;QAC9B,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QACtB,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,EA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AC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;QACjC,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QACtB,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QAC9B,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3D,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC;IAEJ,UAAU,EAAE,SAAS,EAAE;SACpB,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;SAC1C,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;SAC1C,QAAQ,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;QACjC,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QACtB,MAAM,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAClD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC,CAAC;CACL,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/templates/source/api/schemas/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,WAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/templates/source/api/schemas/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,WAAW,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* User Schemas
|
|
3
|
-
*/
|
|
4
|
-
import { z } from '@veloxts/velox';
|
|
5
|
-
export declare const UserSchema: any;
|
|
6
|
-
export type User = z.infer<typeof UserSchema>;
|
|
7
|
-
export declare const CreateUserInput: any;
|
|
8
|
-
export type CreateUserData = z.infer<typeof CreateUserInput>;
|
|
9
|
-
export declare const UpdateUserInput: any;
|
|
10
|
-
export type UpdateUserData = z.infer<typeof UpdateUserInput>;
|
|
11
|
-
//# sourceMappingURL=user.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../../src/templates/source/api/schemas/user.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAA+B,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAEhE,eAAO,MAAM,UAAU,KAMrB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAE9C,eAAO,MAAM,eAAe,KAG1B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE7D,eAAO,MAAM,eAAe,KAG1B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* User Schemas
|
|
3
|
-
*/
|
|
4
|
-
import { createIdSchema, emailSchema, z } from '@veloxts/velox';
|
|
5
|
-
export const UserSchema = z.object({
|
|
6
|
-
id: createIdSchema('uuid'),
|
|
7
|
-
name: z.string().min(1).max(100),
|
|
8
|
-
email: emailSchema,
|
|
9
|
-
createdAt: z.coerce.date().transform((d) => d.toISOString()),
|
|
10
|
-
updatedAt: z.coerce.date().transform((d) => d.toISOString()),
|
|
11
|
-
});
|
|
12
|
-
export const CreateUserInput = z.object({
|
|
13
|
-
name: z.string().min(1).max(100),
|
|
14
|
-
email: emailSchema,
|
|
15
|
-
});
|
|
16
|
-
export const UpdateUserInput = z.object({
|
|
17
|
-
name: z.string().min(1).max(100).optional(),
|
|
18
|
-
email: emailSchema.optional(),
|
|
19
|
-
});
|
|
20
|
-
//# sourceMappingURL=user.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../../../src/templates/source/api/schemas/user.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,gBAAgB,CAAC;AAEhE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,EAAE,EAAE,cAAc,CAAC,MAAM,CAAC;IAC1B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAChC,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5D,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;CAC7D,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAChC,KAAK,EAAE,WAAW;CACnB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC3C,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tsup.config.d.ts","sourceRoot":"","sources":["../../../../src/templates/source/api/tsup.config.ts"],"names":[],"mappings":";AAEA,wBAOG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tsup.config.js","sourceRoot":"","sources":["../../../../src/templates/source/api/tsup.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEpC,eAAe,YAAY,CAAC;IAC1B,KAAK,EAAE,CAAC,cAAc,CAAC;IACvB,MAAM,EAAE,CAAC,KAAK,CAAC;IACf,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,IAAI;IACX,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,IAAI;CAChB,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../src/templates/source/web/main.tsx"],"names":[],"mappings":"AAKA,OAAO,qBAAqB,CAAC;AAa7B,QAAA,MAAM,MAAM,KAA8B,CAAC;AAG3C,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,QAAQ;QAChB,MAAM,EAAE,OAAO,MAAM,CAAC;KACvB;CACF"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { StrictMode } from 'react';
|
|
2
|
-
import { createRoot } from 'react-dom/client';
|
|
3
|
-
import { RouterProvider, createRouter } from '@tanstack/react-router';
|
|
4
|
-
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
5
|
-
import { routeTree } from './routeTree.gen';
|
|
6
|
-
import './styles/global.css';
|
|
7
|
-
// Create query client for data fetching
|
|
8
|
-
const queryClient = new QueryClient({
|
|
9
|
-
defaultOptions: {
|
|
10
|
-
queries: {
|
|
11
|
-
staleTime: 1000 * 60, // 1 minute
|
|
12
|
-
retry: 1,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
// Create router with route tree
|
|
17
|
-
const router = createRouter({ routeTree });
|
|
18
|
-
// Render application
|
|
19
|
-
const rootElement = document.getElementById('root');
|
|
20
|
-
if (!rootElement)
|
|
21
|
-
throw new Error('Root element not found');
|
|
22
|
-
createRoot(rootElement).render(<StrictMode>
|
|
23
|
-
<QueryClientProvider client={queryClient}>
|
|
24
|
-
<RouterProvider router={router}/>
|
|
25
|
-
</QueryClientProvider>
|
|
26
|
-
</StrictMode>);
|
|
27
|
-
//# sourceMappingURL=main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../../src/templates/source/web/main.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,qBAAqB,CAAC;AAE7B,wCAAwC;AACxC,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC;IAClC,cAAc,EAAE;QACd,OAAO,EAAE;YACP,SAAS,EAAE,IAAI,GAAG,EAAE,EAAE,WAAW;YACjC,KAAK,EAAE,CAAC;SACT;KACF;CACF,CAAC,CAAC;AAEH,gCAAgC;AAChC,MAAM,MAAM,GAAG,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;AAS3C,qBAAqB;AACrB,MAAM,WAAW,GAAG,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AACpD,IAAI,CAAC,WAAW;IAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;AAE5D,UAAU,CAAC,WAAW,CAAC,CAAC,MAAM,CAC5B,CAAC,UAAU,CACT;IAAA,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CACvC;MAAA,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EACjC;IAAA,EAAE,mBAAmB,CACvB;EAAA,EAAE,UAAU,CAAC,CACd,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"__root.d.ts","sourceRoot":"","sources":["../../../../../src/templates/source/web/routes/__root.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,KAEhB,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { createRootRoute, Outlet, Link } from '@tanstack/react-router';
|
|
2
|
-
import styles from '@/App.module.css';
|
|
3
|
-
export const Route = createRootRoute({
|
|
4
|
-
component: RootLayout,
|
|
5
|
-
});
|
|
6
|
-
function RootLayout() {
|
|
7
|
-
return (<div className={styles.app}>
|
|
8
|
-
<nav className={styles.nav}>
|
|
9
|
-
<div className={styles.navBrand}>
|
|
10
|
-
<Link to="/" className={styles.logo}>
|
|
11
|
-
VeloxTS
|
|
12
|
-
</Link>
|
|
13
|
-
</div>
|
|
14
|
-
<div className={styles.navLinks}>
|
|
15
|
-
<Link to="/" className={styles.navLink} activeProps={{ className: styles.navLinkActive }}>
|
|
16
|
-
Home
|
|
17
|
-
</Link>
|
|
18
|
-
<Link to="/about" className={styles.navLink} activeProps={{ className: styles.navLinkActive }}>
|
|
19
|
-
About
|
|
20
|
-
</Link>
|
|
21
|
-
</div>
|
|
22
|
-
</nav>
|
|
23
|
-
<main className={styles.main}>
|
|
24
|
-
<Outlet />
|
|
25
|
-
</main>
|
|
26
|
-
</div>);
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=__root.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"__root.js","sourceRoot":"","sources":["../../../../../src/templates/source/web/routes/__root.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,CAAC,MAAM,KAAK,GAAG,eAAe,CAAC;IACnC,SAAS,EAAE,UAAU;CACtB,CAAC,CAAC;AAEH,SAAS,UAAU;IACjB,OAAO,CACL,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CACzB;MAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CACzB;QAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAC9B;UAAA,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAClC;;UACF,EAAE,IAAI,CACR;QAAA,EAAE,GAAG,CACL;QAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAC9B;UAAA,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC,CACvF;;UACF,EAAE,IAAI,CACN;UAAA,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC,CAC5F;;UACF,EAAE,IAAI,CACR;QAAA,EAAE,GAAG,CACP;MAAA,EAAE,GAAG,CACL;MAAA,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAC3B;QAAA,CAAC,MAAM,CAAC,AAAD,EACT;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"about.d.ts","sourceRoot":"","sources":["../../../../../src/templates/source/web/routes/about.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,KAEhB,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { createFileRoute } from '@tanstack/react-router';
|
|
2
|
-
import styles from '@/App.module.css';
|
|
3
|
-
export const Route = createFileRoute('/about')({
|
|
4
|
-
component: AboutPage,
|
|
5
|
-
});
|
|
6
|
-
function AboutPage() {
|
|
7
|
-
return (<div className={styles.container}>
|
|
8
|
-
<div className={styles.hero}>
|
|
9
|
-
<h1 className={styles.title}>About VeloxTS</h1>
|
|
10
|
-
<p className={styles.subtitle}>
|
|
11
|
-
A Laravel-inspired TypeScript framework for full-stack development.
|
|
12
|
-
</p>
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
<div className={styles.cards}>
|
|
16
|
-
<div className={styles.card}>
|
|
17
|
-
<h2>Type Safety</h2>
|
|
18
|
-
<p>End-to-end type safety without code generation. Types flow from backend to frontend automatically.</p>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<div className={styles.card}>
|
|
22
|
-
<h2>Developer Experience</h2>
|
|
23
|
-
<p>Convention over configuration. Sensible defaults with escape hatches when you need them.</p>
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
<div className={styles.card}>
|
|
27
|
-
<h2>Modern Stack</h2>
|
|
28
|
-
<p>Built on Fastify, tRPC, Prisma, React, and TanStack Router.</p>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</div>);
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=about.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"about.js","sourceRoot":"","sources":["../../../../../src/templates/source/web/routes/about.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,CAAC,MAAM,KAAK,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC7C,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AAEH,SAAS,SAAS;IAChB,OAAO,CACL,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC/B;MAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAC1B;QAAA,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,aAAa,EAAE,EAAE,CAC9C;QAAA,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAC5B;;QACF,EAAE,CAAC,CACL;MAAA,EAAE,GAAG,CAEL;;MAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAC3B;QAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAC1B;UAAA,CAAC,EAAE,CAAC,WAAW,EAAE,EAAE,CACnB;UAAA,CAAC,CAAC,CAAC,kGAAkG,EAAE,CAAC,CAC1G;QAAA,EAAE,GAAG,CAEL;;QAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAC1B;UAAA,CAAC,EAAE,CAAC,oBAAoB,EAAE,EAAE,CAC5B;UAAA,CAAC,CAAC,CAAC,wFAAwF,EAAE,CAAC,CAChG;QAAA,EAAE,GAAG,CAEL;;QAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAC1B;UAAA,CAAC,EAAE,CAAC,YAAY,EAAE,EAAE,CACpB;UAAA,CAAC,CAAC,CAAC,2DAA2D,EAAE,CAAC,CACnE;QAAA,EAAE,GAAG,CACP;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.auth.d.ts","sourceRoot":"","sources":["../../../../../src/templates/source/web/routes/index.auth.tsx"],"names":[],"mappings":"AA8CA,eAAO,MAAM,KAAK,KAEhB,CAAC"}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { createFileRoute } from '@tanstack/react-router';
|
|
2
|
-
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import styles from '@/App.module.css';
|
|
5
|
-
// API helpers
|
|
6
|
-
const api = {
|
|
7
|
-
get: async (path) => {
|
|
8
|
-
const token = localStorage.getItem('accessToken');
|
|
9
|
-
const res = await fetch(`/api${path}`, {
|
|
10
|
-
headers: token ? { Authorization: `Bearer ${token}` } : {},
|
|
11
|
-
});
|
|
12
|
-
if (!res.ok)
|
|
13
|
-
throw new Error(`HTTP ${res.status}`);
|
|
14
|
-
return res.json();
|
|
15
|
-
},
|
|
16
|
-
post: async (path, data) => {
|
|
17
|
-
const token = localStorage.getItem('accessToken');
|
|
18
|
-
const res = await fetch(`/api${path}`, {
|
|
19
|
-
method: 'POST',
|
|
20
|
-
headers: {
|
|
21
|
-
'Content-Type': 'application/json',
|
|
22
|
-
...(token ? { Authorization: `Bearer ${token}` } : {}),
|
|
23
|
-
},
|
|
24
|
-
body: JSON.stringify(data),
|
|
25
|
-
});
|
|
26
|
-
if (!res.ok) {
|
|
27
|
-
const error = await res.json().catch(() => ({}));
|
|
28
|
-
throw new Error(error.message || `HTTP ${res.status}`);
|
|
29
|
-
}
|
|
30
|
-
return res.json();
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
export const Route = createFileRoute('/')({
|
|
34
|
-
component: HomePage,
|
|
35
|
-
});
|
|
36
|
-
function HomePage() {
|
|
37
|
-
const queryClient = useQueryClient();
|
|
38
|
-
const [isLogin, setIsLogin] = useState(true);
|
|
39
|
-
const [email, setEmail] = useState('');
|
|
40
|
-
const [password, setPassword] = useState('');
|
|
41
|
-
const [name, setName] = useState('');
|
|
42
|
-
const [error, setError] = useState('');
|
|
43
|
-
// Check if user is logged in
|
|
44
|
-
const { data: user, isLoading } = useQuery({
|
|
45
|
-
queryKey: ['me'],
|
|
46
|
-
queryFn: () => api.get('/auth/me'),
|
|
47
|
-
retry: false,
|
|
48
|
-
});
|
|
49
|
-
const login = useMutation({
|
|
50
|
-
mutationFn: (data) => api.post('/auth/login', data),
|
|
51
|
-
onSuccess: (data) => {
|
|
52
|
-
localStorage.setItem('accessToken', data.accessToken);
|
|
53
|
-
localStorage.setItem('refreshToken', data.refreshToken);
|
|
54
|
-
queryClient.invalidateQueries({ queryKey: ['me'] });
|
|
55
|
-
setError('');
|
|
56
|
-
},
|
|
57
|
-
onError: (err) => {
|
|
58
|
-
setError(err instanceof Error ? err.message : 'Login failed');
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
const register = useMutation({
|
|
62
|
-
mutationFn: (data) => api.post('/auth/register', data),
|
|
63
|
-
onSuccess: (data) => {
|
|
64
|
-
localStorage.setItem('accessToken', data.accessToken);
|
|
65
|
-
localStorage.setItem('refreshToken', data.refreshToken);
|
|
66
|
-
queryClient.invalidateQueries({ queryKey: ['me'] });
|
|
67
|
-
setError('');
|
|
68
|
-
},
|
|
69
|
-
onError: (err) => {
|
|
70
|
-
setError(err instanceof Error ? err.message : 'Registration failed');
|
|
71
|
-
},
|
|
72
|
-
});
|
|
73
|
-
const logout = useMutation({
|
|
74
|
-
mutationFn: () => api.post('/auth/logout', {}),
|
|
75
|
-
onSuccess: () => {
|
|
76
|
-
localStorage.removeItem('accessToken');
|
|
77
|
-
localStorage.removeItem('refreshToken');
|
|
78
|
-
queryClient.invalidateQueries({ queryKey: ['me'] });
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
const handleSubmit = (e) => {
|
|
82
|
-
e.preventDefault();
|
|
83
|
-
setError('');
|
|
84
|
-
if (isLogin) {
|
|
85
|
-
login.mutate({ email, password });
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
register.mutate({ name, email, password });
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
if (isLoading) {
|
|
92
|
-
return (<div className={styles.container}>
|
|
93
|
-
<p className={styles.loading}>Loading...</p>
|
|
94
|
-
</div>);
|
|
95
|
-
}
|
|
96
|
-
// Logged in view
|
|
97
|
-
if (user) {
|
|
98
|
-
return (<div className={styles.container}>
|
|
99
|
-
<div className={styles.hero}>
|
|
100
|
-
<h1 className={styles.title}>Welcome, {user.name}!</h1>
|
|
101
|
-
<p className={styles.subtitle}>{user.email}</p>
|
|
102
|
-
</div>
|
|
103
|
-
|
|
104
|
-
<div className={styles.cards}>
|
|
105
|
-
<div className={styles.card}>
|
|
106
|
-
<h2>Your Profile</h2>
|
|
107
|
-
<p><strong>ID:</strong> {user.id}</p>
|
|
108
|
-
<p><strong>Roles:</strong> {user.roles?.join(', ') || 'user'}</p>
|
|
109
|
-
</div>
|
|
110
|
-
|
|
111
|
-
<div className={styles.card}>
|
|
112
|
-
<h2>Actions</h2>
|
|
113
|
-
<button onClick={() => logout.mutate()} className={styles.button} disabled={logout.isPending}>
|
|
114
|
-
{logout.isPending ? 'Logging out...' : 'Logout'}
|
|
115
|
-
</button>
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
118
|
-
</div>);
|
|
119
|
-
}
|
|
120
|
-
// Login/Register form
|
|
121
|
-
return (<div className={styles.container}>
|
|
122
|
-
<div className={styles.hero}>
|
|
123
|
-
<h1 className={styles.title}>Welcome to VeloxTS</h1>
|
|
124
|
-
<p className={styles.subtitle}>
|
|
125
|
-
Full-stack TypeScript with authentication.
|
|
126
|
-
</p>
|
|
127
|
-
</div>
|
|
128
|
-
|
|
129
|
-
<div className={styles.authCard}>
|
|
130
|
-
<div className={styles.authTabs}>
|
|
131
|
-
<button className={`${styles.authTab} ${isLogin ? styles.authTabActive : ''}`} onClick={() => setIsLogin(true)}>
|
|
132
|
-
Login
|
|
133
|
-
</button>
|
|
134
|
-
<button className={`${styles.authTab} ${!isLogin ? styles.authTabActive : ''}`} onClick={() => setIsLogin(false)}>
|
|
135
|
-
Register
|
|
136
|
-
</button>
|
|
137
|
-
</div>
|
|
138
|
-
|
|
139
|
-
<form onSubmit={handleSubmit} className={styles.form}>
|
|
140
|
-
{!isLogin && (<input type="text" placeholder="Name" value={name} onChange={(e) => setName(e.target.value)} className={styles.input} required minLength={2}/>)}
|
|
141
|
-
<input type="email" placeholder="Email" value={email} onChange={(e) => setEmail(e.target.value)} className={styles.input} required/>
|
|
142
|
-
<input type="password" placeholder="Password" value={password} onChange={(e) => setPassword(e.target.value)} className={styles.input} required minLength={isLogin ? 1 : 12}/>
|
|
143
|
-
|
|
144
|
-
{error && <p className={styles.formError}>{error}</p>}
|
|
145
|
-
|
|
146
|
-
<button type="submit" className={styles.button} disabled={login.isPending || register.isPending}>
|
|
147
|
-
{login.isPending || register.isPending
|
|
148
|
-
? 'Please wait...'
|
|
149
|
-
: isLogin ? 'Sign In' : 'Create Account'}
|
|
150
|
-
</button>
|
|
151
|
-
</form>
|
|
152
|
-
|
|
153
|
-
{!isLogin && (<p className={styles.formHint}>
|
|
154
|
-
Password: 12+ chars, uppercase, lowercase, number
|
|
155
|
-
</p>)}
|
|
156
|
-
</div>
|
|
157
|
-
</div>);
|
|
158
|
-
}
|
|
159
|
-
//# sourceMappingURL=index.auth.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.auth.js","sourceRoot":"","sources":["../../../../../src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CAAC,KAAK,CAAC,SAAS,IAAI,QAAQ,CAAC,SAAS;YACpC,CAAC,CAAC,gBAAgB;YAClB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAC5C;UAAA,EAAE,MAAM,CACV;QAAA,EAAE,IAAI,CAEN;;QAAA,CAAC,CAAC,OAAO,IAAI,CACX,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAC5B;;UACF,EAAE,CAAC,CAAC,CACL,CACH;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.default.d.ts","sourceRoot":"","sources":["../../../../../src/templates/source/web/routes/index.default.tsx"],"names":[],"mappings":"AAaA,eAAO,MAAM,KAAK,KAEhB,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { createFileRoute } from '@tanstack/react-router';
|
|
2
|
-
import { useQuery } from '@tanstack/react-query';
|
|
3
|
-
import styles from '@/App.module.css';
|
|
4
|
-
// API helper
|
|
5
|
-
const api = {
|
|
6
|
-
get: async (path) => {
|
|
7
|
-
const res = await fetch(`/api${path}`);
|
|
8
|
-
if (!res.ok)
|
|
9
|
-
throw new Error(`HTTP ${res.status}`);
|
|
10
|
-
return res.json();
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
export const Route = createFileRoute('/')({
|
|
14
|
-
component: HomePage,
|
|
15
|
-
});
|
|
16
|
-
function HomePage() {
|
|
17
|
-
const { data: health, isLoading, error } = useQuery({
|
|
18
|
-
queryKey: ['health'],
|
|
19
|
-
queryFn: () => api.get('/health'),
|
|
20
|
-
});
|
|
21
|
-
return (<div className={styles.container}>
|
|
22
|
-
<div className={styles.hero}>
|
|
23
|
-
<h1 className={styles.title}>Welcome to VeloxTS</h1>
|
|
24
|
-
<p className={styles.subtitle}>
|
|
25
|
-
Full-stack TypeScript, beautifully simple.
|
|
26
|
-
</p>
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<div className={styles.cards}>
|
|
30
|
-
<div className={styles.card}>
|
|
31
|
-
<h2>API Status</h2>
|
|
32
|
-
{isLoading ? (<p className={styles.loading}>Checking...</p>) : error ? (<p className={styles.error}>Disconnected</p>) : (<p className={styles.success}>
|
|
33
|
-
{health?.status === 'ok' ? 'Connected' : 'Unknown'}
|
|
34
|
-
</p>)}
|
|
35
|
-
{health && (<p className={styles.meta}>v{health.version}</p>)}
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
<div className={styles.card}>
|
|
39
|
-
<h2>Get Started</h2>
|
|
40
|
-
<p>Edit <code>apps/api/src/procedures</code> to add API endpoints.</p>
|
|
41
|
-
<p>Edit <code>apps/web/src/routes</code> to add pages.</p>
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
<div className={styles.card}>
|
|
45
|
-
<h2>Documentation</h2>
|
|
46
|
-
<p>
|
|
47
|
-
<a href="https://veloxts.dev" target="_blank" rel="noopener noreferrer">
|
|
48
|
-
VeloxTS Docs
|
|
49
|
-
</a>
|
|
50
|
-
</p>
|
|
51
|
-
<p>
|
|
52
|
-
<a href="https://tanstack.com/router" target="_blank" rel="noopener noreferrer">
|
|
53
|
-
TanStack Router
|
|
54
|
-
</a>
|
|
55
|
-
</p>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
</div>);
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=index.default.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.default.js","sourceRoot":"","sources":["../../../../../src/templates/source/web/routes/index.default.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC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,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,qBAAqB,CACrE;;YACF,EAAE,CAAC,CACL;UAAA,EAAE,CAAC,CACH;UAAA,CAAC,CAAC,CACA;YAAA,CAAC,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,qBAAqB,CAC7E;;YACF,EAAE,CAAC,CACL;UAAA,EAAE,CAAC,CACL;QAAA,EAAE,GAAG,CACP;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vite.config.d.ts","sourceRoot":"","sources":["../../../../src/templates/source/web/vite.config.ts"],"names":[],"mappings":";AAKA,wBAgBG"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
|
-
import react from '@vitejs/plugin-react';
|
|
3
|
-
import { TanStackRouterVite } from '@tanstack/router-plugin/vite';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
plugins: [TanStackRouterVite(), react()],
|
|
7
|
-
resolve: {
|
|
8
|
-
alias: {
|
|
9
|
-
'@': path.resolve(__dirname, './src'),
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
server: {
|
|
13
|
-
port: __WEB_PORT__,
|
|
14
|
-
proxy: {
|
|
15
|
-
'/api': {
|
|
16
|
-
target: 'http://localhost:__API_PORT__',
|
|
17
|
-
changeOrigin: true,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
//# sourceMappingURL=vite.config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vite.config.js","sourceRoot":"","sources":["../../../../src/templates/source/web/vite.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,MAAM,sBAAsB,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,eAAe,YAAY,CAAC;IAC1B,OAAO,EAAE,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,CAAC;IACxC,OAAO,EAAE;QACP,KAAK,EAAE;YACL,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC;SACtC;KACF;IACD,MAAM,EAAE;QACN,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE;YACL,MAAM,EAAE;gBACN,MAAM,EAAE,+BAA+B;gBACvC,YAAY,EAAE,IAAI;aACnB;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spa.d.ts","sourceRoot":"","sources":["../../src/templates/spa.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA+E/D,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,GAAG,YAAY,EAAE,CAmC1E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spa.js","sourceRoot":"","sources":["../../src/templates/spa.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAGnG,+EAA+E;AAC/E,2BAA2B;AAC3B,+EAA+E;AAE/E,SAAS,sBAAsB,CAAC,MAAsB;IACpD,MAAM,OAAO,GAAG,eAAe,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAC;IACpE,OAAO,yBAAyB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