This document explains the technical structure of DXLander and how all the pieces fit together.
DXLander is a TypeScript monorepo built with modern tools and best practices. It follows a microservices-inspired architecture where each package has a specific responsibility.
dxlander/
├── apps/ # Applications (user-facing)
│ ├── api/ # Backend API server (Hono + tRPC)
│ └── web/ # Frontend web application (Next.js 15)
├── packages/ # Shared libraries and services
│ ├── shared/ # Common utilities and services
│ ├── database/ # Database layer and schema
│ ├── ai-agents/ # AI integration services
│ ├── config-gen/ # Configuration generation logic
│ └── integrations/ # External service integrations
├── bin/ # CLI entry point
├── tests/ # Test suites
└── documentation/ # documentation
Technology: Hono + Node.js + tRPC Port: 3001 (development) Purpose: Backend API providing all data and business logic
Key Files:
src/index.ts- Server entry point, middleware setupsrc/context.ts- tRPC context creation (database, auth)src/routes/- API endpoints organized by featuresrc/middleware/- Authentication, setup detection, error handlingsrc/services/- Business logic services
Routes:
/auth- Authentication (login, logout, user management)/setup- First-time setup wizard/projects- Project CRUD, GitHub import, file management/ai-providers- AI service configuration (OpenAI, Claude, etc.)/deployment-targets- Deployment credential management/configs- Build configuration generation and management/deployments- Deployment tracking and execution/settings- Application settings and encryption key management
Technology: Next.js 15 + React 19 + TailwindCSS v4 Port: 3000 (development) Purpose: User interface for all DXLander functionality
Key Directories:
app/- Next.js App Router pages and layoutscomponents/- Reusable React componentslib/- Frontend utilities and configurationpublic/- Static assets (logos, icons, etc.)
Design System:
- Theme: Ocean-inspired (#3b82f6 primary color)
- Font: Satoshi font family
- Components: shadcn/ui with custom ocean theme
- Styling: TailwindCSS v4 with design tokens
Key Pages:
/- Landing page with setup detection/setup- First-time setup wizard/login- User authentication/dashboard- Main project overview/dashboard/import- Project import (GitHub, ZIP upload)/dashboard/deployments- Deployment targets and credential management/dashboard/settings- Settings hub with card-based navigation/dashboard/settings/ai-providers- AI provider configuration/dashboard/settings/security- Security and encryption management/dashboard/settings/database- Database configuration and analytics/dashboard/settings/backup- Backup and restore management/project/[id]- Project detail and management/project/[id]/configs- Build configuration management
Purpose: Common utilities, types, and services used across all applications
Key Modules:
src/services/encryption.ts- AES-256-GCM encryption for credentialssrc/services/github.ts- GitHub API integrationsrc/services/gitlab.ts- GitLab API integrationsrc/services/bitbucket.ts- Bitbucket API integrationsrc/services/project.ts- Project validation and utilitiessrc/services/project-structure.ts- Centralized project directory structure managementsrc/services/file-storage.ts- File system operations and path utilitiessrc/services/zip-upload.ts- ZIP file extraction and processingsrc/services/ai/- AI prompt templates and typessrc/types/- Shared TypeScript typessrc/utils/- Common utility functionssrc/constants/- Application constantssrc/trpc/- tRPC router and procedure definitions
DXLander follows a centralized type architecture where all domain types are defined in packages/shared/src/types/ and shared across frontend and backend.
Type Organization:
packages/shared/src/types/
├── index.ts # Core domain models (Project, User, Deployment)
├── serialized.ts # Serialized versions for API responses
├── integration-vault.ts # Integration credential vault
├── deployment.ts # Deployment credentials & platforms
├── config.ts # Build configuration types
└── ai-providers.ts # AI provider testing types
Key Principles:
- Single Source of Truth: All domain types (Project, User, Deployment, etc.) are defined once in
packages/shared/src/types/ - Serialization Pattern: tRPC serializes
Dateobjects to ISO strings. We provideSerialized*types for frontend use:- Backend uses
Project(withDateobjects) - Frontend uses
SerializedProject(withstringdates)
- Backend uses
- ESLint Enforcement: Duplicate type definitions are caught at lint time with
no-restricted-syntaxrules - Import from Shared: Always import types from
@dxlander/shared, never redefine locally
Example:
// ✅ Backend (apps/api/)
import type { Project } from '@dxlander/shared';
const project: Project = await db.query.projects.findFirst(...);
// project.createdAt is Date
// ✅ Frontend (apps/web/)
import type { SerializedProject } from '@dxlander/shared';
const { data: project } = trpc.projects.get.useQuery();
// project.createdAt is string
// ❌ DON'T DO THIS
interface Project { ... } // ESLint error! Import from @dxlander/sharedType Categories:
- Domain Models: Project, User, Deployment, Integration
- Serialized Types: SerializedProject, SerializedUser, SerializedDeployment
- Input Schemas: CreateProjectInput, UpdateProjectInput (with Zod validation)
- Service Types: DeploymentPlatformConfig, ProviderTestConfig
- Configuration Types: ConfigType, ConfigSet, GenerateConfigOptions
Technology: SQLite (default) / PostgreSQL (optional) + Drizzle ORM Purpose: Database schema, migrations, and query layer
Key Files:
src/schema.ts- Complete database schema definitionsrc/db.ts- Database connection and configurationsrc/types.ts- Database-derived TypeScript typesmigrations/- Database migration files
Tables:
users- User accounts and authenticationprojects- Imported projects and metadataaiProviders- AI service configurations (encrypted)buildConfigs- Generated deployment configurationsdeployments- Deployment history and statussettings- Application settings
Purpose: AI integration and prompt management for project analysis
Key Features:
- Framework detection (Next.js, React, Python, etc.)
- Dependency analysis (package.json, requirements.txt, etc.)
- Environment variable detection
- Integration identification (databases, APIs, services)
- Build configuration generation
Purpose: Generate deployment configurations (Docker, Kubernetes, etc.)
Templates:
- Dockerfile generation for any project type
- Docker Compose for multi-service applications
- Kubernetes manifests for production deployment
- Bash scripts for VPS deployment
Purpose: External service integrations and credential management
Services:
- Database connections (PostgreSQL, MySQL, MongoDB)
- Cloud storage (AWS S3, Google Cloud Storage)
- Authentication (Auth0, Firebase Auth, Supabase)
- Deployment platforms (Vercel, Railway, DigitalOcean)
User uploads project → GitHub API → File extraction →
AI analysis → Framework detection → Configuration generation
Project analysis → AI prompts → Template selection →
File generation → User review → Deployment ready
Configuration ready → Target platform selection →
Credential injection → Deployment execution → Status tracking
- Development: SQLite at
~/.dxlander/data/dxlander.db - Production: PostgreSQL for teams and enterprise
- File Storage: Local filesystem at
~/.dxlander/projects/
Each imported project follows a standardized structure to ensure consistent behavior across all import sources (GitHub, GitLab, Bitbucket, ZIP):
~/.dxlander/projects/{projectId}/
├── files/ # Imported source code
│ ├── package.json
│ ├── src/
│ └── ...
└── configs/ # Generated deployment configurations
├── {configId}/ # Docker configuration set
├── {configId}/ # Kubernetes configuration set
└── ...
Key Principles:
- Source files are always stored in
{projectId}/files/directory - Generated configs are always stored in
{projectId}/configs/{configId}/directories - This structure prevents configs from mixing with source code
- Ensures AI analysis only reads source files, never generated configs
- Consistent across all import methods (GitHub, GitLab, Bitbucket, ZIP)
- Encryption: AES-256-GCM for all sensitive data
- Key Management: File-based storage or environment variable
- Authentication: JWT tokens with bcrypt password hashing
apps/api → packages/shared, packages/database
apps/web → packages/shared
packages/shared → packages/database (types only)
packages/shared(foundational types and utils)packages/database(schema and migrations)packages/ai-agents,packages/config-gen,packages/integrationsapps/api(backend server)apps/web(frontend application)
- API Communication: tRPC (type-safe, auto-generated client)
- Database: Drizzle ORM with TypeScript integration
- File System: Node.js fs APIs with proper error handling
- Runtime: Node.js 18.0.0 or higher
- Framework: Hono (fast, lightweight)
- API: tRPC (type-safe RPC)
- Database: Drizzle ORM + SQLite/PostgreSQL
- Authentication: JWT + bcrypt
- Framework: Next.js 15 (App Router)
- React: React 19 (latest)
- Styling: TailwindCSS v4
- Components: shadcn/ui (customized)
- Type Safety: Full TypeScript coverage
- Package Manager: pnpm (workspaces)
- Linting: ESLint + Prettier
- Testing: Vitest (unit, integration, e2e)
- Type Checking: TypeScript 5.4
- CLI: Custom CLI wrapper (
bin/dxlander.js)
~/.dxlander/
├── encryption.key # Master encryption key (CRITICAL)
├── data/dxlander.db # SQLite database
└── projects/ # Uploaded project files
DXLANDER_ENCRYPTION_KEY- Master encryption key (44+ chars base64, production)DATABASE_URL- PostgreSQL connection (optional)NODE_ENV- Environment modePORT- API server port (default: 3001)
- All API keys and credentials are encrypted before database storage
- Master encryption key can be provided via environment variable or file
- File permissions set to 0600 (owner read/write only)
- Minimum 44-character base64 key length enforced for security (32 raw bytes encoded in base64 produce 44 characters)
- JWT tokens for session management
- Password hashing with bcrypt
- Role-based access control (admin/user)
- No data sent to external services without explicit user consent
- Self-hosted by default (full user control)
- Secure credential storage with proper encryption
- SQLite for single-user scenarios (fast, simple)
- PostgreSQL for multi-user and production deployments
- Indexed queries for common operations
- Streaming for large file uploads
- Compression for project archives
- Smart filtering to avoid binary files
- Memoized AI analysis results
- Configuration template caching
- Static asset optimization