Repository navigation
Updated All Modules and Added Docker Files #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e09bc24
7d4382f
3d95656
f52d45d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,9 @@ | ||
| node_modules | ||
| dist | ||
| npm-debug.log | ||
| .git | ||
| .gitignore | ||
| .vscode | ||
| .env | ||
| .git | ||
| npm-debug.log | ||
| dist | ||
| Dockerfile* | ||
| docker-compose* |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,8 @@ Design | |
| # Node modules | ||
| node_modules/ | ||
|
|
||
| postman | ||
|
|
||
| # Temporary files | ||
| npm-temp/ | ||
| temp/ | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,13 +2,14 @@ FROM node:20-alpine | |||||
|
|
||||||
| WORKDIR /app | ||||||
|
|
||||||
| # Install dev dependencies (nodemon) and app deps | ||||||
| COPY package*.json ./ | ||||||
| RUN npm ci | ||||||
|
|
||||||
| # If you prefer nodemon global: RUN npm install -g nodemon | ||||||
| # Copy only when building image layer for deps (source will be mounted at runtime) | ||||||
| # Expose the port your app uses | ||||||
| RUN npm ci --only=production | ||||||
|
|
||||||
| COPY . . | ||||||
|
|
||||||
| RUN npm run build | ||||||
|
|
||||||
| EXPOSE 4000 | ||||||
|
|
||||||
| CMD ["npm", "run", "dev"] | ||||||
| CMD ["node", "dist/server.js"] | ||||||
|
||||||
| CMD ["node", "dist/server.js"] | |
| CMD ["node", "src/dist/server.js"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| FROM node:20-alpine | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY package*.json ./ | ||
|
|
||
| RUN npm install | ||
|
|
||
| EXPOSE 4000 | ||
|
|
||
| CMD ["npm", "run", "dev"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| version: "3.9" | ||
|
|
||
| services: | ||
| backend: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile.dev | ||
|
|
||
| container_name: backend-dev | ||
|
|
||
| volumes: | ||
| - .:/app | ||
| - /app/node_modules | ||
|
|
||
| env_file: | ||
| - .env | ||
|
|
||
| ports: | ||
| - "4000:4000" | ||
|
|
||
| command: npm run dev |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| version: "3.9" | ||
|
|
||
| services: | ||
| backend: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
|
|
||
| container_name: backend-prod | ||
|
|
||
| ports: | ||
| - "4000:4000" | ||
|
|
||
| env_file: | ||
| - .env | ||
|
|
||
| restart: always |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| export type ActionType = | ||
| | 'TXT_TO_IMAGE_GEN' | ||
| | 'IMG_TO_IMAGE_GEN' | ||
| | 'AUDIO_GEN' | ||
| | 'STORY_GEN' | ||
| | 'TXT_TO_VIDEO_GEN' | ||
| | 'IMG_TO_VIDEO_GEN' | ||
| | 'SCENE_GEN' | ||
| | 'NARRATION_GEN'; | ||
|
|
||
| export const CREDIT_PRICING: Record<ActionType, Record<number, number>> = { | ||
| TXT_TO_IMAGE_GEN: { | ||
| 1: 2, | ||
| 2: 6, | ||
| 3: 10, | ||
| 4: 15, | ||
| 5: 25, | ||
| }, | ||
|
|
||
| IMG_TO_IMAGE_GEN: { | ||
| 1: 2, | ||
| 2: 6, | ||
| 3: 10, | ||
| 4: 15, | ||
| 5: 25, | ||
| }, | ||
|
|
||
| AUDIO_GEN: { | ||
| 1: 2, | ||
| 2: 5, | ||
| 3: 8, | ||
| 4: 12, | ||
| 5: 20, | ||
| }, | ||
|
|
||
| STORY_GEN: { | ||
| 1: 1, | ||
| 2: 3, | ||
| 3: 6, | ||
| 4: 10, | ||
| 5: 15, | ||
| }, | ||
|
|
||
| SCENE_GEN: { | ||
| 1: 1, | ||
| 2: 2, | ||
| 3: 4, | ||
| 4: 6, | ||
| 5: 10, | ||
| 10: 60, | ||
| }, | ||
| NARRATION_GEN: { | ||
| 1: 1, | ||
| 2: 3, | ||
| 3: 5, | ||
| 4: 8, | ||
| 5: 12, | ||
| }, | ||
|
|
||
| TXT_TO_VIDEO_GEN: { | ||
| 2: 20, | ||
| 3: 35, | ||
| 4: 50, | ||
| 5: 75, | ||
| }, | ||
|
|
||
| IMG_TO_VIDEO_GEN: { | ||
| 2: 20, | ||
| 3: 35, | ||
| 4: 50, | ||
| 5: 75, | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // Audio Asset validation constants | ||
| export const MAX_AUDIO_PROMPT_LENGTH = 2000; | ||
| export const MAX_AUDIO_URL_LENGTH = 2048; | ||
| export const MAX_AUDIO_ASSETS_PER_NARRATION = 50; | ||
|
|
||
| // Audio types | ||
| export const audioTypes = ['narration', 'background', 'effect'] as const; | ||
| export type AudioType = (typeof audioTypes)[number]; | ||
|
|
||
| // Generation sources | ||
| export const audioGenerationSources = ['ai', 'user'] as const; | ||
| export type AudioGenerationSource = (typeof audioGenerationSources)[number]; | ||
|
|
||
| // Supported audio formats | ||
| export const audioFormats = ['mp3', 'wav', 'ogg', 'aac', 'm4a', 'flac', 'wma', 'opus'] as const; | ||
| export type AudioFormat = (typeof audioFormats)[number]; | ||
|
|
||
| // Duration constraints | ||
| export const MIN_AUDIO_DURATION = 0.1; | ||
| export const MAX_AUDIO_DURATION = 7200; // 2 hours max | ||
|
|
||
| // File size constraints (in bytes) | ||
| export const MAX_AUDIO_FILE_SIZE = 100 * 1024 * 1024; // 100MB | ||
|
|
||
| // Voice ID constraints | ||
| export const MAX_VOICE_ID_LENGTH = 100; | ||
|
|
||
| // Version constraints | ||
| export const AUDIO_VERSION_GAP = 1; | ||
| export const MIN_AUDIO_VERSION = 1; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| export const ALLOWED_ORIGINS = process.env.ALLOWED_ORIGINS | ||
| ? process.env.ALLOWED_ORIGINS.split(',') | ||
| : [ | ||
| process.env.DEV_CLIENT_URL || 'http://localhost:3000', | ||
| process.env.DEV_CLIENT_URL || 'http://localhost:5173', | ||
| process.env.PROD_CLIENT_URL || 'https://your-production-app.com', | ||
| ]; | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // Scene Asset validation constants | ||
| export const MAX_ASSET_PROMPT_LENGTH = 2000; | ||
| export const MAX_ASSET_URL_LENGTH = 2048; | ||
| export const MAX_ASSETS_PER_SCENE = 50; | ||
|
|
||
| // Asset types | ||
| export const assetTypes = ['image', 'video'] as const; | ||
| export type AssetType = (typeof assetTypes)[number]; | ||
|
|
||
| // Visibility types | ||
| export const visibilityTypes = ['private', 'public'] as const; | ||
| export type VisibilityType = (typeof visibilityTypes)[number]; | ||
|
|
||
| // Generation sources | ||
| export const generationSources = ['ai', 'user'] as const; | ||
| export type GenerationSource = (typeof generationSources)[number]; | ||
|
|
||
| // Supported formats | ||
| export const videoFormats = ['mp4', 'mov', 'mkv', 'mpg', 'webm', 'avi', 'ogg', 'mpeg', 'm4v', 'flv', 'wmv', '3gp'] as const; | ||
| export const imageFormats = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'webp', 'svg', 'ico', 'heic', 'raw'] as const; | ||
| export const allFormats = [...videoFormats, ...imageFormats] as const; | ||
|
|
||
| export type VideoFormat = (typeof videoFormats)[number]; | ||
| export type ImageFormat = (typeof imageFormats)[number]; | ||
| export type AssetFormat = (typeof allFormats)[number]; | ||
|
|
||
| // Dimension constraints | ||
| export const MIN_DIMENSION = 1; | ||
| export const MAX_DIMENSION = 8192; | ||
|
|
||
| // Duration constraints (for video assets) | ||
| export const MIN_ASSET_DURATION = 0.1; | ||
| export const MAX_ASSET_DURATION = 3600; // 1 hour max |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Dockerfile installs production-only dependencies (
npm ci --only=production) and then runsnpm run build, butbuildusestscwhich is indevDependencies. The image build will fail unless TypeScript is installed. Consider a multi-stage build (install dev deps to build, then copy compiled output + prod deps), or install dev deps during the build stage.