ae84a6e0e9590e0af9362220fbee694c1a03aad4
Replace require() with ESM import to fix module loading issues
asd
ads
Tech Stack
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: Spartan UI
- Database & Auth: Supabase
- Code Quality: ESLint + Prettier
Getting Started
Prerequisites
- Node.js 20 or higher
- pnpm 8 or higher (recommended) or npm
Installation
# Install dependencies
pnpm install
# Copy environment variables
cp .env.example .env.local
# Update .env.local with your Supabase credentials
Development
# Run development server
pnpm dev
# Open http://localhost:3000
Build
# Create production build
pnpm build
# Start production server
pnpm start
Project Structure
project-1766459980010-q6lr8s01b/
├── app/ # Next.js app router pages
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Homepage
│ └── globals.css # Global styles
├── components/ # React components
│ └── ui/ # UI components
├── lib/ # Utility functions
│ ├── supabase.ts # Supabase client
│ └── utils.ts # Helper functions
├── public/ # Static assets
└── ...config files
Environment Variables
Create a .env.local file with:
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
Scripts
pnpm dev- Start development serverpnpm build- Create production buildpnpm start- Start production serverpnpm lint- Run ESLintpnpm format- Format code with Prettier
Deployment
This template comes with production-ready Docker and Kubernetes configurations.
Docker Deployment
Build Docker Image
# Build the image
docker build -t lumina-app:latest .
# Run locally
docker run -p 3000:3000 --env-file .env.local lumina-app:latest
Docker Compose (Recommended for local testing)
# Start all services (app + postgres + redis)
docker-compose up -d
# View logs
docker-compose logs -f app
# Stop services
docker-compose down
Push to Harbor Registry
# Tag image for Harbor
docker tag lumina-app:latest harbor.advisori.de/lumina/project-1766459980010-q6lr8s01b:latest
# Login to Harbor
docker login harbor.advisori.de
# Push image
docker push harbor.advisori.de/lumina/project-1766459980010-q6lr8s01b:latest
Kubernetes Deployment
Prerequisites
- Kubernetes cluster (1.25+)
- kubectl configured
- Helm 3.x installed
- Harbor registry access
Deploy with Helm
# Navigate to helm chart
cd helm/lumina-app
# Create namespace
kubectl create namespace lumina-apps
# Create Harbor pull secret
kubectl create secret docker-registry harbor-registry-secret \
--docker-server=harbor.advisori.de \
--docker-username=your-username \
--docker-password=your-password \
--namespace=lumina-apps
# Create application secrets
kubectl create secret generic lumina-app-secrets \
--from-literal=DATABASE_URL="your-database-url" \
--from-literal=SUPABASE_URL="your-supabase-url" \
--from-literal=SUPABASE_ANON_KEY="your-anon-key" \
--namespace=lumina-apps
# Install/Upgrade with Helm
helm upgrade --install project-1766459980010-q6lr8s01b . \
--namespace lumina-apps \
--set image.repository=harbor.advisori.de/lumina/project-1766459980010-q6lr8s01b \
--set image.tag=latest \
--set ingress.hosts[0].host=project-1766459980010-q6lr8s01b.advisori.de \
--set ingress.tls[0].hosts[0]=project-1766459980010-q6lr8s01b.advisori.de
Customize Deployment
Edit helm/lumina-app/values.yaml to customize:
- Replicas: Number of pods (default: 2)
- Resources: CPU/Memory limits
- Autoscaling: Min/Max replicas and thresholds
- Ingress: Domain and TLS settings
- Environment: Add custom env variables
- Persistence: Enable persistent storage
Monitor Deployment
# Check pods
kubectl get pods -n lumina-apps
# View logs
kubectl logs -f deployment/project-1766459980010-q6lr8s01b -n lumina-apps
# Check ingress
kubectl get ingress -n lumina-apps
# Port forward for testing
kubectl port-forward svc/project-1766459980010-q6lr8s01b 3000:80 -n lumina-apps
Scaling
# Manual scaling
kubectl scale deployment project-1766459980010-q6lr8s01b --replicas=5 -n lumina-apps
# Horizontal Pod Autoscaler (enabled by default)
kubectl get hpa -n lumina-apps
Update Deployment
# Build and push new image
docker build -t harbor.advisori.de/lumina/project-1766459980010-q6lr8s01b:v1.1.0 .
docker push harbor.advisori.de/lumina/project-1766459980010-q6lr8s01b:v1.1.0
# Update with new image
helm upgrade project-1766459980010-q6lr8s01b ./helm/lumina-app \
--namespace lumina-apps \
--set image.tag=v1.1.0 \
--reuse-values
# Rollback if needed
helm rollback project-1766459980010-q6lr8s01b -n lumina-apps
CI/CD Integration
The template includes configurations for automated deployments:
- Gitea Actions: Auto-build on push to main
- Harbor Webhook: Trigger K8s deployment on new image
- Helm Chart: Version-controlled infrastructure
Health Checks
The application exposes a health endpoint at /api/health for:
- Kubernetes liveness probes
- Readiness probes
- Load balancer health checks
Create app/api/health/route.ts if not exists:
export async function GET() {
return Response.json({ status: 'healthy' }, { status: 200 });
}
Learn More
- Next.js Documentation
- Supabase Documentation
- Spartan UI Documentation
- Tailwind CSS Documentation
- Kubernetes Documentation
- Helm Documentation
License
MIT
Generated by Lumina - AI-Powered Development Platform by advisori
Description
Languages
TypeScript
39.8%
Shell
33.9%
Makefile
12%
PLpgSQL
4.5%
Smarty
3.3%
Other
6.5%