A comprehensive full-stack solution for tracking and managing domain abuse reports with automated risk assessment and enterprise-grade dashboard
This monorepo contains a complete Trust & Safety platform with two main components:
- Backend API - RESTful API with JWT authentication, automated risk detection, and comprehensive report management
- Frontend Dashboard - Professional web interface for monitoring and managing abuse reports
- Node.js v18.17.0 or higher
- npm v9.0.0 or higher
# 1. Install backend dependencies
cd backend
npm install
# 2. Configure backend environment
cp .sample.env .env
# Edit .env with your configuration
# 3. Start backend server (Port 3000)
npm run dev
# 4. In a new terminal, install frontend dependencies
cd ../frontend
npm install
# 5. Start frontend (Port 3001)
npm run dev- Frontend Dashboard: http://localhost:3001
- Backend API: http://localhost:3000
- Default Credentials:
- Username:
admin - Password:
admin123
- Username:
radix-assignment/
βββ backend/ # Express.js REST API
β βββ config/ # Database and constants
β βββ controller/ # Business logic
β βββ middleware/ # Auth, logging, error handling
β βββ routes/ # API endpoints
β βββ tests/ # Jest test suite (110 tests)
β βββ database/ # SQLite database
β βββ .env.example # Environment template
β βββ package.json
β βββ server.js # Entry point
β βββ README.md # π Detailed backend documentation
β
βββ frontend/ # Next.js 15 Dashboard
β βββ app/ # Next.js App Router
β βββ components/ # React components
β βββ lib/ # API client, auth, utilities
β βββ public/ # Static assets
β βββ package.json
β βββ README.md # π Detailed frontend documentation
β
βββ README.md # This file
Each component has comprehensive documentation:
Location: backend/README.md
Topics Covered:
- Complete API reference with cURL examples
- Authentication & JWT configuration
- Database schema and initialization
- Risk assessment algorithm
- Testing guide (87% coverage)
- Security features and best practices
- Troubleshooting common issues
Quick Links:
Location: frontend/README.md
Topics Covered:
- User interface walkthrough
- Component architecture
- CSV bulk upload guide
- Deployment instructions (Vercel, Netlify)
- Environment configuration
- Troubleshooting UI issues
Quick Links:
- β JWT authentication with bcrypt password hashing
- β Automated risk assessment (High/Medium/Low)
- β Bulk report processing (up to 100 per request)
- β Advanced filtering and pagination
- β Comprehensive test coverage (110 tests)
- β Winston-based structured logging
- β SQL injection protection
- β Real-time analytics with interactive charts
- β CSV bulk upload with validation
- β Domain-specific detailed views
- β Status management workflow
- β Responsive design (mobile-ready)
- β Professional admin UI with shadcn/ui
- β Toast notifications and error handling
| Component | Technologies |
|---|---|
| Backend | Node.js, Express.js, SQLite, JWT, bcryptjs, Winston |
| Frontend | Next.js 15, React 19, TypeScript, Tailwind CSS v4, shadcn/ui |
| Testing | Jest, Supertest (87% coverage) |
| Data | Axios, React Hook Form, Zod, PapaParse, Recharts |
# Run backend tests
cd backend
npm test
# Run tests with coverage
npm test -- --coverage
# Watch mode
npm run test:watchTest Coverage: 87.54% (110 tests across 6 suites)
The backend can be deployed to:
- Railway
- Render
- Heroku
- AWS EC2
- DigitalOcean
Environment Variables Required:
PORT=3000
JWT_SECRET=your_production_secret
ADMIN_USERNAME=admin
ADMIN_PASSWORD=secure_password
NODE_ENV=productionRecommended: Vercel (one-click deploy)
Required Environment Variable:
NEXT_PUBLIC_API_URL=https://your-backend-api.comFor detailed deployment instructions, see frontend/README.md#deployment
- π Change default admin credentials immediately
- π Use strong JWT secrets (minimum 32 characters)
- π Configure CORS for production origins
- π‘οΈ Enable HTTPS in production
- π Review security headers (Helmet.js configured)
- π Implement rate limiting for production
- π Regular security audits with
npm audit
# Check if port 3000 is in use
netstat -ano | findstr :3000
# Verify .env file exists
ls backend/.env
# Reinstall dependencies
cd backend && rm -rf node_modules && npm install- Verify backend is running at http://localhost:3000
- Check
NEXT_PUBLIC_API_URLin.env.local - Confirm no CORS errors in browser console
- Test API directly:
curl http://localhost:3000/health
- Clear browser localStorage
- Generate new JWT token via
/api/login - Verify JWT_SECRET matches in backend
.env
For comprehensive troubleshooting, see:
POST /api/login
Body: { "username": "admin", "password": "admin123" }GET /api/reports # List all reports
GET /api/report/:domain # Get domain-specific reports
POST /api/report # Create single report
POST /api/reports/bulk # Bulk create (CSV upload)
POST /api/report/:id/status # Update case statusFull API documentation: backend/README.md#api-documentation
This is an assignment project. For any questions or issues:
- Check the detailed README files in
backend/andfrontend/ - Review the test files for usage examples
- Consult the API documentation sections
For detailed information, refer to the component-specific README files:
- Backend:
backend/README.md- API reference, testing, security - Frontend:
frontend/README.md- UI guide, deployment, troubleshooting
Built with β€οΈ for Trust & Safety Teams