Spaces:
Paused
Paused
Upload 52 files
Browse files- Dockerfile +6 -6
- package.json +29 -24
- tsconfig.json +3 -3
Dockerfile
CHANGED
|
@@ -10,8 +10,8 @@ RUN apk add --no-cache python3 make g++
|
|
| 10 |
# Copy package files
|
| 11 |
COPY package*.json ./
|
| 12 |
|
| 13 |
-
# Install
|
| 14 |
-
RUN npm
|
| 15 |
|
| 16 |
# Copy source code
|
| 17 |
COPY . .
|
|
@@ -28,10 +28,10 @@ WORKDIR /app
|
|
| 28 |
RUN addgroup -g 1001 -S nodejs && \
|
| 29 |
adduser -S nextjs -u 1001 -G nodejs
|
| 30 |
|
| 31 |
-
# Copy package files
|
| 32 |
-
COPY
|
| 33 |
|
| 34 |
-
# Install production dependencies only
|
| 35 |
RUN npm ci --only=production && \
|
| 36 |
npm cache clean --force
|
| 37 |
|
|
@@ -48,7 +48,7 @@ RUN mkdir -p /app/data/users /app/data/channels /app/data/votes /app/data/bans /
|
|
| 48 |
USER nextjs
|
| 49 |
|
| 50 |
# Expose port
|
| 51 |
-
EXPOSE
|
| 52 |
|
| 53 |
# Health check
|
| 54 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
|
|
| 10 |
# Copy package files
|
| 11 |
COPY package*.json ./
|
| 12 |
|
| 13 |
+
# Install dependencies
|
| 14 |
+
RUN npm ci --only=production=false
|
| 15 |
|
| 16 |
# Copy source code
|
| 17 |
COPY . .
|
|
|
|
| 28 |
RUN addgroup -g 1001 -S nodejs && \
|
| 29 |
adduser -S nextjs -u 1001 -G nodejs
|
| 30 |
|
| 31 |
+
# Copy package files
|
| 32 |
+
COPY package*.json ./
|
| 33 |
|
| 34 |
+
# Install production dependencies only
|
| 35 |
RUN npm ci --only=production && \
|
| 36 |
npm cache clean --force
|
| 37 |
|
|
|
|
| 48 |
USER nextjs
|
| 49 |
|
| 50 |
# Expose port
|
| 51 |
+
EXPOSE 3000
|
| 52 |
|
| 53 |
# Health check
|
| 54 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
{
|
| 2 |
-
"name": "whatsapp-channel
|
| 3 |
"version": "1.0.0",
|
| 4 |
-
"description": "
|
| 5 |
"type": "module",
|
| 6 |
-
"main": "
|
| 7 |
"scripts": {
|
| 8 |
"dev": "tsx watch src/app.ts",
|
| 9 |
"build": "tsc",
|
|
@@ -13,43 +13,48 @@
|
|
| 13 |
"worker:cleanup": "tsx watch workers/cleanupWorker.ts",
|
| 14 |
"docker:build": "docker build -t whatsapp-channel .",
|
| 15 |
"docker:up": "docker compose up -d",
|
| 16 |
-
"docker:down": "docker compose down"
|
|
|
|
| 17 |
},
|
| 18 |
"dependencies": {
|
| 19 |
"@fastify/cookie": "^9.3.1",
|
| 20 |
"@fastify/cors": "^9.0.1",
|
| 21 |
-
"@fastify/csrf-protection": "^6.
|
| 22 |
-
"@fastify/
|
|
|
|
| 23 |
"@fastify/rate-limit": "^9.1.0",
|
| 24 |
"@fastify/session": "^10.9.0",
|
| 25 |
"@fastify/static": "^7.0.3",
|
| 26 |
"@fastify/view": "^9.1.0",
|
| 27 |
-
"@
|
| 28 |
-
"
|
| 29 |
-
"
|
| 30 |
-
"
|
| 31 |
-
"
|
|
|
|
|
|
|
| 32 |
"dotenv": "^16.4.5",
|
| 33 |
-
"fastify": "^4.28.
|
|
|
|
| 34 |
"groq-sdk": "^0.5.0",
|
| 35 |
-
"
|
| 36 |
-
"js-yaml": "^4.1.0",
|
| 37 |
"nanoid": "^5.0.7",
|
| 38 |
-
"nanoid-dictionary": "^
|
| 39 |
"nunjucks": "^3.2.4",
|
|
|
|
|
|
|
|
|
|
| 40 |
"p-limit": "^6.1.0",
|
| 41 |
-
"
|
| 42 |
-
"
|
| 43 |
-
"
|
| 44 |
},
|
| 45 |
"devDependencies": {
|
| 46 |
-
"@types/node": "^
|
| 47 |
"@types/nunjucks": "^3.2.6",
|
| 48 |
-
"@types/
|
| 49 |
-
"
|
| 50 |
-
"
|
| 51 |
-
"tsx": "^4.19.0",
|
| 52 |
-
"typescript": "^5.5.4"
|
| 53 |
},
|
| 54 |
"engines": {
|
| 55 |
"node": ">=20.0.0"
|
|
|
|
| 1 |
{
|
| 2 |
+
"name": "whatsapp-channel",
|
| 3 |
"version": "1.0.0",
|
| 4 |
+
"description": "WhatsApp Channel Directory with scraping, AI moderation, and HTMX frontend",
|
| 5 |
"type": "module",
|
| 6 |
+
"main": "src/app.ts",
|
| 7 |
"scripts": {
|
| 8 |
"dev": "tsx watch src/app.ts",
|
| 9 |
"build": "tsc",
|
|
|
|
| 13 |
"worker:cleanup": "tsx watch workers/cleanupWorker.ts",
|
| 14 |
"docker:build": "docker build -t whatsapp-channel .",
|
| 15 |
"docker:up": "docker compose up -d",
|
| 16 |
+
"docker:down": "docker compose down",
|
| 17 |
+
"db:seed": "tsx scripts/seedAdmin.ts"
|
| 18 |
},
|
| 19 |
"dependencies": {
|
| 20 |
"@fastify/cookie": "^9.3.1",
|
| 21 |
"@fastify/cors": "^9.0.1",
|
| 22 |
+
"@fastify/csrf-protection": "^6.0.1",
|
| 23 |
+
"@fastify/formbody": "^7.4.0",
|
| 24 |
+
"@fastify/multipart": "^8.2.0",
|
| 25 |
"@fastify/rate-limit": "^9.1.0",
|
| 26 |
"@fastify/session": "^10.9.0",
|
| 27 |
"@fastify/static": "^7.0.3",
|
| 28 |
"@fastify/view": "^9.1.0",
|
| 29 |
+
"@hcaptcha/hcaptcha-node": "^1.0.0",
|
| 30 |
+
"@huggingface/inference": "^2.8.0",
|
| 31 |
+
"@huggingface/hub": "^0.12.0",
|
| 32 |
+
"argon2": "^0.40.3",
|
| 33 |
+
"axios": "^1.7.2",
|
| 34 |
+
"cheerio": "^1.0.0-rc.12",
|
| 35 |
+
"date-fns": "^3.6.0",
|
| 36 |
"dotenv": "^16.4.5",
|
| 37 |
+
"fastify": "^4.28.0",
|
| 38 |
+
"fastify-plugin": "^4.5.1",
|
| 39 |
"groq-sdk": "^0.5.0",
|
| 40 |
+
"ip": "^2.0.1",
|
|
|
|
| 41 |
"nanoid": "^5.0.7",
|
| 42 |
+
"nanoid-dictionary": "^5.0.0",
|
| 43 |
"nunjucks": "^3.2.4",
|
| 44 |
+
"pino": "^9.1.0",
|
| 45 |
+
"pino-pretty": "^11.2.1",
|
| 46 |
+
"pino-roll": "^1.0.0",
|
| 47 |
"p-limit": "^6.1.0",
|
| 48 |
+
"zod": "^3.23.8",
|
| 49 |
+
"xss": "^1.0.15",
|
| 50 |
+
"yaml": "^2.4.5"
|
| 51 |
},
|
| 52 |
"devDependencies": {
|
| 53 |
+
"@types/node": "^20.14.0",
|
| 54 |
"@types/nunjucks": "^3.2.6",
|
| 55 |
+
"@types/ip": "^1.1.3",
|
| 56 |
+
"tsx": "^4.15.0",
|
| 57 |
+
"typescript": "^5.5.0"
|
|
|
|
|
|
|
| 58 |
},
|
| 59 |
"engines": {
|
| 60 |
"node": ">=20.0.0"
|
tsconfig.json
CHANGED
|
@@ -20,10 +20,10 @@
|
|
| 20 |
"@core/*": ["src/core/*"],
|
| 21 |
"@modules/*": ["src/modules/*"],
|
| 22 |
"@config/*": ["src/config/*"],
|
| 23 |
-
"@workers/*": ["
|
| 24 |
},
|
| 25 |
"types": ["node"]
|
| 26 |
},
|
| 27 |
-
"include": ["src/**/*"],
|
| 28 |
-
"exclude": ["node_modules", "dist"
|
| 29 |
}
|
|
|
|
| 20 |
"@core/*": ["src/core/*"],
|
| 21 |
"@modules/*": ["src/modules/*"],
|
| 22 |
"@config/*": ["src/config/*"],
|
| 23 |
+
"@workers/*": ["workers/*"]
|
| 24 |
},
|
| 25 |
"types": ["node"]
|
| 26 |
},
|
| 27 |
+
"include": ["src/**/*", "workers/**/*"],
|
| 28 |
+
"exclude": ["node_modules", "dist"]
|
| 29 |
}
|