reorg: separate frontend and backend

This commit is contained in:
2025-02-23 11:45:40 -08:00
parent b2b70f3eb1
commit b3cf5fb3c8
12 changed files with 7752 additions and 2154 deletions

View File

@@ -4,18 +4,18 @@ FROM --platform=$TARGETPLATFORM node:20-slim AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
COPY backend/package*.json ./backend/
COPY frontend/package*.json ./frontend/
# Install dependencies
RUN npm ci
RUN cd backend && npm ci
RUN cd frontend && npm ci
# Copy source files
COPY . .
# Build frontend and backend
RUN npm run build
RUN npm run build --workspaces
# Production stage
FROM --platform=$TARGETPLATFORM debian:testing-20250203
@@ -27,11 +27,11 @@ RUN apt-get update && apt-get install -y \
WORKDIR /app
# Install only production dependencies
COPY package*.json ./
COPY backend/package*.json ./
RUN npm ci --production
# Copy built files
COPY --from=builder /app/build ./build
COPY --from=builder /app/backend/build ./build
COPY --from=builder /app/frontend/dist ./dist/frontend
EXPOSE 3000

View File

@@ -3,13 +3,21 @@ VERSION := $(shell git describe --always --dirty)
.PHONY: build
build:
npm install
npm run build
npm run build --workspaces
.PHONY: dev
dev:
npm run dev
.PHONY: run
run:
npm run start
.PHONY: image
image:
docker build -t queuecube:$(VERSION)-$(shell uname -m) .
.PHONY: images
images:
docker buildx build --platform linux/arm/v7 -t musicqueue:$(VERSION)-armv7l .
docker buildx build --platform linux/amd64 -t musicqueue:$(VERSION)-amd64 .
docker buildx build --platform linux/arm/v7 -t queuecube:$(VERSION)-armv7l .
docker buildx build --platform linux/amd64 -t queuecube:$(VERSION)-amd64 .

2121
backend/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

32
backend/package.json Normal file
View File

@@ -0,0 +1,32 @@
{
"name": "mpvqueue",
"version": "1.0.0",
"main": "build/server.js",
"scripts": {
"build": "tsc -b",
"dev": "concurrently \"tsc -w -p src\" \"nodemon build/server.js\"",
"start": "node build/index.js"
},
"author": "",
"license": "ISC",
"description": "",
"devDependencies": {
"@types/express": "^5.0.0",
"@types/express-ws": "^3.0.5",
"@types/node": "^22.13.4",
"@types/ws": "^8.5.14",
"concurrently": "^9.1.2",
"nodemon": "^3.1.9",
"typescript": "^5.7.3"
},
"dependencies": {
"@types/node-fetch": "^2.6.12",
"classnames": "^2.5.1",
"express": "^4.21.2",
"express-ws": "^5.0.2",
"link-preview-js": "^3.0.14",
"node-fetch": "^2.7.0",
"react-icons": "^5.4.0",
"ws": "^8.18.0"
}
}

View File

@@ -107,10 +107,10 @@
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"include": ["src/**/*"], // Only include backend files
"exclude": ["frontend/**/*"], // Explicitly exclude frontend files
"exclude": ["../frontend/**/*"], // Explicitly exclude frontend files
"files": [],
"references": [
{ "path": "./src" }, // Backend reference
{ "path": "./frontend" } // Frontend reference
{ "path": "../frontend" } // Frontend reference
]
}

3609
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,32 +1,12 @@
{
"name": "mpvqueue",
"version": "1.0.0",
"main": "build/server.js",
"name": "queuecube",
"version": "1.82",
"private": true,
"scripts": {
"build": "tsc -b && cd frontend && npm run build",
"dev": "concurrently \"cd frontend && npm run dev\" \"tsc -w -p src\" \"nodemon build/server.js\"",
"start": "node build/index.js"
"dev": "concurrently \"cd frontend && npm run dev\" \"cd backend && npm run dev\""
},
"author": "",
"license": "ISC",
"description": "",
"devDependencies": {
"@types/express": "^5.0.0",
"@types/express-ws": "^3.0.5",
"@types/node": "^22.13.4",
"@types/ws": "^8.5.14",
"concurrently": "^9.1.2",
"nodemon": "^3.1.9",
"typescript": "^5.7.3"
},
"dependencies": {
"@types/node-fetch": "^2.6.12",
"classnames": "^2.5.1",
"express": "^4.21.2",
"express-ws": "^5.0.2",
"link-preview-js": "^3.0.14",
"node-fetch": "^2.7.0",
"react-icons": "^5.4.0",
"ws": "^8.18.0"
}
"workspaces": [
"backend",
"frontend"
]
}