A modern TypeScript monorepo built with Hono backend API and Astro frontend, featuring React components, Tailwind CSS, and Docker support.
This monorepo contains:
- Backend (
apps/backend): Hono-based TypeScript API server - Frontend (
apps/web): Astro application with React and Tailwind CSS - Docker Support: Full containerization with docker-compose
- Node.js 18.20.8+ or 20.3.0+
- pnpm (recommended package manager)
- Docker & Docker Compose (optional)
-
Install dependencies:
pnpm install
-
Start development servers:
pnpm dev
This runs both backend (port 8000) and frontend (port 4321) concurrently.
-
Open your browser:
- Frontend: http://localhost:4321
- Backend API: http://localhost:8000
Backend:
cd apps/backend
pnpm dev # Development server
pnpm build # Build for production
pnpm start # Start production serverFrontend:
cd apps/web
pnpm dev # Development server
pnpm build # Build for production
pnpm preview # Preview production build# Build and start all services
docker-compose up --build
# Run in background
docker-compose up -d --build
# Stop services
docker-compose downServices:
- Backend: http://localhost:8000
- Frontend: http://localhost:4321
- Nginx (reverse proxy): http://localhost:80
# Build production images
docker-compose -f docker-compose.yml build
# Deploy to production
docker-compose -f docker-compose.yml up -d- Framework: Hono (ultrafast web framework)
- Runtime: Node.js with @hono/node-server
- Language: TypeScript
- Features: CORS, logging, JSON API endpoints
- Framework: Astro (modern static site generator)
- UI Components: React 18
- Styling: Tailwind CSS
- Language: TypeScript
- Features: Server-side rendering, static generation
- Package Manager: pnpm with workspace support
- Containerization: Docker & Docker Compose
- Reverse Proxy: Nginx (optional)
- Development: Concurrent development servers
Music-Bridge/
βββ apps/
β βββ backend/ # Hono API server
β β βββ src/
β β β βββ index.ts # Main server file
β β βββ Dockerfile # Backend container
β β βββ package.json # Backend dependencies
β β βββ tsconfig.json # Backend TypeScript config
β βββ web/ # Astro frontend
β βββ src/
β β βββ pages/
β β βββ index.astro # Main page
β βββ public/ # Static assets
β βββ Dockerfile # Frontend container
β βββ astro.config.mjs # Astro configuration
β βββ package.json # Frontend dependencies
β βββ tailwind.config.mjs # Tailwind configuration
β βββ tsconfig.json # Frontend TypeScript config
βββ docker-compose.yml # Multi-service orchestration
βββ nginx.conf # Reverse proxy configuration
βββ package.json # Root workspace configuration
βββ pnpm-workspace.yaml # pnpm workspace definition
βββ tsconfig.json # Shared TypeScript configuration
βββ .env.example # Environment variables template
The backend provides the following endpoints:
GET /- API status and infoGET /api/health- Health check endpointGET /api/tracks- Get music tracks (sample data)POST /api/tracks- Create new track
- Backend APIs: Add routes in
apps/backend/src/index.ts - Frontend Pages: Add
.astrofiles inapps/web/src/pages/ - React Components: Create
.tsxfiles for interactive components - Styling: Use Tailwind CSS classes or add custom CSS
Copy .env.example to .env.local and configure:
# Backend Configuration
PORT=8000
NODE_ENV=development
# Web Configuration
ASTRO_PORT=4321
# CORS Origins
CORS_ORIGINS=http://localhost:4321,http://localhost:3000| Command | Description |
|---|---|
pnpm dev |
Start both apps in development mode |
pnpm build |
Build both apps for production |
pnpm start |
Start backend in production mode |
pnpm clean |
Clean build artifacts |
pnpm type-check |
Run TypeScript type checking |
pnpm lint |
Run ESLint on both apps |
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Hono - Ultra-fast web framework
- TypeScript - Type-safe JavaScript
- Node.js - Runtime environment
- Express-style middleware support
- Astro - Modern static site generator
- React - UI components
- Tailwind CSS - Utility-first styling
- TypeScript - Type safety
- pnpm - Fast, disk space efficient package manager
- Docker - Containerization
- Docker Compose - Multi-container orchestration
- Nginx - Reverse proxy (optional)
- ESLint - Code linting
- Prettier - Code formatting
Music-Bridge/
βββ apps/
β βββ api/ # Hono API backend
β β βββ src/
β β β βββ index.ts # API entry point
β β βββ package.json
β β βββ tsconfig.json
β β βββ Dockerfile
β βββ web/ # Astro frontend
β βββ src/
β β βββ pages/
β β βββ index.astro # Homepage
β βββ public/
β βββ package.json
β βββ astro.config.mjs
β βββ tailwind.config.mjs
β βββ Dockerfile
βββ packages/ # Shared packages (future)
βββ docker-compose.yml # Docker orchestration
βββ nginx.conf # Nginx configuration
βββ pnpm-workspace.yaml # pnpm workspace config
βββ package.json # Root package.json
βββ tsconfig.json # Root TypeScript config
- Node.js 18+
- pnpm 8+
- Docker & Docker Compose (optional)
-
Clone the repository
git clone <repository-url> cd Music-Bridge
-
Install dependencies
pnpm install
-
Set up environment variables
cp .env.example .env.local # Edit .env.local with your values
Start both API and Web in development mode:
pnpm devThis will start:
- API server on
http://localhost:8000 - Web server on
http://localhost:4321
Or start services individually:
# Start API only
pnpm --filter api dev
# Start Web only
pnpm --filter web devBuild all applications:
pnpm buildBuild individually:
# Build API
pnpm --filter api build
# Build Web
pnpm --filter web build# Build and start all services
docker-compose up --build
# Start in detached mode
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose downThe Docker setup includes:
- API service - Hono backend on port 8000
- Web service - Astro frontend on port 4321
- Nginx - Reverse proxy on port 80 (optional)
Access the application:
- With Nginx:
http://localhost - Direct access:
http://localhost:4321 - API:
http://localhost:8000
GET /api/health- Service health status
GET /api/tracks- Get all tracksPOST /api/tracks- Create a new track
# Run type checking
pnpm type-check
# Run linting
pnpm lint
# Run tests (when added)
pnpm testpnpm dev- Start all services in developmentpnpm build- Build all applicationspnpm clean- Clean all build outputspnpm type-check- Type check all packagespnpm lint- Lint all packages
pnpm dev- Start development server with hot reloadpnpm build- Build for productionpnpm start- Start production serverpnpm type-check- Type check onlypnpm lint- Lint only
pnpm dev- Start Astro dev serverpnpm build- Build for productionpnpm preview- Preview production buildpnpm type-check- Type check onlypnpm lint- Lint only
docker-compose up -d --build- Build all applications:
pnpm build - Deploy API to your Node.js hosting platform
- Deploy Web to your static hosting platform (Vercel, Netlify, etc.)
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Database integration (PostgreSQL/MongoDB)
- Authentication system
- Music streaming integration (Spotify, Apple Music)
- Real-time features with WebSockets
- Mobile app (React Native)
- CI/CD pipeline
- Monitoring and logging
- Unit and integration tests Music Playlist manager (accross multiple services)