Versão em português (Brasil): README.pt-BR.md
Dev Controle is a full-stack web application for managing customer support tickets. Each authenticated user operates in an isolated workspace, seeing only their own customers and tickets.
- Open tickets linked to a registered customer
- Edit subject, description, and status at any time
- Delete tickets with a confirmation dialog to prevent accidental removal
- Filter tickets by free-text search (subject, description, or customer name) and by status
- Status badge and elapsed time displayed inline on every ticket row
- Kanban-style view with one column per status: Open, In Progress, Resolved, Closed
- Move tickets to the next stage directly from the board
- Unmapped statuses are surfaced in a warning section for quick cleanup
- Start and pause a work timer on any in-progress ticket
- Accumulated work time persists across sessions
- Live counter updates every second while the timer is running
- Register customers with name, email, phone, and address
- Delete customers (blocked if the customer has open tickets)
- Customer data is scoped per user
- Summary cards: total tickets, distinct customers, statuses in use
- Bar chart of ticket volume by customer
- Doughnut chart of ticket distribution by status
- Highlighted top customer by volume
- User listing and role management (ADMIN / USER)
- Restricted to users with the ADMIN role
- Observability charts for system health (extensible)
- Authentication via NextAuth (sign in / sign out)
- Per-user data isolation enforced at the database query level
- Light and dark mode with system preference detection
- Responsive layout (mobile-first)
- Toast notifications for user feedback
- Accessible markup: semantic HTML,
aria-*attributes, keyboard navigation
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| Language | TypeScript |
| Styling | Tailwind CSS v4 |
| Database ORM | Prisma + MongoDB |
| Authentication | NextAuth v4 |
| Charts | Chart.js + react-chartjs-2 |
| Forms | React Hook Form + Zod |
| Toasts | Sonner |
| Monitoring | Sentry + Core Web Vitals |
| Unit/Integration tests | Vitest + Testing Library |
| E2E tests | Playwright |
| CI/CD | GitHub Actions |
| Containerization | Docker + Docker Compose |
- Server actions handle all mutations (create, update, delete). Client components call server actions directly — no REST API layer for internal operations.
- Server components fetch data from Prisma at render time. Only components that need interactivity (modals, timers, forms) are client components.
- Shared components (
MetricCard,Container,Input,ThemeToggle) avoid duplication across pages. - Role-based access control is enforced both at the UI level (admin tab hidden for non-admins) and at the action level (session check before every mutation).
- Node.js 18+
- A MongoDB connection string
- A NextAuth secret and OAuth provider credentials
npm installcp .env.example .envFill in DATABASE_URL, NEXTAUTH_SECRET, and your OAuth provider variables.
npm run devOpen http://localhost:3000.
| Script | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run start |
Run production build |
npm run lint |
Run ESLint |
npm run lint:fix |
Run ESLint with auto-fix |
npm run format |
Format with Prettier |
npm run type-check |
TypeScript type checking |
npm run test:integration |
Run integration tests |
npm run test:coverage |
Integration tests with coverage report |
npm run test:e2e |
Playwright E2E (browsers installed locally) |
npm run test:e2e:docker |
Playwright E2E inside Docker |
- Sentry captures errors with full stack traces on client, server, and edge runtimes.
- Core Web Vitals (
LCP,INP,CLS) are collected and persisted in MongoDB viaPOST /api/monitoring/web-vitals. Metrics ratedpoororneeds-improvementare also sent to Sentry.
SENTRY_DSN=
NEXT_PUBLIC_SENTRY_DSN=
SENTRY_ENVIRONMENT=development
NEXT_PUBLIC_SENTRY_ENVIRONMENT=development
SENTRY_TRACES_SAMPLE_RATE=0.1
NEXT_PUBLIC_SENTRY_TRACES_SAMPLE_RATE=0.1
SENTRY_PROFILES_SAMPLE_RATE=0.1
SENTRY_AUTH_TOKEN=
SENTRY_ORG=
SENTRY_PROJECT=SENTRY_AUTH_TOKEN, SENTRY_ORG, and SENTRY_PROJECT are required for source map upload at build time.
# Start the app
npm run docker:up
# Follow logs
npm run docker:logs
# Stop containers
npm run docker:down
# Run E2E tests in Docker
npm run docker:e2eFiles: Dockerfile (production app), Dockerfile.e2e (Playwright), docker-compose.yml.
GitHub Actions workflow at .github/workflows/ci.yml runs on every push and pull request:
npm run lintnpm run type-checknpm run test:integrationnpm run build
To protect main, enable branch protection in Settings > Branches and require the Lint, Typecheck, Tests and Build check to pass before merging.
- Testing: docs/testing/testing.en.md
- Monitoring: docs/monitoring/monitoring.en.md
- CI/CD: docs/ci-cd/ci-cd.en.md
- Audit trail with a per-ticket change history timeline
- Email notifications on ticket status changes
- File attachment support on tickets
- SLA / deadline tracking per ticket
- Export reports as PDF or CSV