Compare commits
2 Commits
5ff3393f54
...
08d6727dca
Author | SHA1 | Date | |
---|---|---|---|
![]() |
08d6727dca | ||
![]() |
d767108fcf |
@@ -43,6 +43,7 @@
|
|||||||
"@next-auth/prisma-adapter": "^1.0.7",
|
"@next-auth/prisma-adapter": "^1.0.7",
|
||||||
"@prisma/adapter-pg": "^6.8.2",
|
"@prisma/adapter-pg": "^6.8.2",
|
||||||
"@prisma/client": "^5.6.0",
|
"@prisma/client": "^5.6.0",
|
||||||
|
"@types/bcrypt": "^5.0.2",
|
||||||
"bcrypt": "^5.1.1",
|
"bcrypt": "^5.1.1",
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
|
@@ -1144,6 +1144,7 @@ model EventReview {
|
|||||||
eventItemId String?
|
eventItemId String?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE: need to consider with Event
|
||||||
// mapped to IEventItem
|
// mapped to IEventItem
|
||||||
model EventItem {
|
model EventItem {
|
||||||
id String @id @default(uuid())
|
id String @id @default(uuid())
|
||||||
|
12
03_source/cms_backend/scripts/10_build.sh
Executable file
12
03_source/cms_backend/scripts/10_build.sh
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
yarn db:push
|
||||||
|
|
||||||
|
npx nodemon --ext ts,tsx --exec "yarn tsc"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# yarn build
|
||||||
|
|
5
03_source/cms_backend/scripts/20_prod.sh
Executable file
5
03_source/cms_backend/scripts/20_prod.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
npm run start
|
@@ -10,7 +10,8 @@ import type { NextRequest } from 'next/server';
|
|||||||
|
|
||||||
import { STATUS, response, handleError } from 'src/utils/response';
|
import { STATUS, response, handleError } from 'src/utils/response';
|
||||||
|
|
||||||
import { AccessLogService } from '../../../../modules/AccessLog/AccessLog.service';
|
// import { AccessLogService } from '../../../../modules/AccessLog/AccessLog.service';
|
||||||
|
import { getAccessLogById } from 'src/app/services/AccessLog.service';
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ export async function GET(req: NextRequest) {
|
|||||||
const accessLogId = searchParams.get('accessLogId');
|
const accessLogId = searchParams.get('accessLogId');
|
||||||
if (!accessLogId) return response({ message: 'accessLogId is required!' }, STATUS.BAD_REQUEST);
|
if (!accessLogId) return response({ message: 'accessLogId is required!' }, STATUS.BAD_REQUEST);
|
||||||
|
|
||||||
const accessLog = await AccessLogService.findById(accessLogId);
|
const accessLog = await getAccessLogById(accessLogId);
|
||||||
|
|
||||||
if (!accessLog) return response({ message: 'AccessLog not found!' }, STATUS.NOT_FOUND);
|
if (!accessLog) return response({ message: 'AccessLog not found!' }, STATUS.NOT_FOUND);
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@ import type { NextRequest, NextResponse } from 'next/server';
|
|||||||
|
|
||||||
import { STATUS, response, handleError } from 'src/utils/response';
|
import { STATUS, response, handleError } from 'src/utils/response';
|
||||||
|
|
||||||
import { listAppLogs, deleteAppLog, updateAppLog, createNewAppLog } from 'src/app/services/AppLog.service';
|
import { listAppLogs, deleteAppLog, createNewAppLog } from 'src/app/services/AppLog.service';
|
||||||
|
|
||||||
// import prisma from '../../lib/prisma';
|
// import prisma from '../../lib/prisma';
|
||||||
|
|
||||||
@@ -34,28 +34,29 @@ export async function POST(req: NextRequest) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// TODO: delete `update AppLog`
|
||||||
***************************************
|
// /**
|
||||||
* PUT - update AppLog
|
// ***************************************
|
||||||
***************************************
|
// * PUT - update AppLog
|
||||||
*/
|
// ***************************************
|
||||||
export async function PUT(req: NextRequest) {
|
// */
|
||||||
const { searchParams } = req.nextUrl;
|
// export async function PUT(req: NextRequest) {
|
||||||
const appLogId = searchParams.get('appLogId');
|
// const { searchParams } = req.nextUrl;
|
||||||
|
// const appLogId = searchParams.get('appLogId');
|
||||||
|
|
||||||
const { data } = await req.json();
|
// const { data } = await req.json();
|
||||||
|
|
||||||
try {
|
// try {
|
||||||
if (!appLogId) throw new Error('appLogId cannot null');
|
// if (!appLogId) throw new Error('appLogId cannot null');
|
||||||
const id: number = parseInt(appLogId);
|
// const id: number = parseInt(appLogId);
|
||||||
|
|
||||||
const updateResult = await updateAppLog(id, data);
|
// const updateResult = await updateAppLog(id, data);
|
||||||
|
|
||||||
return response(updateResult, STATUS.OK);
|
// return response(updateResult, STATUS.OK);
|
||||||
} catch (error) {
|
// } catch (error) {
|
||||||
return handleError('AppLog - Update', error);
|
// return handleError('AppLog - Update', error);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
***************************************
|
***************************************
|
||||||
@@ -72,7 +73,7 @@ export async function DELETE(req: NextRequest) {
|
|||||||
if (!appLogId) throw new Error('appLogId cannot null');
|
if (!appLogId) throw new Error('appLogId cannot null');
|
||||||
const id: number = parseInt(appLogId);
|
const id: number = parseInt(appLogId);
|
||||||
|
|
||||||
const deleteResult = await deleteAppLog(id);
|
const deleteResult = await deleteAppLog(id.toString());
|
||||||
|
|
||||||
return response(deleteResult, STATUS.OK);
|
return response(deleteResult, STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@@ -7,29 +7,28 @@ import { _events } from 'src/_mock/_event';
|
|||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
||||||
export const runtime = 'edge';
|
// export const runtime = 'edge';
|
||||||
|
|
||||||
/** **************************************
|
/** **************************************
|
||||||
* GET - Search events
|
* GET - Search events
|
||||||
*************************************** */
|
*************************************** */
|
||||||
export async function GET(req: NextRequest) {
|
export async function GET(req: NextRequest) {
|
||||||
try {
|
// try {
|
||||||
const { searchParams } = req.nextUrl;
|
//
|
||||||
const query = searchParams.get('query')?.trim().toLowerCase();
|
// TODO: implement search events
|
||||||
|
//
|
||||||
|
// const { searchParams } = req.nextUrl;
|
||||||
|
// const query = searchParams.get('query')?.trim().toLowerCase();
|
||||||
|
// if (!query) {
|
||||||
|
// return response({ results: [] }, STATUS.OK);
|
||||||
|
// }
|
||||||
|
// const events = _events();
|
||||||
|
// // Accept search by name or sku
|
||||||
|
// const results = events.filter(({ name, sku }) => name.toLowerCase().includes(query) || sku?.toLowerCase().includes(query));
|
||||||
|
// logger('[Event] search-results', results.length);
|
||||||
|
// return response({ results }, STATUS.OK);
|
||||||
|
|
||||||
if (!query) {
|
// } catch (error) {
|
||||||
return response({ results: [] }, STATUS.OK);
|
return handleError('Event - Get search not implemented', {});
|
||||||
}
|
// }
|
||||||
|
|
||||||
const events = _events();
|
|
||||||
|
|
||||||
// Accept search by name or sku
|
|
||||||
const results = events.filter(({ name, sku }) => name.toLowerCase().includes(query) || sku?.toLowerCase().includes(query));
|
|
||||||
|
|
||||||
logger('[Event] search-results', results.length);
|
|
||||||
|
|
||||||
return response({ results }, STATUS.OK);
|
|
||||||
} catch (error) {
|
|
||||||
return handleError('Event - Get search', error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,7 @@ export async function POST(req: NextRequest) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const order = await createOrder(data);
|
const order = await createOrder(data);
|
||||||
return response(order, STATUS.CREATED);
|
return response(order, STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleError('Order - Create', error);
|
return handleError('Order - Create', error);
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,7 @@ export async function PUT(req: NextRequest) {
|
|||||||
if (!orderId) throw new Error('orderId cannot be null');
|
if (!orderId) throw new Error('orderId cannot be null');
|
||||||
const id: number = parseInt(orderId);
|
const id: number = parseInt(orderId);
|
||||||
|
|
||||||
const updatedOrder = await updateOrder(id, data);
|
const updatedOrder = await updateOrder(id.toString(), data);
|
||||||
return response(updatedOrder, STATUS.OK);
|
return response(updatedOrder, STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleError('Order - Update', error);
|
return handleError('Order - Update', error);
|
||||||
@@ -68,7 +68,7 @@ export async function DELETE(req: NextRequest) {
|
|||||||
if (!orderId) throw new Error('orderId cannot be null');
|
if (!orderId) throw new Error('orderId cannot be null');
|
||||||
const id: number = parseInt(orderId);
|
const id: number = parseInt(orderId);
|
||||||
|
|
||||||
await deleteOrder(id);
|
await deleteOrder(id.toString());
|
||||||
return response({ success: true }, STATUS.OK);
|
return response({ success: true }, STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleError('Order - Delete', error);
|
return handleError('Order - Delete', error);
|
||||||
|
@@ -24,13 +24,14 @@ export async function GET(req: NextRequest, res: NextResponse) {
|
|||||||
***************************************
|
***************************************
|
||||||
*/
|
*/
|
||||||
export async function POST(req: NextRequest) {
|
export async function POST(req: NextRequest) {
|
||||||
|
const OPERATION = 'Product - Create';
|
||||||
const { data } = await req.json();
|
const { data } = await req.json();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const product = await createProduct(data);
|
const product = await createProduct(data);
|
||||||
return response(product, STATUS.CREATED);
|
return response(OPERATION, STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleError('Product - Create', error);
|
return handleError(OPERATION, error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
import prisma from '@/lib/prisma';
|
|
||||||
import { NextResponse } from 'next/server';
|
import { NextResponse } from 'next/server';
|
||||||
|
|
||||||
|
import prisma from 'src/app/lib/prisma';
|
||||||
|
|
||||||
// GET: 获取所有学生
|
// GET: 获取所有学生
|
||||||
export async function GET() {
|
export async function GET() {
|
||||||
try {
|
try {
|
||||||
|
@@ -14,8 +14,8 @@ export async function GET(req: NextRequest, res: NextResponse) {
|
|||||||
if (!userId) throw new Error('userId cannot be null');
|
if (!userId) throw new Error('userId cannot be null');
|
||||||
const result = await isAdmin(userId);
|
const result = await isAdmin(userId);
|
||||||
|
|
||||||
return response(result, STATUS.OK);
|
return response(result ? 'true' : 'false', STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleError('Post - Get latest', error);
|
return handleError('GET - checkAdmin', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,8 +14,8 @@ export async function GET(req: NextRequest, res: NextResponse) {
|
|||||||
if (!userId) throw new Error('userId cannot be null');
|
if (!userId) throw new Error('userId cannot be null');
|
||||||
const result = await isAdmin(userId);
|
const result = await isAdmin(userId);
|
||||||
|
|
||||||
return response(result, STATUS.OK);
|
return response('GET - helloworld', STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleError('Post - Get latest', error);
|
return handleError('GET - helloworld', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -22,14 +22,17 @@ export async function GET(req: NextRequest, res: NextResponse) {
|
|||||||
***************************************
|
***************************************
|
||||||
*/
|
*/
|
||||||
export async function POST(req: NextRequest) {
|
export async function POST(req: NextRequest) {
|
||||||
|
const OPERATION = 'User - Create';
|
||||||
const { data } = await req.json();
|
const { data } = await req.json();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const createResult = await createNewUser(data);
|
// TODO: temporary ignore output from function due to `createNewUser` is still a dummy
|
||||||
|
// const createResult = await createNewUser(data);
|
||||||
|
await createNewUser(data);
|
||||||
|
|
||||||
return response(createResult, STATUS.OK);
|
return response(OPERATION, STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleError('User - Create', error);
|
return handleError(OPERATION, error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +51,7 @@ export async function PUT(req: NextRequest) {
|
|||||||
if (!userId) throw new Error('userId cannot null');
|
if (!userId) throw new Error('userId cannot null');
|
||||||
const id: number = parseInt(userId);
|
const id: number = parseInt(userId);
|
||||||
|
|
||||||
const updateResult = await updateUser(id, data);
|
const updateResult = await updateUser(id.toString(), data);
|
||||||
|
|
||||||
return response(updateResult, STATUS.OK);
|
return response(updateResult, STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -71,10 +74,10 @@ export async function DELETE(req: NextRequest) {
|
|||||||
if (!userId) throw new Error('userId cannot null');
|
if (!userId) throw new Error('userId cannot null');
|
||||||
const id: number = parseInt(userId);
|
const id: number = parseInt(userId);
|
||||||
|
|
||||||
const deleteResult = await deleteUser(id);
|
await deleteUser(id);
|
||||||
|
|
||||||
return response(deleteResult, STATUS.OK);
|
return response('User - Delete', STATUS.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleError('User - Update', error);
|
return handleError('User - Delete', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -30,10 +30,15 @@ async function listAccessLogs(): Promise<AccessLog[]> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: obsoleted getAccessLog, use getAccessLogById instead
|
||||||
async function getAccessLog(id: string): Promise<AccessLog | null> {
|
async function getAccessLog(id: string): Promise<AccessLog | null> {
|
||||||
return prisma.accessLog.findUnique({ where: { id } });
|
return prisma.accessLog.findUnique({ where: { id } });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function getAccessLogById(id: string): Promise<AccessLog | null> {
|
||||||
|
return prisma.accessLog.findUnique({ where: { id } });
|
||||||
|
}
|
||||||
|
|
||||||
async function createAccessLog(userId?: string, message?: string, metadata?: Record<string, any>): Promise<AccessLog> {
|
async function createAccessLog(userId?: string, message?: string, metadata?: Record<string, any>): Promise<AccessLog> {
|
||||||
return prisma.accessLog.create({
|
return prisma.accessLog.create({
|
||||||
data: {
|
data: {
|
||||||
@@ -44,6 +49,10 @@ async function createAccessLog(userId?: string, message?: string, metadata?: Rec
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function helloworld(): string {
|
||||||
|
return 'helloworld';
|
||||||
|
}
|
||||||
|
|
||||||
// async function update(id: string, data: UpdateAccessLog): Promise<AccessLog> {
|
// async function update(id: string, data: UpdateAccessLog): Promise<AccessLog> {
|
||||||
// return prisma.accessLog.update({
|
// return prisma.accessLog.update({
|
||||||
// where: { id },
|
// where: { id },
|
||||||
@@ -63,4 +72,7 @@ export {
|
|||||||
getAccessLog,
|
getAccessLog,
|
||||||
listAccessLogs,
|
listAccessLogs,
|
||||||
createAccessLog,
|
createAccessLog,
|
||||||
|
getAccessLogById,
|
||||||
|
//
|
||||||
|
helloworld,
|
||||||
};
|
};
|
||||||
|
@@ -6,11 +6,14 @@
|
|||||||
// RULES:
|
// RULES:
|
||||||
// - Follows same pattern as helloworld.service.ts
|
// - Follows same pattern as helloworld.service.ts
|
||||||
//
|
//
|
||||||
|
import type { Event } from '@prisma/client';
|
||||||
|
|
||||||
|
import prisma from '../lib/prisma';
|
||||||
|
|
||||||
type CreateEvent = {
|
type CreateEvent = {
|
||||||
eventDate: DateTime;
|
eventDate: Date;
|
||||||
title: string;
|
title: string;
|
||||||
joinMembers?: Json[];
|
joinMembers?: JSON[];
|
||||||
price: number;
|
price: number;
|
||||||
currency: string;
|
currency: string;
|
||||||
duration_m: number;
|
duration_m: number;
|
||||||
@@ -22,9 +25,9 @@ type CreateEvent = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type UpdateEvent = {
|
type UpdateEvent = {
|
||||||
eventDate?: DateTime;
|
eventDate?: Date;
|
||||||
title?: string;
|
title?: string;
|
||||||
joinMembers?: Json[];
|
joinMembers?: JSON[];
|
||||||
price?: number;
|
price?: number;
|
||||||
currency?: string;
|
currency?: string;
|
||||||
duration_m?: number;
|
duration_m?: number;
|
||||||
@@ -35,9 +38,9 @@ type UpdateEvent = {
|
|||||||
memberId?: number;
|
memberId?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
// async function listEvents(): Promise<Event[]> {
|
async function listEvents(): Promise<Event[]> {
|
||||||
// return prisma.event.findMany();
|
return prisma.event.findMany();
|
||||||
// }
|
}
|
||||||
|
|
||||||
// async function getEvent(eventId: number) {
|
// async function getEvent(eventId: number) {
|
||||||
// return prisma.event.findFirst({ where: { id: eventId } });
|
// return prisma.event.findFirst({ where: { id: eventId } });
|
||||||
|
@@ -12,9 +12,9 @@ import type { EventItem } from '@prisma/client';
|
|||||||
import prisma from '../lib/prisma';
|
import prisma from '../lib/prisma';
|
||||||
|
|
||||||
type CreateEvent = {
|
type CreateEvent = {
|
||||||
eventDate: DateTime;
|
eventDate: Date;
|
||||||
title: string;
|
title: string;
|
||||||
joinMembers?: Json[];
|
joinMembers?: JSON[];
|
||||||
price: number;
|
price: number;
|
||||||
currency: string;
|
currency: string;
|
||||||
duration_m: number;
|
duration_m: number;
|
||||||
@@ -26,9 +26,9 @@ type CreateEvent = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type UpdateEvent = {
|
type UpdateEvent = {
|
||||||
eventDate?: DateTime;
|
eventDate?: Date;
|
||||||
title?: string;
|
title?: string;
|
||||||
joinMembers?: Json[];
|
joinMembers?: JSON[];
|
||||||
price?: number;
|
price?: number;
|
||||||
currency?: string;
|
currency?: string;
|
||||||
duration_m?: number;
|
duration_m?: number;
|
||||||
|
@@ -11,9 +11,24 @@ import type { OrderItem } from '@prisma/client';
|
|||||||
import prisma from '../lib/prisma';
|
import prisma from '../lib/prisma';
|
||||||
|
|
||||||
type CreateOrderItem = {
|
type CreateOrderItem = {
|
||||||
orderNumber?: string;
|
// orderNumber?: string;
|
||||||
// status?: string;
|
// status?: string;
|
||||||
// eventIds?: number[];
|
// eventIds?: number[];
|
||||||
|
|
||||||
|
taxes: number;
|
||||||
|
status: string;
|
||||||
|
shipping: number;
|
||||||
|
discount: number;
|
||||||
|
subtotal: number;
|
||||||
|
orderNumber: string;
|
||||||
|
totalAmount: number;
|
||||||
|
totalQuantity: number;
|
||||||
|
history: Record<string, any>;
|
||||||
|
payment: Record<string, any>;
|
||||||
|
customer: Record<string, any>;
|
||||||
|
delivery: Record<string, any>;
|
||||||
|
items: Record<string, any>[];
|
||||||
|
shippingAddress: Record<string, any>;
|
||||||
};
|
};
|
||||||
|
|
||||||
type UpdateOrderItem = {
|
type UpdateOrderItem = {
|
||||||
|
@@ -38,7 +38,7 @@ async function getUserItem(userId: string): Promise<UserItem | null> {
|
|||||||
return prisma.userItem.findFirst({ where: { id: userId } });
|
return prisma.userItem.findFirst({ where: { id: userId } });
|
||||||
}
|
}
|
||||||
|
|
||||||
async function updateUser(userId: string, updateForm: UpdateUser): Promise<User> {
|
async function updateUser(userId: string, updateForm: UpdateUser): Promise<UserItem> {
|
||||||
return prisma.userItem.update({
|
return prisma.userItem.update({
|
||||||
where: { id: userId },
|
where: { id: userId },
|
||||||
data: updateForm,
|
data: updateForm,
|
||||||
@@ -82,7 +82,7 @@ async function changeToUser(userIdToPromote: string, userIdOfApplicant: string)
|
|||||||
return promoteResult;
|
return promoteResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getUserById1(id: string): Promise<UserItem | null> {
|
async function getUserById(id: string): Promise<UserItem | null> {
|
||||||
return prisma.userItem.findFirst({ where: { id } });
|
return prisma.userItem.findFirst({ where: { id } });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -43,7 +43,8 @@
|
|||||||
"**/*.draft",
|
"**/*.draft",
|
||||||
"**/*.log",
|
"**/*.log",
|
||||||
"**/*.tmp",
|
"**/*.tmp",
|
||||||
"**/*del"
|
"**/*del",
|
||||||
|
"prisma/*"
|
||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"next-env.d.ts",
|
"next-env.d.ts",
|
||||||
|
@@ -770,6 +770,13 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
tslib "^2.4.0"
|
tslib "^2.4.0"
|
||||||
|
|
||||||
|
"@types/bcrypt@^5.0.2":
|
||||||
|
version "5.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/bcrypt/-/bcrypt-5.0.2.tgz#22fddc11945ea4fbc3655b3e8b8847cc9f811477"
|
||||||
|
integrity sha512-6atioO8Y75fNcbmj0G7UjI9lXN2pQ/IGJ2FWT4a/btd0Lk9lQalHLKhkgKVZ3r+spnmWUKfbMi1GEe9wyHQfNQ==
|
||||||
|
dependencies:
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
"@types/estree@^1.0.6":
|
"@types/estree@^1.0.6":
|
||||||
version "1.0.7"
|
version "1.0.7"
|
||||||
resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz"
|
resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz"
|
||||||
@@ -790,6 +797,13 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.17.tgz#fb85a04f47e9e4da888384feead0de05f7070355"
|
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.17.tgz#fb85a04f47e9e4da888384feead0de05f7070355"
|
||||||
integrity sha512-RRVJ+J3J+WmyOTqnz3PiBLA501eKwXl2noseKOrNo/6+XEHjTAxO4xHvxQB6QuNm+s4WRbn6rSiap8+EA+ykFQ==
|
integrity sha512-RRVJ+J3J+WmyOTqnz3PiBLA501eKwXl2noseKOrNo/6+XEHjTAxO4xHvxQB6QuNm+s4WRbn6rSiap8+EA+ykFQ==
|
||||||
|
|
||||||
|
"@types/node@*":
|
||||||
|
version "24.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-24.0.1.tgz#e9bfcb1c35547437c294403b7bec497772a88b0a"
|
||||||
|
integrity sha512-MX4Zioh39chHlDJbKmEgydJDS3tspMP/lnQC67G3SWsTnb9NeYVWOjkxpOSy4oMfPs4StcWHwBrvUb4ybfnuaw==
|
||||||
|
dependencies:
|
||||||
|
undici-types "~7.8.0"
|
||||||
|
|
||||||
"@types/node@^22.13.13":
|
"@types/node@^22.13.13":
|
||||||
version "22.13.13"
|
version "22.13.13"
|
||||||
resolved "https://registry.npmjs.org/@types/node/-/node-22.13.13.tgz"
|
resolved "https://registry.npmjs.org/@types/node/-/node-22.13.13.tgz"
|
||||||
@@ -3486,6 +3500,11 @@ undici-types@~6.20.0:
|
|||||||
resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz"
|
resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz"
|
||||||
integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==
|
integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==
|
||||||
|
|
||||||
|
undici-types@~7.8.0:
|
||||||
|
version "7.8.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.8.0.tgz#de00b85b710c54122e44fbfd911f8d70174cd294"
|
||||||
|
integrity sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==
|
||||||
|
|
||||||
unique-names-generator@^4.7.1:
|
unique-names-generator@^4.7.1:
|
||||||
version "4.7.1"
|
version "4.7.1"
|
||||||
resolved "https://registry.yarnpkg.com/unique-names-generator/-/unique-names-generator-4.7.1.tgz#966407b12ba97f618928f77322cfac8c80df5597"
|
resolved "https://registry.yarnpkg.com/unique-names-generator/-/unique-names-generator-4.7.1.tgz#966407b12ba97f618928f77322cfac8c80df5597"
|
||||||
|
@@ -11,8 +11,8 @@ services:
|
|||||||
- 10001:8080
|
- 10001:8080
|
||||||
volumes:
|
volumes:
|
||||||
- ../frontend:/app
|
- ../frontend:/app
|
||||||
working_dir: '/app'
|
working_dir: "/app"
|
||||||
command: './dev.sh'
|
command: "./scripts/20_prod.sh"
|
||||||
|
|
||||||
mobile:
|
mobile:
|
||||||
image: 192.168.10.61:5000/hksingleparty_mobile
|
image: 192.168.10.61:5000/hksingleparty_mobile
|
||||||
@@ -22,8 +22,8 @@ services:
|
|||||||
- 10004:3000
|
- 10004:3000
|
||||||
volumes:
|
volumes:
|
||||||
- ../mobile:/app
|
- ../mobile:/app
|
||||||
working_dir: '/app'
|
working_dir: "/app"
|
||||||
command: './dev.sh'
|
command: "./scripts/20_prod.sh"
|
||||||
|
|
||||||
cms_backend:
|
cms_backend:
|
||||||
image: 192.168.10.61:5000/demo_minimal_kit_backend
|
image: 192.168.10.61:5000/demo_minimal_kit_backend
|
||||||
@@ -36,8 +36,8 @@ services:
|
|||||||
- 10003:5555
|
- 10003:5555
|
||||||
volumes:
|
volumes:
|
||||||
- ../cms_backend:/app
|
- ../cms_backend:/app
|
||||||
working_dir: '/app'
|
working_dir: "/app"
|
||||||
command: './dev.sh'
|
command: "./scripts/20_prod.sh"
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:14.1-alpine
|
image: postgres:14.1-alpine
|
||||||
@@ -45,6 +45,6 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
expose:
|
expose:
|
||||||
- '5432'
|
- "5432"
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/postgresql/data
|
- db:/var/lib/postgresql/data
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
yarn --dev
|
yarn --dev
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
|
||||||
# yarn tsc:print
|
# yarn tsc:print
|
||||||
yarn lint:print
|
yarn lint:print
|
||||||
|
|
3
03_source/frontend/scripts/10_build.sh
Executable file
3
03_source/frontend/scripts/10_build.sh
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
yarn build
|
10
03_source/frontend/scripts/20_prod.sh
Executable file
10
03_source/frontend/scripts/20_prod.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
yarn build
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
yarn start
|
||||||
|
|
||||||
|
echo "restarting..."
|
||||||
|
sleep 1
|
||||||
|
done
|
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
@@ -10,10 +10,7 @@ set -ex
|
|||||||
|
|
||||||
npm run format
|
npm run format
|
||||||
|
|
||||||
git add .
|
|
||||||
|
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
git commit -m"build ok,"
|
|
||||||
|
|
||||||
echo "done"
|
echo "done"
|
5
03_source/mobile/scripts/20_prod.sh
Executable file
5
03_source/mobile/scripts/20_prod.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
npm run start
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user