How jet-labs/jet-admin works
Main Components
• Frontend Application: A React-based application that handles the user interface for editing data, creating queries, forming dashboards, and displaying multiple chart types.
• Backend Application: A Node.js/Express server that exposes REST APIs for database operations (full DML and DDL support), authentication, and query management.
• Database: PostgreSQL is central to the project. Note that Prisma is used as the ORM.
• External Services: Firebase (for authentication) and possibly Supabase (as the frontend configuration shows its use as a secondary data source).
• Containerization & Deployment: Dockerfiles in both the frontend and backend imply containerized deployment processes.
• Documentation: Although not part of runtime architecture, the docs directory provides additional architectural and usage insights.
Component Relationships and Interactions
• The Frontend communicates with the Backend via REST API endpoints. This includes API calls for authentication, API key management, executing queries, and managing dashboards and visualizations.
• The Backend interacts with PostgreSQL to perform CRUD operations and execute complex database queries. It also uses Prisma for data modeling and migrations.
• The Backend integrates with Firebase for user authentication and implements role-based, multi-tenant access control.
• External libraries such as Winston, Morgan, and other utilities help with logging, error handling, and request processing in the backend.
• Docker configurations facilitate development, deployment, and consistent runtime environments.
Architectural Patterns and Design Principles
• Layered Architecture: Clear separation between API routing, business logic (services), controllers, and middleware (as seen in the folder structure under modules).
• Modular Organization: Each feature (like auth, database, apiKey, tenant management, etc.) is organized as a module with its own controller, service, middleware, and routes.
• Separation of Concerns: Frontend UI logic is kept distinct from backend service logic, and further divided into contexts/hooks for state management.
• Containerization: Use Docker for both backend and frontend services, ensuring environments remain consistent in development and production.