Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
.react-router
build
node_modules
README.md
build
.react-router
out
*.log
.env
.git
.gitignore
README.md
docker-compose.yml
Dockerfile*
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ out/

# React Router
/.react-router/
/build/
/build/

# pnpm
.pnpm-store
22 changes: 0 additions & 22 deletions Dockerfile

This file was deleted.

41 changes: 41 additions & 0 deletions Dockerfile.backend
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Backend Dockerfile

FROM node:22-bookworm-slim
WORKDIR /app

# Install Chrome dependencies
RUN apt-get update
RUN apt install -y \
libnss3 \
libdbus-1-3 \
libatk1.0-0 \
libgbm-dev \
libasound2 \
libxrandr2 \
libxkbcommon-dev \
libxfixes3 \
libxcomposite1 \
libxdamage1 \
libatk-bridge2.0-0 \
libpango-1.0-0 \
libcairo2 \
libcups2

# Install pnpm
RUN npm install -g pnpm

# Copy package files and install dependencies
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile

# Copy source code
COPY . .

# Create output directory for rendered videos
RUN mkdir -p /app/out

# Expose port
EXPOSE 8000

# Start the backend
CMD ["pnpm", "dlx", "tsx", "app/videorender/videorender.ts"]
21 changes: 21 additions & 0 deletions Dockerfile.frontend
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Frontend Dockerfile

FROM node:20-bookworm-slim
WORKDIR /app

# Install pnpm
RUN npm install -g pnpm

# Copy package files and install dependencies
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile

# Copy source code and build
COPY . .
RUN pnpm run build

# Expose port
EXPOSE 3000

# Start the application
CMD ["pnpm", "run", "start"]
2 changes: 1 addition & 1 deletion app/components/timeline/VideoPlayerSection.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react"
import { VideoPlayer } from "~/remotion/VideoPlayer"
import { VideoPlayer } from "~/video-compositions/VideoPlayer"
import type { PlayerRef } from "@remotion/player"
import { type TimelineDataItem } from "./types"

Expand Down
29 changes: 0 additions & 29 deletions app/remotion/Root.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export const MyComposition = () => {
<p>hello world</p>
</>
)
};
};
4 changes: 2 additions & 2 deletions app/remotion/MyComp.tsx → app/video-compositions/MyComp.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Sequence, OffthreadVideo } from "remotion";
import { OffthreadVideo } from "remotion";


export const MyComp: React.FC<{ videoURL: string }> = ({ videoURL }) => {
Expand All @@ -10,4 +10,4 @@ export const MyComp: React.FC<{ videoURL: string }> = ({ videoURL }) => {
</div>
</>
)
};
};
10 changes: 10 additions & 0 deletions app/video-compositions/Root.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Composition } from 'remotion';
import { MyComp } from './MyComp';

export const MyVideo = () => {
return (
<>
<Composition component={MyComp} durationInFrames={120} width={1920} height={1080} fps={30} id="my-comp" defaultProps={{ text: 'World' }} />
</>
);
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// this is the video player component. It basically takes the JSON representation of the timeline and renders it.

import { Player, type PlayerRef } from '@remotion/player';
import { Sequence, AbsoluteFill, Img, Video } from 'remotion';
import React from 'react';
Expand Down Expand Up @@ -56,7 +54,7 @@ export function TimelineComposition({ timelineData, durationInFrames }: VideoPla
textShadow: '2px 2px 4px rgba(0,0,0,0.5)',
margin: 0,
padding: '20px'
}}>{scrubber.id}</p> {/* Using scrubber.id as placeholder for text content, update if actual text is available */}
}}>{scrubber.id}</p>
</div>
</AbsoluteFill>
);
Expand All @@ -80,7 +78,6 @@ export function TimelineComposition({ timelineData, durationInFrames }: VideoPla
}
break;
default:
// Optionally handle unknown media types or log a warning
console.warn(`Unknown media type: ${scrubber.mediaType}`);
break;
}
Expand Down Expand Up @@ -119,4 +116,4 @@ export function VideoPlayer({ timelineData, durationInFrames, ref }: VideoPlayer
controls
/>
);
}
}
4 changes: 2 additions & 2 deletions app/remotion/index.ts → app/video-compositions/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {registerRoot} from 'remotion';
import {MyVideo} from './Root';
registerRoot(MyVideo);

registerRoot(MyVideo);
2 changes: 1 addition & 1 deletion app/videorender/Composition.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Composition, getInputProps } from 'remotion';
import { TimelineComposition } from '../remotion/VideoPlayer';
import { TimelineComposition } from '../video-compositions/VideoPlayer';

export default function RenderComposition() {
const inputProps = getInputProps();
Expand Down
34 changes: 34 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
services:
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
container_name: videoeditor-frontend
ports:
- "3000:3000"
environment:
- VITE_API_URL=http://backend:8000
networks:
- videoeditor-network
depends_on:
- backend

backend:
build:
context: .
dockerfile: Dockerfile.backend
container_name: videoeditor-backend
ports:
- "8000:8000"
volumes:
- ./out:/app/out
networks:
- videoeditor-network
# Memory configuration for video rendering
mem_limit: 2g
memswap_limit: 2g
shm_size: 1g

networks:
videoeditor-network:
driver: bridge
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default [
}
},
{
files: ['app/remotion/*.{ts,tsx}'],
files: ['app/video-compositions/*.{ts,tsx}'],
plugins: {
'@remotion': remotionPlugin
},
Expand Down