Skip to content

Repository files navigation

Lynq Demo

Demo dashboard system for template-based personal execution environments.

Project Structure

lynq-demo/
├── frontend/          # Vite + React + shadcn/ui
├── backend/           # Node.js + Express + TypeScript + MySQL
├── k8s/               # Kubernetes manifests
└── README.md

Quick Start

💡 New to the project? Check DEVELOPMENT.md for detailed development guide.

Quick decision matrix:

You want to... Use this
🔥 Develop with hot reload ./start-dev.sh
🏗️ Test production build ./start.sh
🐛 Use IDE debugger Local development (Option 2)
🚀 Deploy to K8s See Option 3

Option 1: Docker Compose

Prerequisites:

  • Docker & Docker Compose

Development Mode (Hot Reload) 🔥

Recommended for active development

Start with hot reload enabled:

./start-dev.sh

This will:

Edit files in backend/src/ or frontend/src/ and see changes immediately!

Stop services:

docker-compose -f docker-compose.dev.yml down

Production Mode

For testing production builds

Start production containers:

./start.sh

This will:

  • Build optimized Docker images
  • Start MySQL with automatic database initialization
  • Start Backend API
  • Start Frontend with Nginx
  • Open at http://localhost

Stop services:

./stop.sh

Manual commands:

# Development
docker-compose -f docker-compose.dev.yml up -d
docker-compose -f docker-compose.dev.yml logs -f
docker-compose -f docker-compose.dev.yml down

# Production
docker-compose up -d
docker-compose logs -f
docker-compose down
docker-compose down -v  # Remove volumes

Option 2: Local Development

Prerequisites:

  • Node.js 20 LTS
  • MySQL 8.0+

Setup MySQL

mysql -u root -p
CREATE DATABASE lynq_demo;
CREATE USER 'lynq_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON lynq_demo.* TO 'lynq_user'@'localhost';
FLUSH PRIVILEGES;
exit;

mysql -u lynq_user -p lynq_demo < backend/src/db/schema.sql

Backend

cd backend
npm install
cp .env.example .env
# Edit .env with your MySQL credentials
npm run dev

Frontend

cd frontend
npm install
npm run dev

Access at http://localhost:5173

Docker Build

# Backend
docker build -t lynq-demo-backend:latest ./backend

# Frontend
docker build -t lynq-demo-frontend:latest ./frontend

Kubernetes Deployment

Quick deploy (recommended):

cd k8s
./deploy.sh

Manual deploy:

# See k8s/README.md for detailed instructions
kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/mysql-*.yaml
kubectl wait --for=condition=ready pod -l app=mysql -n lynq-demo --timeout=300s
kubectl apply -f k8s/backend-*.yaml
kubectl apply -f k8s/frontend-*.yaml
kubectl apply -f k8s/ingress.yaml

The deployment includes:

  • MySQL 8.0 with automatic database initialization
  • Backend API (2 replicas)
  • Frontend (2 replicas)
  • Ingress for routing

See k8s/README.md for complete deployment guide.

Environment Variables

See .env.example files in each directory:

  • backend/.env.example - Backend configuration
  • frontend/.env.example - Frontend configuration

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages