NOTE: This is only the frontend part of the project. No backend logic (API calls or transcription) is implemented. Demo Link - https://youtu.be/7Nl7r5ozyEU
A full‑stack app where companies register, manage employees, and track customer queries with real‑time updates. Employees resolve incoming queries; companies get a rich dashboard for insights.
- Companies & Employees: Register/login, add employees with auto credentials
- Queries: Create queries, view transcripts, listen to recordings, close/resolve
- Company‑scoped data: Each company only sees its own queries
- Realtime: Live updates via Socket.io (new/closed queries)
- Secure: JWT auth, role‑based routes, hashed passwords
backend/
server.js
routes/
company.js
queries.js
models/
Company.js
Query.js (Summary)
frontend/
src/
pages/ (CompanyDashboard, EmployeeDashboard, Login/Register, etc.)
services/api.js
- Node.js 16+
- npm
- Local MongoDB running at
mongodb://127.0.0.1:27017/mydb
- Install deps
cd backend && npm install
cd ../frontend && npm install- Start backend (http://localhost:5000)
cd backend
npm start- Start frontend (http://localhost:3000)
cd frontend
npm run devBackend CORS and Socket.io are already configured for the frontend at http://localhost:3000.
Create backend/.env to customize:
PORT=5000
MONGO_URI=mongodb://127.0.0.1:27017/mydb
JWT_SECRET=change_me
JWT_EXPIRES=365d
- Register a company → receive a unique 4‑digit registration number
- Login as that company → go to the company dashboard
- Add employees (auto email/password) and share credentials
- Employees login with the company registration number → work the open queries
- Current default: On company register, one sample query is seeded to your local MongoDB for that company.
- You can also manually seed later via API
POST /api/queries/sample(see below) if you remove auto‑seeding.
To disable automatic seeding: remove the seeding block in backend/routes/company.js under the register route and rely solely on POST /api/queries/sample.
Base URL: http://localhost:5000/api
- Token is stored in
localStorage.token - Actor details in
localStorage.actor
POST /company/register– create a companyPOST /company/login– returns{ token, company }GET /company/me– current company profile (auth: company)POST /company/:companyId/employees– add employee (auth: company, same company)POST /company/employee/login– employee login via registration numberGET /company/employee/me– current employee profile (auth: employee)
GET /queries/all– list all queries for the authenticated company (auth: company)GET /queries/unsolved– list unsolved queries for employee’s company (auth: employee)POST /queries– create a query (auth: company)PATCH /queries/:queryId/close– close a query (auth: employee)GET /queries/:queryId– fetch query details (auth)POST /queries/sample– seed sample queries for the authenticated company (auth: company)
Headers for auth routes:
Authorization: Bearer <JWT_TOKEN>
Content-Type: application/json
Default sample (one item):
curl -X POST http://localhost:5000/api/queries/sample \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{}'Custom samples:
curl -X POST http://localhost:5000/api/queries/sample \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"samples": [
{
"Url_call": "https://example.com/rec1.wav",
"Call_data": "User asked about delivery.",
"Transcript": "User: Do you deliver?\nAgent: Yes...",
"Call_Summary": "Delivery inquiry",
"Complaint_Summary": ""
}
]
}'Company
name, email, registrationNumber, password, employees[{ name, email, password, phoneNumber }]
Summary (Query)
companyId, Solved, Url_call, Call_data, Transcript, Call_Summary,
Complaint_Summary?, closedBy { employeeId, employeeName, closedAt }
Socket.io broadcasts:
newQuerywhen a query is createdqueryClosedwhen a query is closed
Front‑end listens and reloads lists accordingly.
- Company register/login works
- Dashboard shows seeded sample (if auto‑seeding on)
- POST
/queries/sampleadds records for current company - Add employee → employee can login and view unsolved queries
- Employee can close a query → dashboard updates in realtime
- 401/403: Check your
Authorization: Bearer <token>header - CORS: Frontend must run on
http://localhost:3000 - Mongo: Ensure local Mongo is running on
mongodb://127.0.0.1:27017/mydb - Socket: Verify both servers are running and open DevTools console
This project is provided as‑is for hackathon/learning use.