MTool
Published on 2026-01-30
Last updated on 2026-02-01
Technical
AI
Executive Summary Key Achievements 1. Architecture Overview 1.1 High-Level Architecture 1.2 BFF Authentication Pattern 2. Technology Stack 2.1 Technology Overview 2.2 Frontend Service 2.3 Backend Service 2.4 Auth Service 3. Database Design 3.1 Entity Relationship Diagram 3.2 Model Summary 4. User Interface 4.1 Application Navigation Structure 4.2 UI Component Library 4.3 Design System 5. Security Architecture 5.1 Authentication Flow 5.2 Role-Based Access Control (RBAC) 5.3 External Group Mapping (IAS Integration) 5.4 Session Security 5.5 Personal Access Tokens (PAT) 6. Observability Stack 6.1 Distributed Tracing Flow 6.2 Metrics Architecture 6.3 Structured Logging 7. Integration Points 7.1 SAP ABAP Data Sync 7.2 CI/CD Integration (OPA Reports) 7.3 SAP Identity Authentication Service (IAS) 8. Deployment Architecture 8.1 Docker Compose Topology 8.2 Environment URLs 9. Key Features 9.1 Feature Overview 9.2 E2E Test Dashboard 9.3 Automated Data Sync 10. Development Workflow 10.1 Local Development Commands 10.2 Git Workflow 10.3 Build & Deploy 11. Success Metrics 11.1 Technical Excellence 11.2 Business Value Appendix A: API Endpoints Authentication API (/api/v1/auth) E2E Automation API (/api/v1/e2e-automation) Appendix B: Configuration Reference Required Environment Variables Executive Summary
MTool is a full-stack enterprise application designed to manage and visualize End-to-End (E2E) test automation results for SAP ABAP and non-ABAP systems. The platform consolidates test data from multiple sources, provides real-time dashboards, and implements enterprise-grade security with SAP Identity Authentication Service (IAS) integration.
Key Achievements
Metric Value Architecture Microservices with BFF Pattern Services 3 (Frontend, Backend, Auth) Database Models 20+ entities UI Components 22 reusable components Languages Supported 3 (English, Chinese, German) Auth Methods 2 (Credentials + OIDC/IAS) Observability Full OpenTelemetry + Prometheus
1. Architecture Overview
1.1 High-Level Architecture
1.2 BFF Authentication Pattern
The application implements a Backend for Frontend (BFF) pattern for secure authentication:
Benefits:
Security : Cookies scoped to frontend domain only
Simplicity : No CORS configuration needed for auth
Flexibility : Same configuration works for dev and production
2. Technology Stack
2.1 Technology Overview
2.2 Frontend Service
Category Technology Version Purpose Framework Next.js 16+ React framework with App Router Runtime Bun Latest Fast JavaScript runtime Language TypeScript 5.x Type-safe development Styling Tailwind CSS v4 Utility-first CSS UI Components shadcn/ui + Radix Latest Accessible component library Authentication Better-Auth React 1.4.x Client-side auth hooks i18n i18next Latest Internationalization Notifications Sonner 2.0+ Toast notifications Charts Recharts Latest Data visualization
2.3 Backend Service
Category Technology Version Purpose Language Go 1.25+ High-performance backend Framework Echo v4.14 HTTP routing framework ORM GORM 1.31 Database operations Scheduler robfig/cron v3 Job scheduling Tracing OpenTelemetry 1.39 Distributed tracing Metrics Prometheus Latest Metrics export
2.4 Auth Service
Category Technology Version Purpose Language TypeScript 5.x Type-safe development Framework Hono Latest Lightweight web framework Auth Library Better-Auth 1.4.9 Authentication framework ORM Prisma Latest Type-safe database client OIDC Generic OAuth Built-in SAP IAS integration
3. Database Design
3.1 Entity Relationship Diagram
3.2 Model Summary
| Domain | Models | Purpose |
|—|—||
| Authentication | 7 | User, Session, Account, Role, Permission, RolePermission, AccessToken |
| Business | 5 | Topic, Sprint, Connection, TestCase, Scheduler |
| Reports | 7 | PDOC, APE, OPA (5-level hierarchy) |
4. User Interface
4.1 Application Navigation Structure
4.2 UI Component Library
Built on shadcn/ui with Radix UI primitives for accessibility:
Category Components Layout Card, Separator, Tabs, ScrollArea Forms Input, Select, Switch, Checkbox, Label Feedback Alert, AlertDialog, Badge, Toast (Sonner) Data Display Table (with resizable columns), Chart Navigation Command, Popover, Dialog Utility Button, Avatar, Calendar
4.3 Design System
Color Scheme : CSS variables with OKLCH color space
Dark Mode : Class-based toggle (.dark class)
Typography : Material Symbols icon system
Responsive : Mobile-first Tailwind breakpoints
Accessibility : ARIA attributes, keyboard navigation
5. Security Architecture
5.1 Authentication Flow
5.2 Role-Based Access Control (RBAC)
5.3 External Group Mapping (IAS Integration)
5.4 Session Security
Parameter Value Purpose Absolute Timeout 8 hours Maximum session lifetime Idle Timeout 30 minutes Require revalidation after inactivity Cookie Cache 5 minutes Client-side session cache Session Expiry Toast Enabled User notification on 401
5.5 Personal Access Tokens (PAT)
6. Observability Stack
6.1 Distributed Tracing Flow
6.2 Metrics Architecture
6.3 Structured Logging
Format : JSON (machine-parseable)
Correlation ID : X-Correlation-ID header propagation
Fields : timestamp, level, service, trace_id, user_id, message
Sensitive Data : Password/token redaction
7. Integration Points
7.1 SAP ABAP Data Sync
7.2 CI/CD Integration (OPA Reports)
7.3 SAP Identity Authentication Service (IAS)
Configuration Value Protocol OpenID Connect (OIDC) Discovery {issuer}/.well-known/openid-configurationScopes openid, profile, email, groups Callback https://{frontend}/api/v1/auth/oauth2/callback/sap
8. Deployment Architecture
8.1 Docker Compose Topology
8.2 Environment URLs
Environment Frontend Backend Auth Local localhost:3000 localhost:5000 localhost:4000 Test mtool-test.maco.only.sap mtool-test-backend… mtool-test-auth… Production mtool.maco.only.sap mtool-backend… mtool-auth…
9. Key Features
9.1 Feature Overview
9.2 E2E Test Dashboard
Real-time visualization of test results
Historical trend analysis across sprints
Filter by : Topic, Sprint, Connection, Test Case
Export capabilities for reports
9.3 Automated Data Sync
Cron-based scheduling for automated sync
Manual trigger option for immediate sync
Execution history with status tracking
Partial failure handling (continues on error)
10. Development Workflow
10.1 Local Development Commands
make dev-auth # Port 4000
make dev-backend # Port 5000
make dev-front # Port 3000
10.2 Git Workflow
10.3 Build & Deploy
11. Success Metrics
11.1 Technical Excellence
Metric Status Type Safety TypeScript + Go static typing Code Quality ESLint, Go vet, Prettier Security RBAC, encrypted passwords, secure sessions Observability Full stack tracing + metrics Documentation Comprehensive README + specifications
11.2 Business Value
Capability Benefit Consolidated Dashboard Single source of truth for E2E test results Automated Sync Reduced manual effort for data collection Enterprise SSO Seamless integration with SAP IAS Role-Based Access Secure multi-team collaboration API Tokens CI/CD pipeline integration
Appendix A: API Endpoints
Authentication API (/api/v1/auth)
Method Endpoint Description POST /sign-in/emailEmail/password login POST /sign-in/socialOIDC/SSO login GET /get-sessionValidate session GET /user/profileGet current user PUT /user/profileUpdate profile GET/POST/DELETE /tokensPAT management
E2E Automation API (/api/v1/e2e-automation)
Method Endpoint Description GET/POST/PUT/DELETE /settings/sprintsSprint CRUD GET/POST/PUT/DELETE /settings/connectionsConnection CRUD GET/POST/PUT/DELETE /settings/test-casesTest case CRUD GET/POST/PUT/DELETE /settings/schedulerScheduler CRUD GET /reports/abapGet ABAP reports POST /reports/abap/syncTrigger sync POST /reports/opaUpload OPA report GET /reports/opaGet OPA reports GET /jobs/historySync history
Appendix B: Configuration Reference
Required Environment Variables
Service Variable Description Auth DATABASE_URLPostgreSQL connection Auth BETTER_AUTH_SECRETSession signing secret Auth BETTER_AUTH_URLFrontend URL (BFF) Auth TRUSTED_ORIGINSCORS origins Backend DATABASE_URLPostgreSQL connection Backend AUTH_SERVICE_URLAuth service URL Backend ENCRYPTION_KEYAES-256 key (64 hex chars) Frontend NEXT_PUBLIC_BETTER_AUTH_URLBrowser auth endpoint Frontend AUTH_URLServer-side auth proxy Frontend NEXT_PUBLIC_BACKEND_URLBackend API URL
Document generated for MTool project showcase. For technical inquiries, refer to the codebase specifications directory.
Back to Blog