https://github.com/joao1barbosa/csv-operator-distribution
Full-stack application for assigning clients to operators with CSV import and export.
https://github.com/joao1barbosa/csv-operator-distribution
csv docker mysql nestjs nextjs typescript
Last synced: 8 days ago
JSON representation
Full-stack application for assigning clients to operators with CSV import and export.
- Host: GitHub
- URL: https://github.com/joao1barbosa/csv-operator-distribution
- Owner: joao1barbosa
- License: mit
- Created: 2024-09-04T18:12:21.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2026-07-04T21:17:25.000Z (16 days ago)
- Last Synced: 2026-07-04T23:08:49.886Z (16 days ago)
- Topics: csv, docker, mysql, nestjs, nextjs, typescript
- Language: TypeScript
- Homepage:
- Size: 6.04 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ CSV Operator Distribution
> A full-stack technical challenge: bulk-register clients from a CSV upload and distribute them across operators โ with CSV import/export and a per-layer tested NestJS API. TypeScript end to end.
## ๐ Overview
Solution to a full-stack technical challenge. The app lets you view operators and the
clients assigned to them, register clients in bulk by uploading a CSV (each client is
distributed to an operator on upload), and export all clients back to CSV.
- View operators and their assigned clients.
- Upload a CSV to register clients immediately, distributed across operators (round-robin).
- Export all clients to a CSV file.
- Redistribute existing clients across operators.
## ๐ Tech Stack
| Layer | Technology |
|-------|-----------|
| **Frontend** | TypeScript, React, Next.js, React Query, React Hook Form, Zod, Tailwind, shadcn/ui |
| **Backend** | NestJS, Multer, csv-parser, fast-csv |
| **ORM / DB** | Prisma ยท MySQL |
| **Testing** | Jest |
| **Runtime** | Docker / Docker Compose |
## ๐ท Demo


Database schema:

## ๐ Architecture
A NestJS API with clear layering โ **controllers โ services โ repositories**, with DTOs,
entities, and validators per module (`clients`, `operators`) โ behind a Next.js frontend.
CSV parsing is streamed; client distribution is a round-robin over the available operators.
## ๐งช Testing
Unit tests with Jest, **one spec per layer** (service, controller, validator):
```bash
cd backend && yarn test
```
## ๐ง How to Run Locally
**Prerequisites:** Docker + Docker Compose V2.
The `.env.example` ships pre-filled (this is not a production app) โ just copy it to `.env`.
```bash
docker compose up --build -d
```
## ๐ก API Reference
**Operators** โ `POST /operators`, `GET /operators`, `GET /operators/:id`,
`PATCH /operators/:id`, `DELETE /operators/:id`.
**Clients** โ `GET /clients`, `GET /clients/:id`, `POST /clients`, `PATCH /clients/:id`,
`DELETE /clients/:id`, `POST /clients/upload` (CSV, form-data `file`),
`GET /clients/download` (CSV export), `GET /clients/redistribute`.
## ๐ค Author
**Joรฃo Barbosa** โ Software Engineer (backend / platform).
[LinkedIn](https://www.linkedin.com/in/joao1barbosa/) ยท [GitHub](https://github.com/joao1barbosa)