Electronic trading communication platform for LME brokers and traders. Monorepo with React frontend, Express backend, and PostgreSQL database. Includes JWT auth, RFQ system, order management, and audit logging.
MetMatch is an electronic trading communication platform for LME (London Metal Exchange) brokers, traders, and market makers. This is a monorepo project with separate frontend (React) and backend (Express) applications using TypeScript throughout.
This is a monorepo with:
**IMPORTANT: Port Usage**
When setting up the project for the first time:
1. **Start the database:**
```bash
docker-compose up -d
```
2. **Install all dependencies** (uses npm workspaces):
```bash
npm install
```
3. **Setup backend environment:**
```bash
cp backend/.env.example backend/.env
```
Then edit `backend/.env` and configure:
- `DATABASE_URL`: PostgreSQL connection string
- `JWT_SECRET`: Change to a secure value for production
- `PORT`: Must be set to 5001
- `FRONTEND_URL`: For CORS configuration
4. **Initialize database:**
```bash
cd backend
npx prisma generate
npx prisma db push
cd ..
```
```bash
npm run dev
```
```bash
npm run dev:backend # API on http://localhost:5001
npm run dev:frontend # UI on http://localhost:5173
```
**All database commands must be run from the `backend` directory:**
```bash
cd backend
npx prisma migrate dev
npx prisma db push
npx prisma studio
npx prisma generate
```
The backend follows a layered architecture:
Key models in `backend/prisma/schema.prisma`:
1. Update both `auth.controller.ts` and `auth.middleware.ts`
2. Ensure token refresh logic remains intact
3. Test with expired tokens
4. Update AuthStore if client-side changes needed
1. Create route file in `backend/src/routes/`
2. Add controller in `backend/src/controllers/`
3. Apply appropriate middleware (auth, validation, telemetry)
4. Add to main router in `backend/src/index.ts`
5. Log significant actions via AuditService for compliance
1. Edit `backend/prisma/schema.prisma`
2. Run `npx prisma generate` to update Prisma client
3. Run `npx prisma db push` for development testing
4. Create migration with `npx prisma migrate dev` for production
1. Use the configured axios instance from `frontend/src/services/api.ts`
2. It automatically handles auth headers and token refresh
3. Check response interceptors for error handling patterns
4. Default API URL is `http://localhost:5001/api`
```bash
npm run build
cd backend && npm run build
cd frontend && npm run build
```
1. **Always verify the backend port is 5001** before starting development
2. **Run database operations from the `backend` directory**
3. **Use npm workspaces commands from the root** for cross-workspace operations
4. **Check `backend/.env.example`** for required environment variables
5. **Audit logs are automatic** for significant user actions
6. **Token refresh is handled automatically** by the frontend API client
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/metmatch-electronic-trading-platform/raw