drop python backend layer
This commit is contained in:
@@ -6,51 +6,34 @@ Keyboard sounds are sourced from [kbsim](https://github.com/tplai/kbsim) (MIT li
|
||||
|
||||
## Requirements
|
||||
|
||||
- [uv](https://docs.astral.sh/uv/) (Python package manager)
|
||||
- Node.js 18+ and npm
|
||||
- **ffmpeg** on your PATH (required by pydub for audio export)
|
||||
- **git** (to fetch kbsim sample assets)
|
||||
|
||||
```bash
|
||||
# macOS
|
||||
brew install ffmpeg
|
||||
```
|
||||
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
# Python dependencies
|
||||
uv sync
|
||||
|
||||
# Frontend dependencies
|
||||
cd frontend && npm install
|
||||
|
||||
# Download kbsim switch samples (~151 MP3 files)
|
||||
./scripts/fetch_kbsim_samples.sh
|
||||
cd .. && ./scripts/fetch_kbsim_samples.sh
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
Run both servers in separate terminals:
|
||||
|
||||
```bash
|
||||
# Terminal 1 — FastAPI backend (audio export API)
|
||||
uv run uvicorn backend.main:app --reload
|
||||
|
||||
# Terminal 2 — Vite dev server (proxies /api to :8000)
|
||||
cd frontend && npm run dev
|
||||
```
|
||||
|
||||
Open http://localhost:5173
|
||||
|
||||
## Production-like run
|
||||
## Production
|
||||
|
||||
```bash
|
||||
cd frontend && npm run build
|
||||
uv run uvicorn backend.main:app --host 127.0.0.1 --port 8000
|
||||
cd frontend && npm run build && npm run preview
|
||||
```
|
||||
|
||||
Open http://127.0.0.1:8000
|
||||
Or serve `frontend/dist` with any static file host.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -60,8 +43,9 @@ Open http://127.0.0.1:8000
|
||||
- Each physical key maps to a stable press variant (same key always sounds the same)
|
||||
3. Select markers to override keys, nudge with arrow keys, or multi-select with marquee drag
|
||||
4. Choose a mechanical switch sound from the dropdown (13 kbsim profiles)
|
||||
5. **Save Project** / **Open Project** — JSON with version, markers, and switch setting (no video path)
|
||||
6. **Export Audio** — download a WAV file of keyboard sounds only, full video length
|
||||
5. Adjust preview speed (25–200%) for fast-paced content — preview only; export is always at 1×
|
||||
6. **Save Project** / **Open Project** — JSON with version, markers, and switch setting (no video path)
|
||||
7. **Export Audio** — download a WAV file of keyboard sounds only, full video length (rendered client-side)
|
||||
|
||||
### Keyboard shortcuts
|
||||
|
||||
@@ -107,4 +91,4 @@ Keyboard sound samples from [tplai/kbsim](https://github.com/tplai/kbsim) by Tho
|
||||
|
||||
- Frame stepping uses `video.currentTime` and may land on nearest keyframes for some MP4 encodings
|
||||
- Project files do not reference the video file path
|
||||
- Very long videos may take longer to export via pydub in-memory overlay
|
||||
- Very long videos may take longer to export client-side via OfflineAudioContext
|
||||
|
||||
Reference in New Issue
Block a user