A functional manufacturer support case management system built with Next.js, designed for n8n workflow integration and Vercel deployment.
- 📝 Submit Support Cases - Simple form with user_id and issue description
- 🔢 Automatic Task Numbers - Each case gets a unique tracking number (SUP-XXXXXX)
- 🔍 Status Checking - Look up case status by task number
- 🔗 n8n Integration - REST API endpoints for workflow automation
- ⚡ Vercel Ready - Optimized for serverless deployment
POST /api/cases
Content-Type: application/json
{
"user_id": "USR-12345",
"issueMessage": "Description of the issue"
}Response:
{
"success": true,
"taskNumber": "SUP-M5K3X7AB",
"message": "Support case created successfully. Your tracking number is SUP-M5K3X7AB"
}GET /api/cases/{taskNumber}Response:
{
"success": true,
"case": {
"taskNumber": "SUP-M5K3X7AB",
"userId": "USR-12345",
"issueMessage": "Description of the issue",
"status": "open",
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
}PUT /api/cases/{taskNumber}
Content-Type: application/json
{
"status": "in-progress"
}Valid status values: open, in-progress, resolved, closed
- Add an HTTP Request node
- Configure:
- Method:
POST - URL:
https://your-domain.vercel.app/api/cases - Body Type: JSON
- Body:
{ "user_id": "{{ $json.user_id }}", "issueMessage": "{{ $json.message }}" }
- Method:
- Add an HTTP Request node
- Configure:
- Method:
PUT - URL:
https://your-domain.vercel.app/api/cases/{{ $json.taskNumber }} - Body Type: JSON
- Body:
{ "status": "resolved" }
- Method:
# Install dependencies
npm install
# Start development server
npm run dev
# Open http://localhost:3000# Install Vercel CLI
npm i -g vercel
# Deploy
vercel- Push code to GitHub
- Import project in Vercel Dashboard
- Deploy automatically
├── src/
│ ├── components/
│ │ └── Layout.tsx # Shared layout with header/footer
│ ├── lib/
│ │ └── store.ts # In-memory data store
│ ├── pages/
│ │ ├── api/
│ │ │ └── cases/
│ │ │ ├── index.ts # POST endpoint
│ │ │ └── [taskNumber].ts # GET/PUT endpoint
│ │ ├── _app.tsx # App wrapper
│ │ ├── index.tsx # Submit case form
│ │ └── status.tsx # Status check page
│ ├── styles/
│ │ └── globals.css # Tailwind CSS
│ └── types/
│ └── index.ts # TypeScript interfaces
├── package.json
├── tailwind.config.js
└── tsconfig.json
The current implementation uses an in-memory store for demo purposes. For production:
- Add a Database: Connect to PostgreSQL, MongoDB, or use Vercel's KV/Postgres
- Add Authentication: Protect API endpoints with API keys or OAuth
- Add Rate Limiting: Prevent abuse with rate limiting middleware
- Add Logging: Integrate with a logging service for monitoring
npm install @vercel/postgresThen update src/lib/store.ts to use SQL queries instead of the Map.
For production with a database, add these to Vercel:
DATABASE_URL=your_database_connection_string
API_KEY=your_secret_api_keyMIT