Refactor: Remove audio processing and game state management modules

This commit is contained in:
2025-10-15 23:33:40 +02:00
parent 56d7511bd6
commit 58c668de63
69 changed files with 5836 additions and 1319 deletions

View File

@@ -0,0 +1,155 @@
# Quick Start Guide - Deno Backend
Get the new Deno backend running in 5 minutes!
## Prerequisites
1. **Install Deno** (if not already installed):
```bash
# Windows (PowerShell)
irm https://deno.land/install.ps1 | iex
# macOS/Linux
curl -fsSL https://deno.land/install.sh | sh
```
2. **Verify installation**:
```bash
deno --version
```
## Setup
1. **Navigate to the new backend**:
```bash
cd src/server-deno
```
2. **Create environment file** (optional):
```bash
cp .env.example .env
```
Default settings work out of the box!
3. **Run the server**:
```bash
deno task dev
```
That's it! The server will start on `http://localhost:5173`
## What Just Happened?
Deno automatically:
- ✅ Downloaded all dependencies
- ✅ Compiled TypeScript
- ✅ Started the HTTP server
- ✅ Enabled hot reload
No `npm install` needed! 🎉
## Testing the Server
### Check Server Health
```bash
# Get playlists
curl http://localhost:5173/api/playlists
# Get tracks
curl http://localhost:5173/api/tracks?playlist=default
```
### Access from Browser
Open `http://localhost:5173` in your browser to use the web interface.
## Available Commands
```bash
# Development (with auto-reload)
deno task dev
# Production
deno task start
# Run tests
deno task test
# Format code
deno task fmt
# Lint code
deno task lint
# Type check
deno task check
```
## Project Structure
```
src/server-deno/
├── main.ts # Start here!
├── domain/ # Business logic
├── application/ # Services
├── infrastructure/ # File system, streaming
├── presentation/ # HTTP & WebSocket
└── shared/ # Utilities
```
## Configuration
Edit `.env` to customize:
```env
PORT=5173 # Server port
HOST=0.0.0.0 # Server host
DATA_DIR=../../data # Audio files location
PUBLIC_DIR=../../public # Static files location
LOG_LEVEL=INFO # Logging level
```
## Troubleshooting
### Port Already in Use
```bash
# Change port in .env
PORT=3000
```
### Audio Files Not Found
```bash
# Update data directory in .env
DATA_DIR=./data
```
### Module Errors
```bash
# Clear cache and retry
deno cache --reload main.ts
```
## Next Steps
1. **Read the full documentation**: `MIGRATION_GUIDE.md`
2. **Explore the code**: Start with `main.ts`
3. **Check the architecture**: Review layer structure
4. **Run tests**: `deno task test`
## Getting Help
- Check the `README.md` for architecture overview
- See `MIGRATION_GUIDE.md` for detailed documentation
- Review code comments for implementation details
## Comparison with Old Backend
| Feature | Old (Node.js) | New (Deno) |
|---------|--------------|------------|
| Setup time | `npm install` (~2 min) | Instant |
| Dependencies | node_modules/ (100+ MB) | Cached (~10 MB) |
| Type safety | None | Full TypeScript |
| Hot reload | nodemon | Built-in |
| Security | Manual | Permissions-based |
Enjoy the new backend! 🚀