Make decisions transparent, explainable, and auditable.
DecisionLens goes beyond showing outcomes — it explains why decisions were made, why alternatives were rejected, provides confidence scores, risk assessments, and full audit trails.
- Node.js v18+
- PostgreSQL 16+ (or Docker)
- npm or yarn
Option A: Docker (recommended)
docker compose up postgres -dOption B: Local PostgreSQL
Create a database called decisionlens_db and update backend/.env with your connection string.
cd backend
npm install
npx prisma migrate dev --name init
npx prisma db seed
npm run devThe API will be running at http://localhost:5000
cd frontend
npm install
npm run devThe UI will be running at http://localhost:5173
Open http://localhost:5173 and sign in with:
| Role | Password | |
|---|---|---|
| Admin | admin@decisionlens.com | Admin123! |
| Analyst | analyst@decisionlens.com | Analyst123! |
| Manager | manager@decisionlens.com | Manager123! |
docker compose up --buildThis starts PostgreSQL, Backend API, and Frontend in one command.
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
DecisionLens/
├── backend/
│ ├── prisma/
│ │ ├── schema.prisma # Database schema
│ │ └── seed.ts # Seed data
│ ├── src/
│ │ ├── middleware/
│ │ │ ├── authMiddleware.ts # JWT authentication
│ │ │ ├── roleMiddleware.ts # RBAC authorization
│ │ │ └── errorHandler.ts # Global error handling
│ │ ├── routes/
│ │ │ ├── auth.ts # Auth endpoints
│ │ │ ├── decisions.ts # Decision CRUD
│ │ │ ├── uploads.ts # File upload
│ │ │ ├── analytics.ts # Dashboard analytics
│ │ │ ├── audit.ts # Audit logs
│ │ │ └── settings.ts # User/admin settings
│ │ ├── utils/
│ │ │ ├── explainabilityEngine.ts # Core AI engine
│ │ │ └── logger.ts # Winston logger
│ │ ├── server.ts # Express app
│ │ └── index.ts # Entry point
│ ├── package.json
│ ├── tsconfig.json
│ ├── Dockerfile
│ └── .env
├── frontend/
│ ├── src/
│ │ ├── components/layout/ # Sidebar, Topbar, Layout
│ │ ├── context/ # Auth, Theme providers
│ │ ├── pages/ # All page components
│ │ ├── utils/api.ts # API client
│ │ ├── App.tsx # Router
│ │ ├── main.tsx # Entry
│ │ └── index.css # Global styles
│ ├── package.json
│ ├── tailwind.config.js
│ ├── vite.config.ts
│ ├── Dockerfile
│ └── index.html
├── docker-compose.yml
└── README.md
- Total, approved, rejected, high-risk decision counts
- Average confidence score
- Decision trend charts (area, bar, pie)
- Recent activity feed
- Search, filter, sort, paginate
- Outcome and risk badges
- Confidence progress bars
- Outcome summary with scores
- Explanation report
- Factor analysis (bar + radar charts)
- Rejected alternatives with reasoning
- Historical case comparisons
- Audit timeline
- Configurable decision type presets
- Adjustable factor sliders
- Real-time evaluation
- Save results to database
- 6 interactive charts
- Volume, approval, risk, and confidence trends
- Distribution breakdowns
- Drag-and-drop (CSV, Excel, PDF, DOCX)
- Progress tracking
- Upload history with delete
- User management (role updates, delete)
- File management
- Searchable audit logs
- Profile management
- Password update
- Dark/light theme toggle
- Notification preferences
- JWT token-based authentication
- RBAC with three roles: Admin, Manager, Analyst
- Admin-only routes protected on both client and server
- Passwords hashed with bcrypt (12 rounds)
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /api/auth/register | ❌ | Register new user |
| POST | /api/auth/login | ❌ | Login |
| GET | /api/auth/me | ✅ | Get current user |
| POST | /api/auth/forgot-password | ❌ | Request password reset |
| POST | /api/auth/reset-password | ❌ | Reset password with token |
| GET | /api/decisions | ✅ | List decisions (paginated) |
| GET | /api/decisions/:id | ✅ | Get decision with full details |
| POST | /api/decisions | ✅ | Create decision |
| PUT | /api/decisions/:id | ✅ | Update decision |
| DELETE | /api/decisions/:id | ✅ | Delete decision |
| POST | /api/decisions/evaluate | ✅ | Run explainability engine |
| POST | /api/uploads | ✅ | Upload file |
| GET | /api/uploads | ✅ | List uploads |
| DELETE | /api/uploads/:id | ✅ | Delete upload |
| GET | /api/analytics/summary | ✅ | Dashboard summary stats |
| GET | /api/analytics/trends | ✅ | Trend data for charts |
| GET | /api/analytics/recent | ✅ | Recent activity |
| GET | /api/audit | ✅ | List audit logs |
| GET | /api/settings/profile | ✅ | Get profile |
| PUT | /api/settings/profile | ✅ | Update profile |
| PUT | /api/settings/password | ✅ | Change password |
| GET | /api/settings/users | 🔒 | List users (Admin only) |
| PUT | /api/settings/users/:id/role | 🔒 | Update user role (Admin only) |
| DELETE | /api/settings/users/:id | 🔒 | Delete user (Admin only) |
| Layer | Technology |
|---|---|
| Frontend | React, TypeScript, Tailwind CSS |
| Routing | React Router v6 |
| Charts | Recharts |
| Icons | Lucide React |
| Backend | Node.js, Express, TypeScript |
| ORM | Prisma |
| Database | PostgreSQL |
| Auth | JWT + bcrypt |
| File Upload | Multer |
| Logging | Winston |
| Build | Vite |
| Deployment | Docker + Docker Compose |
MIT