deploy-bbc 1.1.0 → 1.2.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.
Files changed (55) hide show
  1. package/.cspell.json +38 -0
  2. package/CLAUDE.md +85 -11
  3. package/README.md +358 -0
  4. package/cli/package.json +9 -9
  5. package/cli/src/cli/index.ts +8 -3
  6. package/cli/src/helpers/generate-docker-compose.ts +1 -1
  7. package/cli/src/helpers/generate-dockerfile.ts +1 -1
  8. package/cli/src/helpers/log-next-steps.ts +23 -20
  9. package/cli/src/helpers/scaffold-project.ts +30 -4
  10. package/cli/src/installers/auth.ts +1 -1
  11. package/cli/src/templates/base/.env.example +1 -1
  12. package/cli/src/templates/base/package.json +2 -1
  13. package/cli/src/templates/base/src/config/index.ts +1 -1
  14. package/cli/src/templates/base/src/controllers/user/create-user.controller.ts +84 -0
  15. package/cli/src/templates/base/src/controllers/user/delete-user.controller.ts +60 -0
  16. package/cli/src/templates/base/src/controllers/user/get-user.controller.ts +74 -0
  17. package/cli/src/templates/base/src/controllers/user/get-users.controller.ts +41 -0
  18. package/cli/src/templates/base/src/controllers/user/update-user.controller.ts +111 -0
  19. package/cli/src/templates/base/src/models/user.model.ts +83 -0
  20. package/cli/src/templates/base/src/routes/index.ts +5 -0
  21. package/cli/src/templates/base/src/routes/user.route.ts +17 -0
  22. package/cli/src/templates/base/src/types/common/api-response.types.ts +30 -0
  23. package/cli/src/templates/base/src/types/index.ts +5 -2
  24. package/cli/src/templates/base/src/types/models/user.types.ts +26 -0
  25. package/cli/src/templates/base-bun-native/.env.example +1 -1
  26. package/cli/src/templates/base-bun-native/package.json +2 -1
  27. package/cli/src/templates/base-bun-native/src/config/index.ts +1 -1
  28. package/cli/src/templates/base-bun-native/src/controllers/user/create-user.controller.ts +76 -0
  29. package/cli/src/templates/base-bun-native/src/controllers/user/delete-user.controller.ts +53 -0
  30. package/cli/src/templates/base-bun-native/src/controllers/user/get-user.controller.ts +67 -0
  31. package/cli/src/templates/base-bun-native/src/controllers/user/get-users.controller.ts +40 -0
  32. package/cli/src/templates/base-bun-native/src/controllers/user/update-user.controller.ts +101 -0
  33. package/cli/src/templates/base-bun-native/src/index.ts +3 -3
  34. package/cli/src/templates/base-bun-native/src/models/user.model.ts +83 -0
  35. package/cli/src/templates/base-bun-native/src/routes/index.ts +10 -6
  36. package/cli/src/templates/base-bun-native/src/routes/user.route.ts +50 -0
  37. package/cli/src/templates/base-bun-native/src/types/common/api-response.types.ts +30 -0
  38. package/cli/src/templates/base-bun-native/src/types/index.ts +5 -2
  39. package/cli/src/templates/base-bun-native/src/types/models/user.types.ts +26 -0
  40. package/cli/src/templates/base-express/.env.example +1 -1
  41. package/cli/src/templates/base-express/package.json +2 -1
  42. package/cli/src/templates/base-express/src/config/index.ts +1 -1
  43. package/cli/src/templates/base-express/src/controllers/user/create-user.controller.ts +75 -0
  44. package/cli/src/templates/base-express/src/controllers/user/delete-user.controller.ts +56 -0
  45. package/cli/src/templates/base-express/src/controllers/user/get-user.controller.ts +70 -0
  46. package/cli/src/templates/base-express/src/controllers/user/get-users.controller.ts +41 -0
  47. package/cli/src/templates/base-express/src/controllers/user/update-user.controller.ts +102 -0
  48. package/cli/src/templates/base-express/src/models/user.model.ts +83 -0
  49. package/cli/src/templates/base-express/src/routes/index.ts +5 -0
  50. package/cli/src/templates/base-express/src/routes/user.route.ts +17 -0
  51. package/cli/src/templates/base-express/src/types/common/api-response.types.ts +30 -0
  52. package/cli/src/templates/base-express/src/types/index.ts +5 -2
  53. package/cli/src/templates/base-express/src/types/models/user.types.ts +26 -0
  54. package/cli/src/utils/parse-name-and-path.ts +18 -2
  55. package/package.json +3 -3
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Common API response types
3
+ */
4
+
5
+ export interface ApiResponse<T = unknown> {
6
+ success: boolean;
7
+ data?: T;
8
+ error?: string;
9
+ message?: string;
10
+ }
11
+
12
+ export interface PaginatedResponse<T> extends ApiResponse<T[]> {
13
+ pagination: {
14
+ page: number;
15
+ limit: number;
16
+ total: number;
17
+ totalPages: number;
18
+ };
19
+ }
20
+
21
+ export interface ValidationError {
22
+ field: string;
23
+ message: string;
24
+ }
25
+
26
+ export interface ApiError {
27
+ success: false;
28
+ error: string;
29
+ details?: ValidationError[];
30
+ }
@@ -1,2 +1,5 @@
1
- // Add your TypeScript types and interfaces here
2
- export {};
1
+ // Export common types
2
+ export * from "./common/api-response.types.js";
3
+
4
+ // Export model types
5
+ export * from "./models/user.types.js";
@@ -0,0 +1,26 @@
1
+ /**
2
+ * User model types
3
+ */
4
+
5
+ export interface User {
6
+ id: string;
7
+ email: string;
8
+ name: string;
9
+ createdAt: Date;
10
+ updatedAt: Date;
11
+ }
12
+
13
+ export interface CreateUserInput {
14
+ email: string;
15
+ name: string;
16
+ }
17
+
18
+ export interface UpdateUserInput {
19
+ email?: string;
20
+ name?: string;
21
+ }
22
+
23
+ export type UserResponse = Omit<User, "createdAt" | "updatedAt"> & {
24
+ createdAt: string;
25
+ updatedAt: string;
26
+ };
@@ -1,3 +1,3 @@
1
1
  # Server Configuration
2
- PORT=3000
2
+ PORT=8000
3
3
  NODE_ENV=development
@@ -10,7 +10,8 @@
10
10
  "type-check": "tsc --noEmit"
11
11
  },
12
12
  "dependencies": {
13
- "dotenv": "^16.3.1"
13
+ "dotenv": "^16.3.1",
14
+ "zod": "^3.22.4"
14
15
  },
15
16
  "devDependencies": {
16
17
  "@types/bun": "latest",
@@ -3,6 +3,6 @@ import { load_env } from "../utils/env.js";
3
3
  load_env();
4
4
 
5
5
  export const config = {
6
- port: parseInt(process.env.PORT || "3000", 10),
6
+ port: parseInt(process.env.PORT || "8000", 10),
7
7
  nodeEnv: process.env.NODE_ENV || "development",
8
8
  } as const;
@@ -0,0 +1,76 @@
1
+ import { z } from "zod";
2
+ import { user_model } from "../../models/user.model.js";
3
+ import type { ApiResponse, ApiError } from "../../types/common/api-response.types.js";
4
+ import type { UserResponse } from "../../types/models/user.types.js";
5
+
6
+ /**
7
+ * Validation schema
8
+ */
9
+ const create_user_schema = z.object({
10
+ email: z.string().email("Invalid email address"),
11
+ name: z.string().min(2, "Name must be at least 2 characters").max(100, "Name must not exceed 100 characters"),
12
+ });
13
+
14
+ /**
15
+ * Helper to format user response
16
+ */
17
+ function format_user_response(user: any): UserResponse {
18
+ return {
19
+ id: user.id,
20
+ email: user.email,
21
+ name: user.name,
22
+ createdAt: user.createdAt.toISOString(),
23
+ updatedAt: user.updatedAt.toISOString(),
24
+ };
25
+ }
26
+
27
+ /**
28
+ * Create a new user
29
+ * POST /users
30
+ */
31
+ export async function create_user(req: Request): Promise<Response> {
32
+ try {
33
+ const body = await req.json();
34
+
35
+ // Validate request body
36
+ const validation = create_user_schema.safeParse(body);
37
+ if (!validation.success) {
38
+ const errorResponse: ApiError = {
39
+ success: false,
40
+ error: "Validation failed",
41
+ details: validation.error.errors.map((err) => ({
42
+ field: err.path.join("."),
43
+ message: err.message,
44
+ })),
45
+ };
46
+ return Response.json(errorResponse, { status: 400 });
47
+ }
48
+
49
+ // Check if email already exists
50
+ const existing_user = await user_model.find_by_email(validation.data.email);
51
+ if (existing_user) {
52
+ const errorResponse: ApiError = {
53
+ success: false,
54
+ error: "User with this email already exists",
55
+ };
56
+ return Response.json(errorResponse, { status: 409 });
57
+ }
58
+
59
+ // Create user
60
+ const user = await user_model.create(validation.data);
61
+
62
+ const response: ApiResponse<UserResponse> = {
63
+ success: true,
64
+ data: format_user_response(user),
65
+ message: "User created successfully",
66
+ };
67
+
68
+ return Response.json(response, { status: 201 });
69
+ } catch (error) {
70
+ const errorResponse: ApiError = {
71
+ success: false,
72
+ error: "Failed to create user",
73
+ };
74
+ return Response.json(errorResponse, { status: 500 });
75
+ }
76
+ }
@@ -0,0 +1,53 @@
1
+ import { z } from "zod";
2
+ import { user_model } from "../../models/user.model.js";
3
+ import type { ApiResponse, ApiError } from "../../types/common/api-response.types.js";
4
+
5
+ /**
6
+ * Validation schema
7
+ */
8
+ const user_id_schema = z.string().uuid("Invalid user ID format");
9
+
10
+ /**
11
+ * Delete user by ID
12
+ * DELETE /users/:id
13
+ */
14
+ export async function delete_user(id: string): Promise<Response> {
15
+ try {
16
+ // Validate ID format
17
+ const validation = user_id_schema.safeParse(id);
18
+ if (!validation.success) {
19
+ const errorResponse: ApiError = {
20
+ success: false,
21
+ error: "Invalid user ID",
22
+ details: validation.error.errors.map((err) => ({
23
+ field: err.path.join("."),
24
+ message: err.message,
25
+ })),
26
+ };
27
+ return Response.json(errorResponse, { status: 400 });
28
+ }
29
+
30
+ const deleted = await user_model.delete(id);
31
+
32
+ if (!deleted) {
33
+ const errorResponse: ApiError = {
34
+ success: false,
35
+ error: "User not found",
36
+ };
37
+ return Response.json(errorResponse, { status: 404 });
38
+ }
39
+
40
+ const response: ApiResponse = {
41
+ success: true,
42
+ message: "User deleted successfully",
43
+ };
44
+
45
+ return Response.json(response);
46
+ } catch (error) {
47
+ const errorResponse: ApiError = {
48
+ success: false,
49
+ error: "Failed to delete user",
50
+ };
51
+ return Response.json(errorResponse, { status: 500 });
52
+ }
53
+ }
@@ -0,0 +1,67 @@
1
+ import { z } from "zod";
2
+ import { user_model } from "../../models/user.model.js";
3
+ import type { ApiResponse, ApiError } from "../../types/common/api-response.types.js";
4
+ import type { UserResponse } from "../../types/models/user.types.js";
5
+
6
+ /**
7
+ * Validation schema
8
+ */
9
+ const user_id_schema = z.string().uuid("Invalid user ID format");
10
+
11
+ /**
12
+ * Helper to format user response
13
+ */
14
+ function format_user_response(user: any): UserResponse {
15
+ return {
16
+ id: user.id,
17
+ email: user.email,
18
+ name: user.name,
19
+ createdAt: user.createdAt.toISOString(),
20
+ updatedAt: user.updatedAt.toISOString(),
21
+ };
22
+ }
23
+
24
+ /**
25
+ * Get user by ID
26
+ * GET /users/:id
27
+ */
28
+ export async function get_user(id: string): Promise<Response> {
29
+ try {
30
+ // Validate ID format
31
+ const validation = user_id_schema.safeParse(id);
32
+ if (!validation.success) {
33
+ const errorResponse: ApiError = {
34
+ success: false,
35
+ error: "Invalid user ID",
36
+ details: validation.error.errors.map((err) => ({
37
+ field: err.path.join("."),
38
+ message: err.message,
39
+ })),
40
+ };
41
+ return Response.json(errorResponse, { status: 400 });
42
+ }
43
+
44
+ const user = await user_model.find_by_id(id);
45
+
46
+ if (!user) {
47
+ const errorResponse: ApiError = {
48
+ success: false,
49
+ error: "User not found",
50
+ };
51
+ return Response.json(errorResponse, { status: 404 });
52
+ }
53
+
54
+ const response: ApiResponse<UserResponse> = {
55
+ success: true,
56
+ data: format_user_response(user),
57
+ };
58
+
59
+ return Response.json(response);
60
+ } catch (error) {
61
+ const errorResponse: ApiError = {
62
+ success: false,
63
+ error: "Failed to fetch user",
64
+ };
65
+ return Response.json(errorResponse, { status: 500 });
66
+ }
67
+ }
@@ -0,0 +1,40 @@
1
+ import { user_model } from "../../models/user.model.js";
2
+ import type { ApiResponse, ApiError } from "../../types/common/api-response.types.js";
3
+ import type { UserResponse } from "../../types/models/user.types.js";
4
+
5
+ /**
6
+ * Helper to format user response
7
+ */
8
+ function format_user_response(user: any): UserResponse {
9
+ return {
10
+ id: user.id,
11
+ email: user.email,
12
+ name: user.name,
13
+ createdAt: user.createdAt.toISOString(),
14
+ updatedAt: user.updatedAt.toISOString(),
15
+ };
16
+ }
17
+
18
+ /**
19
+ * Get all users
20
+ * GET /users
21
+ */
22
+ export async function get_users(): Promise<Response> {
23
+ try {
24
+ const users = await user_model.find_all();
25
+ const formatted_users = users.map(format_user_response);
26
+
27
+ const response: ApiResponse<UserResponse[]> = {
28
+ success: true,
29
+ data: formatted_users,
30
+ };
31
+
32
+ return Response.json(response);
33
+ } catch (error) {
34
+ const errorResponse: ApiError = {
35
+ success: false,
36
+ error: "Failed to fetch users",
37
+ };
38
+ return Response.json(errorResponse, { status: 500 });
39
+ }
40
+ }
@@ -0,0 +1,101 @@
1
+ import { z } from "zod";
2
+ import { user_model } from "../../models/user.model.js";
3
+ import type { ApiResponse, ApiError } from "../../types/common/api-response.types.js";
4
+ import type { UserResponse } from "../../types/models/user.types.js";
5
+
6
+ /**
7
+ * Validation schemas
8
+ */
9
+ const user_id_schema = z.string().uuid("Invalid user ID format");
10
+ const update_user_schema = z.object({
11
+ email: z.string().email("Invalid email address").optional(),
12
+ name: z.string().min(2, "Name must be at least 2 characters").max(100, "Name must not exceed 100 characters").optional(),
13
+ });
14
+
15
+ /**
16
+ * Helper to format user response
17
+ */
18
+ function format_user_response(user: any): UserResponse {
19
+ return {
20
+ id: user.id,
21
+ email: user.email,
22
+ name: user.name,
23
+ createdAt: user.createdAt.toISOString(),
24
+ updatedAt: user.updatedAt.toISOString(),
25
+ };
26
+ }
27
+
28
+ /**
29
+ * Update user by ID
30
+ * PATCH /users/:id
31
+ */
32
+ export async function update_user(id: string, req: Request): Promise<Response> {
33
+ try {
34
+ const body = await req.json();
35
+
36
+ // Validate ID format
37
+ const id_validation = user_id_schema.safeParse(id);
38
+ if (!id_validation.success) {
39
+ const errorResponse: ApiError = {
40
+ success: false,
41
+ error: "Invalid user ID",
42
+ details: id_validation.error.errors.map((err) => ({
43
+ field: err.path.join("."),
44
+ message: err.message,
45
+ })),
46
+ };
47
+ return Response.json(errorResponse, { status: 400 });
48
+ }
49
+
50
+ // Validate request body
51
+ const body_validation = update_user_schema.safeParse(body);
52
+ if (!body_validation.success) {
53
+ const errorResponse: ApiError = {
54
+ success: false,
55
+ error: "Validation failed",
56
+ details: body_validation.error.errors.map((err) => ({
57
+ field: err.path.join("."),
58
+ message: err.message,
59
+ })),
60
+ };
61
+ return Response.json(errorResponse, { status: 400 });
62
+ }
63
+
64
+ // Check if email is being updated and if it already exists
65
+ if (body_validation.data.email) {
66
+ const existing_user = await user_model.find_by_email(body_validation.data.email);
67
+ if (existing_user && existing_user.id !== id) {
68
+ const errorResponse: ApiError = {
69
+ success: false,
70
+ error: "User with this email already exists",
71
+ };
72
+ return Response.json(errorResponse, { status: 409 });
73
+ }
74
+ }
75
+
76
+ // Update user
77
+ const user = await user_model.update(id, body_validation.data);
78
+
79
+ if (!user) {
80
+ const errorResponse: ApiError = {
81
+ success: false,
82
+ error: "User not found",
83
+ };
84
+ return Response.json(errorResponse, { status: 404 });
85
+ }
86
+
87
+ const response: ApiResponse<UserResponse> = {
88
+ success: true,
89
+ data: format_user_response(user),
90
+ message: "User updated successfully",
91
+ };
92
+
93
+ return Response.json(response);
94
+ } catch (error) {
95
+ const errorResponse: ApiError = {
96
+ success: false,
97
+ error: "Failed to update user",
98
+ };
99
+ return Response.json(errorResponse, { status: 500 });
100
+ }
101
+ }
@@ -6,8 +6,8 @@ import { router } from "./routes/index.js";
6
6
  /**
7
7
  * Simple router matcher for Bun native server
8
8
  */
9
- function match_route(pathname: string, method: string): Response | null {
10
- return router(pathname, method);
9
+ async function match_route(pathname: string, method: string, req: Request): Promise<Response | null> {
10
+ return await router(pathname, method, req);
11
11
  }
12
12
 
13
13
  const server = Bun.serve({
@@ -28,7 +28,7 @@ const server = Bun.serve({
28
28
  }
29
29
 
30
30
  // Match routes
31
- const response = match_route(url.pathname, req.method);
31
+ const response = await match_route(url.pathname, req.method, req);
32
32
  if (response) {
33
33
  logger(req, response, Date.now() - start);
34
34
  return response;
@@ -0,0 +1,83 @@
1
+ import type { User, CreateUserInput, UpdateUserInput } from "../types/models/user.types.js";
2
+
3
+ /**
4
+ * User model
5
+ *
6
+ * This is a simple in-memory implementation.
7
+ * Replace with your database ORM (Drizzle, Prisma, etc.) in production.
8
+ */
9
+
10
+ // In-memory storage (for demonstration)
11
+ const users: User[] = [];
12
+
13
+ export const user_model = {
14
+ /**
15
+ * Find all users
16
+ */
17
+ find_all: async (): Promise<User[]> => {
18
+ return users;
19
+ },
20
+
21
+ /**
22
+ * Find user by ID
23
+ */
24
+ find_by_id: async (id: string): Promise<User | undefined> => {
25
+ return users.find((user) => user.id === id);
26
+ },
27
+
28
+ /**
29
+ * Find user by email
30
+ */
31
+ find_by_email: async (email: string): Promise<User | undefined> => {
32
+ return users.find((user) => user.email === email);
33
+ },
34
+
35
+ /**
36
+ * Create a new user
37
+ */
38
+ create: async (input: CreateUserInput): Promise<User> => {
39
+ const user: User = {
40
+ id: crypto.randomUUID(),
41
+ email: input.email,
42
+ name: input.name,
43
+ createdAt: new Date(),
44
+ updatedAt: new Date(),
45
+ };
46
+
47
+ users.push(user);
48
+ return user;
49
+ },
50
+
51
+ /**
52
+ * Update user by ID
53
+ */
54
+ update: async (id: string, input: UpdateUserInput): Promise<User | undefined> => {
55
+ const index = users.findIndex((user) => user.id === id);
56
+
57
+ if (index === -1) {
58
+ return undefined;
59
+ }
60
+
61
+ users[index] = {
62
+ ...users[index],
63
+ ...input,
64
+ updatedAt: new Date(),
65
+ };
66
+
67
+ return users[index];
68
+ },
69
+
70
+ /**
71
+ * Delete user by ID
72
+ */
73
+ delete: async (id: string): Promise<boolean> => {
74
+ const index = users.findIndex((user) => user.id === id);
75
+
76
+ if (index === -1) {
77
+ return false;
78
+ }
79
+
80
+ users.splice(index, 1);
81
+ return true;
82
+ },
83
+ };
@@ -1,8 +1,10 @@
1
+ import { user_route } from "./user.route.js";
2
+
1
3
  /**
2
4
  * Simple router for Bun native server
3
5
  * Add your routes here
4
6
  */
5
- export function router(pathname: string, method: string): Response | null {
7
+ export async function router(pathname: string, method: string, req: Request): Promise<Response | null> {
6
8
  // GET /
7
9
  if (pathname === "/" && method === "GET") {
8
10
  return Response.json({
@@ -11,11 +13,13 @@ export function router(pathname: string, method: string): Response | null {
11
13
  });
12
14
  }
13
15
 
14
- // Add more routes here
15
- // Example:
16
- // if (pathname === "/users" && method === "GET") {
17
- // return Response.json({ users: [] });
18
- // }
16
+ // User routes
17
+ if (pathname.startsWith("/users")) {
18
+ const response = await user_route(pathname, method, req);
19
+ if (response) {
20
+ return response;
21
+ }
22
+ }
19
23
 
20
24
  return null; // No route matched
21
25
  }
@@ -0,0 +1,50 @@
1
+ import { get_users } from "../controllers/user/get-users.controller.js";
2
+ import { get_user } from "../controllers/user/get-user.controller.js";
3
+ import { create_user } from "../controllers/user/create-user.controller.js";
4
+ import { update_user } from "../controllers/user/update-user.controller.js";
5
+ import { delete_user } from "../controllers/user/delete-user.controller.js";
6
+
7
+ /**
8
+ * Helper to extract ID from path
9
+ */
10
+ function extract_id_from_path(pathname: string): string | null {
11
+ const match = pathname.match(/^\/users\/([^/]+)$/);
12
+ return match ? match[1] : null;
13
+ }
14
+
15
+ /**
16
+ * User route handler
17
+ * Handles all /users routes
18
+ */
19
+ export async function user_route(pathname: string, method: string, req: Request): Promise<Response | null> {
20
+ // GET /users
21
+ if (pathname === "/users" && method === "GET") {
22
+ return await get_users();
23
+ }
24
+
25
+ // POST /users
26
+ if (pathname === "/users" && method === "POST") {
27
+ return await create_user(req);
28
+ }
29
+
30
+ // Routes with ID parameter
31
+ const id = extract_id_from_path(pathname);
32
+ if (id) {
33
+ // GET /users/:id
34
+ if (method === "GET") {
35
+ return await get_user(id);
36
+ }
37
+
38
+ // PATCH /users/:id
39
+ if (method === "PATCH") {
40
+ return await update_user(id, req);
41
+ }
42
+
43
+ // DELETE /users/:id
44
+ if (method === "DELETE") {
45
+ return await delete_user(id);
46
+ }
47
+ }
48
+
49
+ return null;
50
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Common API response types
3
+ */
4
+
5
+ export interface ApiResponse<T = unknown> {
6
+ success: boolean;
7
+ data?: T;
8
+ error?: string;
9
+ message?: string;
10
+ }
11
+
12
+ export interface PaginatedResponse<T> extends ApiResponse<T[]> {
13
+ pagination: {
14
+ page: number;
15
+ limit: number;
16
+ total: number;
17
+ totalPages: number;
18
+ };
19
+ }
20
+
21
+ export interface ValidationError {
22
+ field: string;
23
+ message: string;
24
+ }
25
+
26
+ export interface ApiError {
27
+ success: false;
28
+ error: string;
29
+ details?: ValidationError[];
30
+ }
@@ -1,2 +1,5 @@
1
- // Add your TypeScript types and interfaces here
2
- export {};
1
+ // Export common types
2
+ export * from "./common/api-response.types.js";
3
+
4
+ // Export model types
5
+ export * from "./models/user.types.js";
@@ -0,0 +1,26 @@
1
+ /**
2
+ * User model types
3
+ */
4
+
5
+ export interface User {
6
+ id: string;
7
+ email: string;
8
+ name: string;
9
+ createdAt: Date;
10
+ updatedAt: Date;
11
+ }
12
+
13
+ export interface CreateUserInput {
14
+ email: string;
15
+ name: string;
16
+ }
17
+
18
+ export interface UpdateUserInput {
19
+ email?: string;
20
+ name?: string;
21
+ }
22
+
23
+ export type UserResponse = Omit<User, "createdAt" | "updatedAt"> & {
24
+ createdAt: string;
25
+ updatedAt: string;
26
+ };
@@ -1,3 +1,3 @@
1
1
  # Server Configuration
2
- PORT=3000
2
+ PORT=8000
3
3
  NODE_ENV=development