feat: init desktop app
This commit is contained in:
parent
f635403108
commit
8918a87c33
|
|
@ -1,188 +1,199 @@
|
||||||
# Contributing to OpenCut
|
# Contributing to OpenCut
|
||||||
|
|
||||||
⚠️ We are currently NOT accepting feature PRs while we build out the core editor.
|
⚠️ We are currently NOT accepting feature PRs while we build out the core editor.
|
||||||
|
|
||||||
If you want to contribute:
|
If you want to contribute:
|
||||||
|
|
||||||
1. Open an issue first to discuss
|
1. Open an issue first to discuss
|
||||||
2. Wait for maintainer approval
|
2. Wait for maintainer approval
|
||||||
3. Only then start coding
|
3. Only then start coding
|
||||||
|
|
||||||
Critical bug fixes may be accepted on a case-by-case basis.
|
Critical bug fixes may be accepted on a case-by-case basis.
|
||||||
|
|
||||||
Thank you for your interest in contributing to OpenCut! This document provides guidelines and instructions for contributing.
|
Thank you for your interest in contributing to OpenCut! This document provides guidelines and instructions for contributing.
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
- [Node.js](https://nodejs.org/en/) (v18 or later)
|
- [Node.js](https://nodejs.org/en/) (v18 or later)
|
||||||
- [Bun](https://bun.sh/docs/installation)
|
- [Bun](https://bun.sh/docs/installation)
|
||||||
(for `npm` alternative)
|
(for `npm` alternative)
|
||||||
- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/)
|
- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/)
|
||||||
|
- Rust toolchain (only needed for `apps/desktop`)
|
||||||
> **Note:** Docker is optional, but it's essential for running the local database and Redis services. If you're planning to contribute to frontend features, you can skip the Docker setup. If you have followed the steps below in [Setup](#setup), you're all set to go!
|
|
||||||
|
> **Note:** Docker is optional, but it's essential for running the local database and Redis services. If you're planning to contribute to frontend features, you can skip the Docker setup. If you have followed the steps below in [Setup](#setup), you're all set to go!
|
||||||
### Setup
|
|
||||||
|
### Setup
|
||||||
1. Fork the repository
|
|
||||||
2. Clone your fork locally
|
1. Fork the repository
|
||||||
3. Navigate to the web app directory: `cd apps/web`
|
2. Clone your fork locally
|
||||||
4. Copy `.env.example` to `.env.local`:
|
3. Navigate to the web app directory: `cd apps/web`
|
||||||
|
4. Copy `.env.example` to `.env.local`:
|
||||||
```bash
|
|
||||||
# Unix/Linux/Mac
|
```bash
|
||||||
cp .env.example .env.local
|
# Unix/Linux/Mac
|
||||||
|
cp .env.example .env.local
|
||||||
# Windows Command Prompt
|
|
||||||
copy .env.example .env.local
|
# Windows Command Prompt
|
||||||
|
copy .env.example .env.local
|
||||||
# Windows PowerShell
|
|
||||||
Copy-Item .env.example .env.local
|
# Windows PowerShell
|
||||||
```
|
Copy-Item .env.example .env.local
|
||||||
|
```
|
||||||
5. Install dependencies: `bun install`
|
|
||||||
6. Start the development server: `bun run dev`
|
5. Install dependencies: `bun install`
|
||||||
|
6. Start the development server: `bun run dev`
|
||||||
> **Note:** If you see an error like `Unsupported URL Type "workspace:*"` when running `npm install`, you have two options:
|
|
||||||
>
|
> **Note:** If you see an error like `Unsupported URL Type "workspace:*"` when running `npm install`, you have two options:
|
||||||
> 1. Upgrade to a recent npm version (v9 or later), which has full workspace protocol support.
|
>
|
||||||
> 2. Use an alternative package manager such as **bun** or **pnpm**.
|
> 1. Upgrade to a recent npm version (v9 or later), which has full workspace protocol support.
|
||||||
|
> 2. Use an alternative package manager such as **bun** or **pnpm**.
|
||||||
## What to Focus On
|
|
||||||
|
### Desktop setup
|
||||||
**🎯 Good Areas to Contribute:**
|
|
||||||
|
Only needed if you're working on `apps/desktop`. See [`apps/desktop/README.md`](../apps/desktop/README.md) — it's a two-step process: Rust toolchain first via `script/setup-rust`, then desktop native dependencies via `apps/desktop/script/setup`.
|
||||||
- Timeline functionality and UI improvements
|
|
||||||
- Project management features
|
## What to Focus On
|
||||||
- Performance optimizations
|
|
||||||
- Bug fixes in existing functionality
|
**🎯 Good Areas to Contribute:**
|
||||||
- UI/UX improvements
|
|
||||||
- Documentation and testing
|
- Timeline functionality and UI improvements
|
||||||
|
- Project management features
|
||||||
**⚠️ Areas to Avoid:**
|
- Performance optimizations
|
||||||
|
- Bug fixes in existing functionality
|
||||||
- Preview panel enhancements (text fonts, stickers, effects)
|
- UI/UX improvements
|
||||||
- Export functionality improvements
|
- Documentation and testing
|
||||||
- Preview rendering optimizations
|
|
||||||
|
**⚠️ Areas to Avoid:**
|
||||||
**Why?** We're currently planning a major refactor of the preview system. The current preview renders DOM elements (HTML), but we're moving to a binary rendering approach similar to CapCut. This new system will ensure consistency between preview and export, and provide much better performance and quality.
|
|
||||||
|
- Preview panel enhancements (text fonts, stickers, effects)
|
||||||
The current HTML-based preview is essentially a prototype - the binary approach will be the "real deal." To avoid wasted effort, please focus on other areas of the application until this refactor is complete.
|
- Export functionality improvements
|
||||||
|
- Preview rendering optimizations
|
||||||
If you're unsure whether your idea falls into the preview category, feel free to ask us [directly in discord](https://discord.gg/zmR9N35cjK) or create a GitHub issue!
|
|
||||||
|
**Why?** We're currently planning a major refactor of the preview system. The current preview renders DOM elements (HTML), but we're moving to a binary rendering approach similar to CapCut. This new system will ensure consistency between preview and export, and provide much better performance and quality.
|
||||||
## Development Setup
|
|
||||||
|
The current HTML-based preview is essentially a prototype - the binary approach will be the "real deal." To avoid wasted effort, please focus on other areas of the application until this refactor is complete.
|
||||||
### Local Development
|
|
||||||
|
If you're unsure whether your idea falls into the preview category, feel free to ask us [directly in discord](https://discord.gg/zmR9N35cjK) or create a GitHub issue!
|
||||||
1. Start the database and Redis services:
|
|
||||||
|
## Development Setup
|
||||||
```bash
|
|
||||||
# From project root
|
### Local Development
|
||||||
docker-compose up -d
|
|
||||||
```
|
1. Start the database and Redis services:
|
||||||
|
|
||||||
2. Navigate to the web app directory:
|
```bash
|
||||||
|
# From project root
|
||||||
```bash
|
docker-compose up -d
|
||||||
cd apps/web
|
```
|
||||||
```
|
|
||||||
|
2. Navigate to the web app directory:
|
||||||
3. Copy `.env.example` to `.env.local`:
|
|
||||||
|
```bash
|
||||||
```bash
|
cd apps/web
|
||||||
# Unix/Linux/Mac
|
```
|
||||||
cp .env.example .env.local
|
|
||||||
|
3. Copy `.env.example` to `.env.local`:
|
||||||
# Windows Command Prompt
|
|
||||||
copy .env.example .env.local
|
```bash
|
||||||
|
# Unix/Linux/Mac
|
||||||
# Windows PowerShell
|
cp .env.example .env.local
|
||||||
Copy-Item .env.example .env.local
|
|
||||||
```
|
# Windows Command Prompt
|
||||||
|
copy .env.example .env.local
|
||||||
4. Configure required environment variables in `.env.local`:
|
|
||||||
|
# Windows PowerShell
|
||||||
**Required Variables:**
|
Copy-Item .env.example .env.local
|
||||||
|
```
|
||||||
```bash
|
|
||||||
# Database (matches docker-compose.yaml)
|
4. Configure required environment variables in `.env.local`:
|
||||||
DATABASE_URL="postgresql://opencut:opencut@localhost:5432/opencut"
|
|
||||||
|
**Required Variables:**
|
||||||
# Generate a secure secret for Better Auth
|
|
||||||
BETTER_AUTH_SECRET="your-generated-secret-here"
|
```bash
|
||||||
NEXT_PUBLIC_SITE_URL="http://localhost:3000"
|
# Database (matches docker-compose.yaml)
|
||||||
|
DATABASE_URL="postgresql://opencut:opencut@localhost:5432/opencut"
|
||||||
# Redis (matches docker-compose.yaml)
|
|
||||||
UPSTASH_REDIS_REST_URL="http://localhost:8079"
|
# Generate a secure secret for Better Auth
|
||||||
UPSTASH_REDIS_REST_TOKEN="example_token"
|
BETTER_AUTH_SECRET="your-generated-secret-here"
|
||||||
|
NEXT_PUBLIC_SITE_URL="http://localhost:3000"
|
||||||
# Development
|
|
||||||
NODE_ENV="development"
|
# Redis (matches docker-compose.yaml)
|
||||||
```
|
UPSTASH_REDIS_REST_URL="http://localhost:8079"
|
||||||
|
UPSTASH_REDIS_REST_TOKEN="example_token"
|
||||||
**Generate BETTER_AUTH_SECRET:**
|
|
||||||
|
# Development
|
||||||
```bash
|
NODE_ENV="development"
|
||||||
# Unix/Linux/Mac
|
```
|
||||||
openssl rand -base64 32
|
|
||||||
|
**Generate BETTER_AUTH_SECRET:**
|
||||||
# Windows PowerShell (simple method)
|
|
||||||
[System.Web.Security.Membership]::GeneratePassword(32, 0)
|
```bash
|
||||||
|
# Unix/Linux/Mac
|
||||||
# Cross-platform (using Node.js)
|
openssl rand -base64 32
|
||||||
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
|
|
||||||
|
# Windows PowerShell (simple method)
|
||||||
# Or use an online generator: https://generate-secret.vercel.app/32
|
[System.Web.Security.Membership]::GeneratePassword(32, 0)
|
||||||
```
|
|
||||||
|
# Cross-platform (using Node.js)
|
||||||
5. Run database migrations: `bun run db:migrate`
|
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
|
||||||
6. Start the development server: `bun run dev`
|
|
||||||
|
# Or use an online generator: https://generate-secret.vercel.app/32
|
||||||
## How to Contribute
|
```
|
||||||
|
|
||||||
### Reporting Bugs
|
5. Run database migrations: `bun run db:migrate`
|
||||||
|
6. Start the development server: `bun run dev`
|
||||||
- Use the bug report template
|
|
||||||
- Include steps to reproduce
|
### Desktop
|
||||||
- Provide screenshots if applicable
|
|
||||||
|
Working on `apps/desktop`? See [`apps/desktop/README.md`](../apps/desktop/README.md) for setup. Web-only contributors can ignore this entirely.
|
||||||
### Suggesting Features
|
|
||||||
|
## How to Contribute
|
||||||
- Use the feature request template
|
|
||||||
- Explain the use case
|
### Reporting Bugs
|
||||||
- Consider implementation details
|
|
||||||
|
- Use the bug report template
|
||||||
### Code Contributions
|
- Include steps to reproduce
|
||||||
|
- Provide screenshots if applicable
|
||||||
1. Create a new branch: `git checkout -b feature/your-feature-name`
|
|
||||||
2. Make your changes
|
### Suggesting Features
|
||||||
3. Navigate to the web app directory: `cd apps/web`
|
|
||||||
4. Run the linter: `bun run lint`
|
- Use the feature request template
|
||||||
5. Format your code: `bunx biome format --write .`
|
- Explain the use case
|
||||||
6. Commit your changes with a descriptive message
|
- Consider implementation details
|
||||||
7. Push to your fork and create a pull request
|
|
||||||
|
### Code Contributions
|
||||||
## Code Style
|
|
||||||
|
1. Create a new branch: `git checkout -b feature/your-feature-name`
|
||||||
- We use Biome for code formatting and linting
|
2. Make your changes
|
||||||
- Run `bunx biome format --write .` from the `apps/web` directory to format code
|
3. Run the relevant checks for the area you touched:
|
||||||
- Run `bun run lint` from the `apps/web` directory to check for linting issues
|
|
||||||
- Follow the existing code patterns
|
- Web changes: from `apps/web`, run `bun run lint` and `bunx biome format --write .`
|
||||||
|
- Desktop changes: run `./apps/desktop/script/setup` if your environment isn't set up yet
|
||||||
## Pull Request Process
|
|
||||||
|
4. Commit your changes with a descriptive message
|
||||||
1. Fill out the pull request template completely
|
5. Push to your fork and create a pull request
|
||||||
2. Link any related issues
|
|
||||||
3. Ensure CI passes
|
## Code Style
|
||||||
4. Request review from maintainers
|
|
||||||
5. Address any feedback
|
- We use Biome for code formatting and linting
|
||||||
|
- Run `bunx biome format --write .` from the `apps/web` directory to format code
|
||||||
## Community
|
- Run `bun run lint` from the `apps/web` directory to check for linting issues
|
||||||
|
- Follow the existing code patterns
|
||||||
- Be respectful and inclusive
|
|
||||||
- Follow our Code of Conduct
|
## Pull Request Process
|
||||||
- Help others in discussions and issues
|
|
||||||
|
1. Fill out the pull request template completely
|
||||||
Thank you for contributing!
|
2. Link any related issues
|
||||||
|
3. Ensure CI passes
|
||||||
|
4. Request review from maintainers
|
||||||
|
5. Address any feedback
|
||||||
|
|
||||||
|
## Community
|
||||||
|
|
||||||
|
- Be respectful and inclusive
|
||||||
|
- Follow our Code of Conduct
|
||||||
|
- Help others in discussions and issues
|
||||||
|
|
||||||
|
Thank you for contributing!
|
||||||
|
|
|
||||||
|
|
@ -19,4 +19,6 @@ bun.lockb
|
||||||
# Twiggy
|
# Twiggy
|
||||||
.cursor/
|
.cursor/
|
||||||
|
|
||||||
.open-next
|
.open-next
|
||||||
|
|
||||||
|
target/
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,5 @@
|
||||||
|
[workspace]
|
||||||
|
resolver = "2"
|
||||||
|
members = [
|
||||||
|
"apps/desktop",
|
||||||
|
]
|
||||||
250
README.md
250
README.md
|
|
@ -1,121 +1,129 @@
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" width="120">
|
<td align="left" width="120">
|
||||||
<img src="apps/web/public/logos/opencut/1k/logo-white-black.png" alt="OpenCut Logo" width="100" />
|
<img src="apps/web/public/logos/opencut/1k/logo-white-black.png" alt="OpenCut Logo" width="100" />
|
||||||
</td>
|
</td>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
<h1>OpenCut</span></h1>
|
<h1>OpenCut</span></h1>
|
||||||
<h3 style="margin-top: -10px;">A free, open-source video editor for web, desktop, and mobile.</h3>
|
<h3 style="margin-top: -10px;">A free, open-source video editor for web, desktop, and mobile.</h3>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
## Sponsors
|
## Sponsors
|
||||||
|
|
||||||
Thanks to [Vercel](https://vercel.com?utm_source=github-opencut&utm_campaign=oss) and [fal.ai](https://fal.ai?utm_source=github-opencut&utm_campaign=oss) for their support of open-source software.
|
Thanks to [Vercel](https://vercel.com?utm_source=github-opencut&utm_campaign=oss) and [fal.ai](https://fal.ai?utm_source=github-opencut&utm_campaign=oss) for their support of open-source software.
|
||||||
|
|
||||||
<a href="https://vercel.com/oss">
|
<a href="https://vercel.com/oss">
|
||||||
<img alt="Vercel OSS Program" src="https://vercel.com/oss/program-badge.svg" />
|
<img alt="Vercel OSS Program" src="https://vercel.com/oss/program-badge.svg" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="https://fal.ai">
|
<a href="https://fal.ai">
|
||||||
<img alt="Powered by fal.ai" src="https://img.shields.io/badge/Powered%20by-fal.ai-000000?style=flat&logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJMMTMuMDkgOC4yNkwyMCAxMEwxMy4wOSAxNS43NEwxMiAyMkwxMC45MSAxNS43NEw0IDEwTDEwLjkxIDguMjZMMTIgMloiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=" />
|
<img alt="Powered by fal.ai" src="https://img.shields.io/badge/Powered%20by-fal.ai-000000?style=flat&logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJMMTMuMDkgOC4yNkwyMCAxMEwxMy4wOSAxNS43NEwxMiAyMkwxMC45MSAxNS43NEw0IDEwTDEwLjkxIDguMjZMMTIgMloiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
## Why?
|
## Why?
|
||||||
|
|
||||||
- **Privacy**: Your videos stay on your device
|
- **Privacy**: Your videos stay on your device
|
||||||
- **Free features**: Most basic CapCut features are now paywalled
|
- **Free features**: Most basic CapCut features are now paywalled
|
||||||
- **Simple**: People want editors that are easy to use - CapCut proved that
|
- **Simple**: People want editors that are easy to use - CapCut proved that
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Timeline-based editing
|
- Timeline-based editing
|
||||||
- Multi-track support
|
- Multi-track support
|
||||||
- Real-time preview
|
- Real-time preview
|
||||||
- No watermarks or subscriptions
|
- No watermarks or subscriptions
|
||||||
- Analytics provided by [Databuddy](https://www.databuddy.cc?utm_source=opencut), 100% Anonymized & Non-invasive.
|
- Analytics provided by [Databuddy](https://www.databuddy.cc?utm_source=opencut), 100% Anonymized & Non-invasive.
|
||||||
- Blog powered by [Marble](https://marblecms.com?utm_source=opencut), Headless CMS.
|
- Blog powered by [Marble](https://marblecms.com?utm_source=opencut), Headless CMS.
|
||||||
|
|
||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
- `apps/web/` – Main Next.js web application
|
- `apps/web/` – Main Next.js web application
|
||||||
- `src/components/` – UI and editor components
|
- `apps/desktop/` – Native desktop app (in progress)
|
||||||
- `src/hooks/` – Custom React hooks
|
- `src/components/` – UI and editor components
|
||||||
- `src/lib/` – Utility and API logic
|
- `src/hooks/` – Custom React hooks
|
||||||
- `src/stores/` – State management (Zustand, etc.)
|
- `src/lib/` – Utility and API logic
|
||||||
- `src/types/` – TypeScript types
|
- `src/stores/` – State management (Zustand, etc.)
|
||||||
|
- `src/types/` – TypeScript types
|
||||||
## Getting Started
|
|
||||||
|
## Getting Started
|
||||||
### Prerequisites
|
|
||||||
|
### Prerequisites
|
||||||
- [Bun](https://bun.sh/docs/installation)
|
|
||||||
- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/)
|
- [Bun](https://bun.sh/docs/installation)
|
||||||
|
- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/)
|
||||||
> **Note:** Docker is optional but recommended for running the local database and Redis. If you only want to work on frontend features, you can skip it.
|
|
||||||
|
> **Note:** Docker is optional but recommended for running the local database and Redis. If you only want to work on frontend features, you can skip it.
|
||||||
### Setup
|
|
||||||
|
### Setup
|
||||||
1. Fork and clone the repository
|
|
||||||
|
1. Fork and clone the repository
|
||||||
2. Copy the environment file:
|
|
||||||
|
2. Copy the environment file:
|
||||||
```bash
|
|
||||||
# Unix/Linux/Mac
|
```bash
|
||||||
cp apps/web/.env.example apps/web/.env.local
|
# Unix/Linux/Mac
|
||||||
|
cp apps/web/.env.example apps/web/.env.local
|
||||||
# Windows PowerShell
|
|
||||||
Copy-Item apps/web/.env.example apps/web/.env.local
|
# Windows PowerShell
|
||||||
```
|
Copy-Item apps/web/.env.example apps/web/.env.local
|
||||||
|
```
|
||||||
3. Start the database and Redis:
|
|
||||||
|
3. Start the database and Redis:
|
||||||
```bash
|
|
||||||
docker compose up -d db redis serverless-redis-http
|
```bash
|
||||||
```
|
docker compose up -d db redis serverless-redis-http
|
||||||
|
```
|
||||||
4. Install dependencies and start the dev server:
|
|
||||||
|
4. Install dependencies and start the dev server:
|
||||||
```bash
|
|
||||||
bun install
|
```bash
|
||||||
bun dev:web
|
bun install
|
||||||
```
|
bun dev:web
|
||||||
|
```
|
||||||
The application will be available at [http://localhost:3000](http://localhost:3000).
|
|
||||||
|
The application will be available at [http://localhost:3000](http://localhost:3000).
|
||||||
The `.env.example` has sensible defaults that match the Docker Compose config — it should work out of the box.
|
|
||||||
|
The `.env.example` has sensible defaults that match the Docker Compose config — it should work out of the box.
|
||||||
### Self-Hosting with Docker
|
|
||||||
|
### Desktop setup
|
||||||
To run everything (including a production build of the app) in Docker:
|
|
||||||
|
Desktop is opt-in. If you're only working on the web app, skip this entirely.
|
||||||
```bash
|
|
||||||
docker compose up -d
|
If you want to get ready for `apps/desktop`, see [`apps/desktop/README.md`](apps/desktop/README.md). It's a two-step setup: Rust toolchain first, then desktop native dependencies.
|
||||||
```
|
|
||||||
|
### Self-Hosting with Docker
|
||||||
The app will be available at [http://localhost:3100](http://localhost:3100).
|
|
||||||
|
To run everything (including a production build of the app) in Docker:
|
||||||
## Contributing
|
|
||||||
|
```bash
|
||||||
We welcome contributions! While we're actively developing and refactoring certain areas, there are plenty of opportunities to contribute effectively.
|
docker compose up -d
|
||||||
|
```
|
||||||
**🎯 Focus areas:** Timeline functionality, project management, performance, bug fixes, and UI improvements outside the preview panel.
|
|
||||||
|
The app will be available at [http://localhost:3100](http://localhost:3100).
|
||||||
**⚠️ Avoid for now:** Preview panel enhancements (fonts, stickers, effects) and export functionality - we're refactoring these with a new binary rendering approach.
|
|
||||||
|
## Contributing
|
||||||
See our [Contributing Guide](.github/CONTRIBUTING.md) for detailed setup instructions, development guidelines, and complete focus area guidance.
|
|
||||||
|
We welcome contributions! While we're actively developing and refactoring certain areas, there are plenty of opportunities to contribute effectively.
|
||||||
**Quick start for contributors:**
|
|
||||||
|
**🎯 Focus areas:** Timeline functionality, project management, performance, bug fixes, and UI improvements outside the preview panel.
|
||||||
- Fork the repo and clone locally
|
|
||||||
- Follow the setup instructions in CONTRIBUTING.md
|
**⚠️ Avoid for now:** Preview panel enhancements (fonts, stickers, effects) and export functionality - we're refactoring these with a new binary rendering approach.
|
||||||
- Create a feature branch and submit a PR
|
|
||||||
|
See our [Contributing Guide](.github/CONTRIBUTING.md) for detailed setup instructions, development guidelines, and complete focus area guidance.
|
||||||
## License
|
|
||||||
|
**Quick start for contributors:**
|
||||||
[MIT LICENSE](LICENSE)
|
|
||||||
|
- Fork the repo and clone locally
|
||||||
---
|
- Follow the setup instructions in CONTRIBUTING.md
|
||||||
|
- Working on `apps/desktop`? See [`apps/desktop/README.md`](apps/desktop/README.md) for setup
|
||||||

|
- Create a feature branch and submit a PR
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
[MIT LICENSE](LICENSE)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
[package]
|
||||||
|
name = "opencut-desktop"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "opencut"
|
||||||
|
path = "src/main.rs"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
gpui = "0.2.2"
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
# Desktop
|
||||||
|
|
||||||
|
The native desktop app, built with [GPUI](https://gpui.rs).
|
||||||
|
|
||||||
|
## Getting started
|
||||||
|
|
||||||
|
**1. Install Rust:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Linux / macOS / WSL
|
||||||
|
./script/setup-rust
|
||||||
|
```
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
# Windows
|
||||||
|
powershell -ExecutionPolicy Bypass -File .\script\setup-rust.ps1
|
||||||
|
```
|
||||||
|
|
||||||
|
Both scripts skip installation if Rust is already present. On Linux/macOS/WSL only: after a fresh install, reload your shell with `source "$HOME/.cargo/env"`
|
||||||
|
|
||||||
|
**2. Install native dependencies:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Linux / macOS / WSL
|
||||||
|
./apps/desktop/script/setup
|
||||||
|
```
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
# Windows
|
||||||
|
powershell -ExecutionPolicy Bypass -File .\apps\desktop\script\setup.ps1
|
||||||
|
```
|
||||||
|
|
||||||
|
**3. Run:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cargo run -p opencut-desktop
|
||||||
|
```
|
||||||
|
|
||||||
|
## Platform notes
|
||||||
|
|
||||||
|
**Linux:** supports apt (Debian/Ubuntu/Mint), dnf (Fedora/RHEL), and pacman (Arch).
|
||||||
|
|
||||||
|
**macOS:** installs Xcode Command Line Tools if missing.
|
||||||
|
|
||||||
|
**Windows:** the setup script checks for Visual Studio Build Tools. If missing, it prints the install link.
|
||||||
|
|
||||||
|
**WSL:** runs the same scripts as Linux. Window rendering works via WSLg on Windows 11 and Windows 10 22H2+. If you're on an older build, test on the host instead.
|
||||||
|
|
@ -0,0 +1,110 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Installs the native system libraries GPUI needs to compile on Linux/macOS.
|
||||||
|
# Run script/setup-rust first if you don't have Rust installed yet.
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
|
maysudo=''
|
||||||
|
else
|
||||||
|
maysudo="$(command -v sudo || command -v doas || true)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ubuntu, Debian, Mint, Pop!_OS, Kali, Raspbian, etc.
|
||||||
|
apt=$(command -v apt-get || true)
|
||||||
|
if [[ -n $apt ]]; then
|
||||||
|
deps=(
|
||||||
|
curl
|
||||||
|
build-essential
|
||||||
|
pkg-config
|
||||||
|
gcc
|
||||||
|
g++
|
||||||
|
make
|
||||||
|
libasound2-dev
|
||||||
|
libfontconfig-dev
|
||||||
|
libglib2.0-dev
|
||||||
|
libssl-dev
|
||||||
|
libva-dev
|
||||||
|
libvulkan1
|
||||||
|
libwayland-dev
|
||||||
|
libx11-xcb-dev
|
||||||
|
libxkbcommon-x11-dev
|
||||||
|
libzstd-dev
|
||||||
|
libsqlite3-dev
|
||||||
|
)
|
||||||
|
|
||||||
|
$maysudo "$apt" update
|
||||||
|
$maysudo "$apt" install -y "${deps[@]}"
|
||||||
|
echo "Desktop native dependencies installed."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Fedora, RHEL, CentOS, Alma, etc.
|
||||||
|
dnf=$(command -v dnf || true)
|
||||||
|
if [[ -n $dnf ]]; then
|
||||||
|
deps=(
|
||||||
|
gcc
|
||||||
|
gcc-c++
|
||||||
|
make
|
||||||
|
pkg-config
|
||||||
|
alsa-lib-devel
|
||||||
|
fontconfig-devel
|
||||||
|
glib2-devel
|
||||||
|
openssl-devel
|
||||||
|
libva-devel
|
||||||
|
vulkan-loader
|
||||||
|
wayland-devel
|
||||||
|
libxcb-devel
|
||||||
|
libxkbcommon-x11-devel
|
||||||
|
libzstd-devel
|
||||||
|
sqlite-devel
|
||||||
|
curl
|
||||||
|
)
|
||||||
|
|
||||||
|
$maysudo "$dnf" install -y "${deps[@]}"
|
||||||
|
echo "Desktop native dependencies installed."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Arch, Manjaro, etc.
|
||||||
|
pacman=$(command -v pacman || true)
|
||||||
|
if [[ -n $pacman ]]; then
|
||||||
|
deps=(
|
||||||
|
gcc
|
||||||
|
make
|
||||||
|
pkgconf
|
||||||
|
alsa-lib
|
||||||
|
fontconfig
|
||||||
|
glib2
|
||||||
|
openssl
|
||||||
|
libva
|
||||||
|
vulkan-loader
|
||||||
|
wayland
|
||||||
|
libxcb
|
||||||
|
libxkbcommon-x11
|
||||||
|
zstd
|
||||||
|
sqlite
|
||||||
|
curl
|
||||||
|
)
|
||||||
|
|
||||||
|
$maysudo "$pacman" -Syu --needed --noconfirm "${deps[@]}"
|
||||||
|
echo "Desktop native dependencies installed."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# macOS
|
||||||
|
if [[ "$(uname)" == "Darwin" ]]; then
|
||||||
|
if ! xcode-select -p &> /dev/null; then
|
||||||
|
echo "Installing Xcode Command Line Tools..."
|
||||||
|
xcode-select --install
|
||||||
|
echo "Re-run this script after the Xcode install completes."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Desktop native dependencies installed."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Unsupported platform. See apps/desktop/README.md for manual setup instructions."
|
||||||
|
exit 1
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
# Installs the native build tools GPUI needs to compile on Windows.
|
||||||
|
# Run script/setup-rust.ps1 first if you don't have Rust installed yet.
|
||||||
|
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
function Check-VSBuildTools {
|
||||||
|
$vswhere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||||
|
|
||||||
|
if (-not (Test-Path $vswhere)) {
|
||||||
|
return $false
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = & $vswhere -latest -requires Microsoft.VisualStudio.Workload.NativeDesktop -property installationPath
|
||||||
|
return $result -and $result.Trim().Length -gt 0
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-not (Check-VSBuildTools)) {
|
||||||
|
Write-Output ""
|
||||||
|
Write-Output "Visual Studio Build Tools with 'Desktop development with C++' not found."
|
||||||
|
Write-Output ""
|
||||||
|
Write-Output "Install it from: https://visualstudio.microsoft.com/visual-cpp-build-tools/"
|
||||||
|
Write-Output "Check the 'Desktop development with C++' workload during setup, then re-run this script."
|
||||||
|
Write-Output ""
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Output "Desktop native dependencies ready."
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
use gpui::{
|
||||||
|
App, Application, Bounds, Context, SharedString, Window, WindowBounds, WindowOptions, div,
|
||||||
|
prelude::*, px, rgb, size,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct AppWindow {
|
||||||
|
title: SharedString,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Render for AppWindow {
|
||||||
|
fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
|
||||||
|
div()
|
||||||
|
.size_full()
|
||||||
|
.bg(rgb(0x0f0f0f))
|
||||||
|
.flex()
|
||||||
|
.justify_center()
|
||||||
|
.items_center()
|
||||||
|
.text_xl()
|
||||||
|
.text_color(rgb(0xffffff))
|
||||||
|
.child(self.title.clone())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
Application::new().run(|cx: &mut App| {
|
||||||
|
let bounds = Bounds::centered(None, size(px(1280.), px(720.)), cx);
|
||||||
|
cx.open_window(
|
||||||
|
WindowOptions {
|
||||||
|
window_bounds: Some(WindowBounds::Windowed(bounds)),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
|_, cx| {
|
||||||
|
cx.new(|_| AppWindow {
|
||||||
|
title: "OpenCut".into(),
|
||||||
|
})
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
cx.activate(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Installs the Rust toolchain via rustup.
|
||||||
|
# Run this before any platform-specific setup script.
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
CARGO_BIN="$HOME/.cargo/bin/rustup"
|
||||||
|
|
||||||
|
if command -v rustup &> /dev/null || [ -f "$CARGO_BIN" ]; then
|
||||||
|
echo "rustup already installed"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Installing rustup..."
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
|
echo "Rust installed. Reload your shell: source \"\$HOME/.cargo/env\""
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
# Installs the Rust toolchain via rustup.
|
||||||
|
# Run this before any platform-specific setup script.
|
||||||
|
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
if (Get-Command cargo -ErrorAction SilentlyContinue) {
|
||||||
|
Write-Output "rustup already installed: $(rustup --version)"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
$cargoHome = if ($env:CARGO_HOME) { $env:CARGO_HOME } else { "$env:USERPROFILE\.cargo" }
|
||||||
|
$rustupExe = "$cargoHome\bin\rustup.exe"
|
||||||
|
|
||||||
|
if (-not (Test-Path $rustupExe)) {
|
||||||
|
Write-Output "Installing rustup..."
|
||||||
|
$installer = "$env:TEMP\rustup-init.exe"
|
||||||
|
Invoke-WebRequest -Uri "https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe" -OutFile $installer
|
||||||
|
& $installer -y --default-toolchain stable
|
||||||
|
Remove-Item -Force $installer
|
||||||
|
}
|
||||||
|
|
||||||
|
$env:PATH = "$cargoHome\bin;$env:PATH"
|
||||||
|
Write-Output "Rust installed: $(& rustc --version)"
|
||||||
Loading…
Reference in New Issue