3.0 KiB
3.0 KiB
Quick Start Guide - Deno Backend
Get the new Deno backend running in 5 minutes!
Prerequisites
-
Install Deno (if not already installed):
# Windows (PowerShell) irm https://deno.land/install.ps1 | iex # macOS/Linux curl -fsSL https://deno.land/install.sh | sh -
Verify installation:
deno --version
Setup
-
Navigate to the new backend:
cd src/server-deno -
Create environment file (optional):
cp .env.example .envDefault settings work out of the box!
-
Run the server:
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
# 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
# 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:
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
# Change port in .env
PORT=3000
Audio Files Not Found
# Update data directory in .env
DATA_DIR=./data
Module Errors
# Clear cache and retry
deno cache --reload main.ts
Next Steps
- Read the full documentation:
MIGRATION_GUIDE.md - Explore the code: Start with
main.ts - Check the architecture: Review layer structure
- Run tests:
deno task test
Getting Help
- Check the
README.mdfor architecture overview - See
MIGRATION_GUIDE.mdfor 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! 🚀