- Node/Express/TypeScript API under /api/v1 with JWT auth (login, refresh, logout, /me) - Prisma schema: vendors, users, roles, products, categories, taxes, transactions - SQLite for local dev; Postgres via docker-compose for production - Full CRUD routes for vendors, users, categories, taxes, products with Zod validation and RBAC - Paginated list endpoints scoped per vendor; refresh token rotation - React/TypeScript admin SPA (Vite): login, protected routing, sidebar layout - Pages: Dashboard, Catalog (tabbed Products/Categories/Taxes), Users, Vendor Settings - Shared UI: Table, Modal, FormField, Btn, PageHeader components - Multi-stage Dockerfile; docker-compose with Postgres healthcheck - Seed script with demo vendor and owner account - INSTRUCTIONS.md, ROADMAP.md, .claude/launch.json for dev server config Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
45 lines
1.0 KiB
Docker
45 lines
1.0 KiB
Docker
# Stage 1: Build
|
|
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install server deps and build
|
|
COPY server/package*.json ./server/
|
|
RUN cd server && npm ci
|
|
|
|
COPY server/ ./server/
|
|
RUN cd server && npm run db:generate && npm run build
|
|
|
|
# Install client deps and build
|
|
COPY client/package*.json ./client/
|
|
RUN cd client && npm ci
|
|
|
|
COPY client/ ./client/
|
|
RUN cd client && npm run build
|
|
|
|
# Stage 2: Runtime
|
|
FROM node:20-alpine AS runtime
|
|
|
|
WORKDIR /app
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
# Copy server production deps
|
|
COPY server/package*.json ./server/
|
|
RUN cd server && npm ci --omit=dev
|
|
|
|
# Copy built server
|
|
COPY --from=builder /app/server/dist ./server/dist
|
|
COPY --from=builder /app/server/prisma ./server/prisma
|
|
COPY --from=builder /app/server/node_modules/.prisma ./server/node_modules/.prisma
|
|
COPY --from=builder /app/server/node_modules/@prisma ./server/node_modules/@prisma
|
|
|
|
# Copy built client
|
|
COPY --from=builder /app/client/dist ./client/dist
|
|
|
|
EXPOSE 8080
|
|
|
|
WORKDIR /app/server
|
|
|
|
CMD ["sh", "-c", "npx prisma migrate deploy && node dist/index.js"]
|