Files
mrp/README.md
2026-03-14 14:44:40 -05:00

57 lines
2.1 KiB
Markdown

# MRP Codex
Foundation release for a modular Manufacturing Resource Planning platform built with React, Express, Prisma, SQLite, and a single-container Docker deployment.
## Workspace
- `client`: React, Vite, Tailwind frontend
- `server`: Express API, Prisma, auth/RBAC, file storage, PDF rendering
- `shared`: shared TypeScript contracts and constants
## Local development
1. Use Node.js 22 for local development if you want Prisma migration commands to behave the same way as Docker.
2. Install dependencies with `npm.cmd install`.
3. Copy [`.env.example`](D:\CODING\mrp-codex\.env.example) to `.env` and adjust values if needed.
4. Generate Prisma client with `npm run prisma:generate`.
5. Apply committed migrations with `npm run prisma:deploy`.
6. Start the workspace with `npm run dev`.
The frontend runs through Vite in development and is served statically by the API in production.
Seeded admin credentials for first login:
- email: `admin@mrp.local`
- password: `ChangeMe123!`
## Docker
Build and run:
```bash
docker build -t mrp-codex .
docker run -p 3000:3000 -v mrp_data:/app/data mrp-codex
```
The container startup script runs `npx prisma migrate deploy` automatically before launching the server.
## Persistence and backup
- SQLite database path: `/app/data/prisma/app.db`
- Uploaded files: `/app/data/uploads`
- Backup the entire mounted `/app/data` volume to preserve both records and attachments.
## Branding
Brand colors and typography are configured through the Company Settings page and the frontend theme token layer. Update runtime branding in-app, or adjust defaults in the theme config if you need a new baseline brand.
## Migrations
- Create a local migration: `npm run prisma:migrate`
- Apply committed migrations in production: `npm run prisma:deploy`
- If Prisma migration commands fail on a local Node 24 Windows environment, use Node 22 or Docker for migration execution. The committed migration files in `server/prisma/migrations` remain the source of truth.
## PDF generation
Puppeteer is used by the backend to render HTML templates into professional PDFs. The Docker image includes Chromium runtime dependencies required for headless execution.