Skip to content

Commit 1efa896

Browse files
authored
Merge pull request #23 from PFConnect/ts-migration
Ts migration
2 parents 052fdb9 + 9d061af commit 1efa896

File tree

121 files changed

+9045
-7820
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+9045
-7820
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ POSTGRES_DB_URL_FLIGHTS=postgresql://
66
POSTGRES_DB_URL_CHATS=postgresql://
77
POSTGRES_DB_PW=
88
DB_ENCRYPTION_KEY=
9+
REDIS_URL=redis://
910

1011
DISCORD_CLIENT_ID=
1112
DISCORD_CLIENT_SECRET=

.prettierrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"singleQuote": true,
3-
"tabWidth": 4,
4-
"trailingComma": "es5"
2+
"singleQuote": true,
3+
"tabWidth": 2,
4+
"trailingComma": "es5"
55
}

Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# filepath: c:\Users\rcxga\OneDrive\Desktop\CODE\PFConnect\pfcontrol-2\Dockerfile
12
# Multi-stage build for PFControl v2
23
FROM node:20-alpine AS builder
34

@@ -16,7 +17,10 @@ COPY . .
1617
# Copy frontend env for Vite build
1718
COPY .env.vite.production .env.production
1819

19-
# Build the application
20+
# Build the backend (TypeScript compilation)
21+
RUN npm run build:server
22+
23+
# Build the application (frontend)
2024
RUN npm run build
2125

2226
# Production stage
@@ -27,7 +31,7 @@ RUN apk add --no-cache dumb-init
2731

2832
# Create app user for security
2933
RUN addgroup -g 1001 -S nodejs && \
30-
adduser -S nodeuser -u 1001
34+
adduser -S nodeuser -u 1001
3135

3236
# Set working directory
3337
WORKDIR /app
@@ -41,7 +45,7 @@ RUN npm ci --omit=dev && npm cache clean --force
4145
# Copy built application from builder stage
4246
COPY --from=builder --chown=nodeuser:nodejs /app/dist ./dist
4347
COPY --from=builder --chown=nodeuser:nodejs /app/public ./public
44-
COPY --from=builder --chown=nodeuser:nodejs /app/server ./server
48+
COPY --from=builder --chown=nodeuser:nodejs /app/server/dist ./server/dist
4549

4650
# Create logs directory
4751
RUN mkdir -p logs && chown nodeuser:nodejs logs
@@ -54,8 +58,8 @@ EXPOSE 9900
5458

5559
# Health check
5660
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
57-
CMD node -e "require('http').get('http://localhost:9900/api/data/airports', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))"
61+
CMD node -e "require('http').get('http://localhost:9900/api/data/airports', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))"
5862

5963
# Start the application
6064
ENTRYPOINT ["dumb-init", "--"]
61-
CMD ["node", "server/server.js"]
65+
CMD ["node", "server/dist/main.js"]

nodemon.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"watch": ["server"],
3+
"ext": "ts,json",
4+
"exec": "tsx server/main.ts"
5+
}

0 commit comments

Comments
 (0)