Skip to content

Commit c85e4f6

Browse files
robinroy03sr2echadependabot[bot]Copilot
authored
back onto dev
* re-introduce project sync * refactor: streamline media deletion logic in useMediaBin hook * refactor: enhance path security and streamline file handling in timeline and video render modules * feat: enhance AI functionality + ChatBox with context menu and utilities * feat: integrate zod validation * chore: update environment configuration and Docker settings * chore: update frontend server port in nginx configuration * feat: left pannel bar * Bump react-router from 7.7.1 to 7.12.0 Bumps [react-router](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router) from 7.7.1 to 7.12.0. - [Release notes](https://github.com/remix-run/react-router/releases) - [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router/CHANGELOG.md) - [Commits](https://github.com/remix-run/react-router/commits/react-router@7.12.0/packages/react-router) --- updated-dependencies: - dependency-name: react-router dependency-version: 7.12.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * Merge canary into main: path security, Zod validation, AI enhancements, infra updates (#180) * Initial plan * Fix 4 Polynomial ReDoS vulnerabilities in backend/main.py regexes Co-authored-by: sr2echa <65058816+sr2echa@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sr2echa <65058816+sr2echa@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: sr2echa <65058816+sr2echa@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
1 parent 02e79cc commit c85e4f6

47 files changed

Lines changed: 5926 additions & 2651 deletions

Some content is hidden

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

.cursorrules

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Cursor Rules for Kimu Video Editor
2+
3+
project:
4+
name: "Kimu Video Editor"
5+
language: "TypeScript/React (React Router) + Python FastAPI"
6+
package_manager: pnpm
7+
8+
conventions:
9+
- Prefer central Zod schemas in app/schemas/**; do not define inline schemas in components or routes.
10+
- Always validate external boundaries: AI responses, API inputs/outputs, localStorage, drag-and-drop payloads.
11+
- Keep UI components presentational; move parsing/validation to hooks or route loaders/actions when possible.
12+
- Use named exports and barrel files under app/schemas for discoverability.
13+
14+
imports:
15+
zod:
16+
source: "zod"
17+
identifier: "z"
18+
schemas:
19+
source: "~/schemas"
20+
21+
editor:
22+
formatting:
23+
- Match existing indentation and code style.
24+
- Avoid reformatting unrelated code during edits.
25+
typescript:
26+
- Prefer explicit types for exported APIs; avoid any.
27+
- Use narrow schemas and safeParse for user/LLM data.
28+
29+
testing:
30+
- Add schema unit tests when adding complex schemas.
31+
- Validate response shapes in API route tests.
32+
33+
commit_messages:
34+
- Use scope tags: feat(schemas), refactor(chat), fix(api), chore(tooling).
35+
36+
typescript_guidelines:
37+
- Always enable strict type checking
38+
- Export interfaces and types from dedicated type files
39+
- Leverage a common module for shared types and utilities when possible
40+
- Use proper type imports from @types packages when available
41+
- Follow framework conventions for typing (e.g., Remix loaders/actions, React types)
42+
- DO NOT use the any type
43+
- Prefer importing types from packages before declaring your own
44+
- Avoid type casting; prefer precise types and narrowing
45+
- Prefer inferring types from Zod schemas using z.infer instead of manual type definitions
46+
- For Zod schemas, prefer .nullish().transform((val) => val ?? undefined) over .optional() for null handling; do not combine .nullish() with .default()
47+
48+
project_structure:
49+
overview:
50+
- Frontend (Remix/React) lives under app/
51+
- Backend (FastAPI) lives under backend/
52+
- Centralized Zod schemas live under app/schemas/** with barrel exports in app/schemas/index.ts
53+
- Database/sql migrations under migrations/
54+
- Shared UI primitives under app/components/ui/**
55+
- Timeline/editor components under app/components/timeline/**
56+
- Chat/AI components under app/components/chat/**
57+
- Hooks under app/hooks/**
58+
- Utilities under app/utils/** and app/lib/**
59+
60+
code_organization_rules:
61+
- Keep feature-specific code within its respective directory (timeline, chat, media, etc.)
62+
- Place all Zod schemas under app/schemas/** (components/, apis/, domain files) and import from there (no inline schemas in components/routes)
63+
- Maintain consistent file naming:
64+
- index.ts for barrel exports
65+
- types.ts or types/index.ts for type definitions when schema inference is not applicable
66+
- Remix routes:
67+
- Validate params in loaders/actions with Zod
68+
- Validate request bodies and response payloads (APIs under app/routes/api.*)
69+
- Components:
70+
- Keep presentational; parse/validate data in hooks or route loaders
71+
- Import schemas from app/schemas/components/**
72+
- APIs:
73+
- Import request/response schemas from app/schemas/apis/**
74+
- Validate inputs (safeParse) and outputs (parse) at boundaries
75+
- Prefer z.infer<typeof Schema> to derive TS types from Zod

.env.example

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
NODE_ENV= # production | development
12
VITE_SUPABASE_URL=
23
VITE_SUPABASE_ANON_KEY=
34
DATABASE_URL=
45
GOOGLE_CLIENT_ID=
5-
GOOGLE_CLIENT_SECRET=
6+
GOOGLE_CLIENT_SECRET=
7+
PROD_DOMAIN= # trykimu.com

Dockerfile.frontend

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ COPY . .
2323
RUN pnpm run build
2424

2525
# Expose port
26-
EXPOSE 3000
26+
EXPOSE 5173
2727

2828
# Start the application
2929
CMD ["pnpm", "run", "start"]

README.md

Lines changed: 96 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,32 +56,114 @@
5656
<br> and much more...</p>
5757
</samp>
5858

59-
## 🐋Deployment
59+
## 💻 Development
6060

61+
<strong> 🐳 <ins>Docker</ins> <code>Recommended</code> </strong>
62+
63+
**Quick Start:**
64+
65+
```bash
66+
docker compose -f docker-compose.yml \
67+
-f docker-compose.dev.yml up -d
6168
```
62-
git clone https://github.com/robinroy03/videoeditor.git
63-
cd videoeditor
64-
docker compose up
69+
70+
**Ports:**
71+
72+
<samp>
73+
74+
- Frontend: `5173`
75+
- Backend : `8000`
76+
- FastAPI : `3000`
77+
78+
</samp>
79+
<br>
80+
81+
<strong> 🛠️ <ins>Local Development</ins></strong>
82+
83+
<samp>For local development without Docker:</samp>
84+
85+
```bash
86+
# Install dependencies
87+
pnpm install
88+
89+
# Start services
90+
pnpm run dev # Frontend (port 5173)
91+
pnpm dlx tsx app/videorender/videorender.ts # Backend (port 8000)
92+
uv run backend/main.py # FastAPI (port 3000)
93+
94+
# Note: You'll need GEMINI_API_KEY for AI features
95+
```
96+
97+
`Requirements`
98+
99+
<samp>
100+
101+
- Node.js 20+
102+
- Python 3.9+
103+
- PostgreSQL
104+
- pnpm
105+
106+
</samp>
107+
</details>
108+
109+
## 🚀 Production
110+
111+
**Quick Start:**
112+
113+
```bash
114+
docker compose up -d
65115
```
66116

67-
## 🧑‍💻Development
117+
**With Custom Domain:**
68118

119+
```bash
120+
PROD_DOMAIN=yourdomain.com docker compose up -d
69121
```
70-
pnpm i
71-
pnpm run dev (frontend)
72-
pnpm dlx tsx app/videorender/videorender.ts (backend)
73-
uv run backend/main.py
74-
flip `isProduction` to `false` in `/app/utils/api.ts`
122+
123+
or alternatively edit `docker-compose.yml`
124+
125+
**Ports:**
126+
127+
- HTTP: `80`
128+
- HTTPS: `443`
129+
130+
## ⚙️ Environment Configuration
131+
132+
Create a `.env` file for custom settings:
133+
134+
```env
135+
# Domain Configuration
136+
PROD_DOMAIN=yourdomain.com
137+
138+
# Database
139+
DATABASE_URL=postgresql://user:pass@localhost:5432/videoeditor
140+
141+
# Authentication (Google OAuth)
142+
GOOGLE_CLIENT_ID=your_google_client_id
143+
GOOGLE_CLIENT_SECRET=your_google_client_secret
144+
145+
# AI Features (Optional -> /backend)
146+
GEMINI_API_KEY=your_gemini_api_key
147+
148+
# Supabase (Optional)
149+
VITE_SUPABASE_URL=your_supabase_url
150+
VITE_SUPABASE_ANON_KEY=your_supabase_key
75151
```
76152

77-
## 📃TODO
153+
**Environment Variables Explained:**
154+
155+
- `PROD_DOMAIN`: Your production domain (host only, e.g., `yourdomain.com`)
156+
- `DATABASE_URL`: PostgreSQL connection string
157+
- `GOOGLE_CLIENT_ID/SECRET`: Google OAuth credentials for authentication
158+
- `GEMINI_API_KEY`: Required for AI-powered video editing features
159+
- `VITE_SUPABASE_*`: Optional Supabase integration for additional features
78160

79-
We have a lot of work! For starters, we plan to integrate all Remotion APIs. I'll add a proper roadmap soon. Join the [Discord Server](https://discord.com/invite/GSknuxubZK) for updates and support.
161+
<br>
80162

81163
## ❤️Contribution
82164

83-
We would love your contributions! ❤️ Check the [contribution guide](CONTRIBUTING.md).
165+
<samp> We would love your contributions! ❤️ Check the [contribution guide](CONTRIBUTING.md). </samp>
84166

85167
## 📜License
86168

87-
This project is licensed under a dual-license. Refer to [LICENSE](LICENSE.md) for details. The [Remotion license](https://github.com/remotion-dev/remotion/blob/main/LICENSE.md) also applies to the relevant parts of the project.
169+
<samp> This project is licensed under a dual-license. Refer to [LICENSE](LICENSE.md) for details. The [Remotion license](https://github.com/remotion-dev/remotion/blob/main/LICENSE.md) also applies to the relevant parts of the project. </samp>

app/app.css

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
@custom-variant dark (&:is(.dark *));
55

66
@theme {
7-
--font-sans: "Inter", ui-sans-serif, system-ui, sans-serif,
8-
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
7+
--font-sans:
8+
"Inter", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
9+
"Noto Color Emoji";
910
}
1011

1112
html,
@@ -202,6 +203,27 @@ body {
202203
max-width: 100%;
203204
}
204205

206+
/* Ultra-thin scrollbar specifically for chat tabs strip */
207+
.chat-tabs-scroll::-webkit-scrollbar {
208+
height: 0px; /* hide horizontal bar */
209+
}
210+
.chat-tabs-scroll::-webkit-scrollbar-thumb {
211+
background: transparent;
212+
border-radius: 9999px;
213+
}
214+
.chat-tabs-scroll::-webkit-scrollbar-track {
215+
background: transparent;
216+
}
217+
218+
/* Hide scrollbar utility (cross-browser) */
219+
.no-scrollbar::-webkit-scrollbar {
220+
display: none;
221+
}
222+
.no-scrollbar {
223+
-ms-overflow-style: none; /* IE and Edge */
224+
scrollbar-width: none; /* Firefox */
225+
}
226+
205227
/* Prevent horizontal overflow in chat areas */
206228
.chat-container * {
207229
max-width: 100%;
@@ -332,11 +354,14 @@ body {
332354
@keyframes glow-pulse {
333355
0%,
334356
100% {
335-
box-shadow: 0 0 20px rgba(37, 99, 235, 0.1),
357+
box-shadow:
358+
0 0 20px rgba(37, 99, 235, 0.1),
336359
0 0 40px rgba(37, 99, 235, 0.05);
337360
}
338361
50% {
339-
box-shadow: 0 0 30px rgba(37, 99, 235, 0.2), 0 0 60px rgba(37, 99, 235, 0.1);
362+
box-shadow:
363+
0 0 30px rgba(37, 99, 235, 0.2),
364+
0 0 60px rgba(37, 99, 235, 0.1);
340365
}
341366
}
342367

@@ -489,7 +514,16 @@ body {
489514
}
490515

491516
@keyframes indeterminate-slide {
492-
0% { left: -40%; width: 40%; }
493-
50% { left: 20%; width: 60%; }
494-
100% { left: 100%; width: 40%; }
495-
}
517+
0% {
518+
left: -40%;
519+
width: 40%;
520+
}
521+
50% {
522+
left: 20%;
523+
width: 60%;
524+
}
525+
100% {
526+
left: 100%;
527+
width: 40%;
528+
}
529+
}

0 commit comments

Comments
 (0)