How practicajs/practica works
Code Generator Core
• Entry Points Layer
• Generation Logic Layer
• Templates Layer
Generated Application Structure
• Service Layer
• Libraries Layer
• Infrastructure Components
Code Generator Core Section
┌─ Code Generator Core ─────────────────────────┐
• ┌─ Entry Points ──┐ ┌─ Generation Logic ─┐│
• CLI │───>│ - Feature Chooser ││
• Interactive │ │ - Template Engine ││
• ┘ └──────────────────┘ ││
• ┌─ Templates ───────────────┘ ││
• Express Templates ││
• Fastify Templates ││
• ORM Templates ││
• ┘ ││
• ┘
Generated Application Structure Section
┌─ Generated Application ──────────────────────┐
• ┌─ Services ────┐ ┌─ Libraries ─────────┐│
• Order Service │────│ - Error Handling ││
• ┘ │ - Configuration ││
• Validation ││
• Logger ││
• ┘│
• ┌─ Infrastructure ────────────────────────┐ │
• Docker │ │
• Database (PostgreSQL/Other) │ │
• API Layer (Express/Fastify) │ │
• ┘ │
• ┘
Interaction Flows
• User input → Generator
• Generator → Templates
• Templates → Generated Application
• Inter-service communication in generated app
• Service → Infrastructure dependencies
Additional Elements
Include:
• Version information
• Supported frameworks and ORMs
• Best practices implementation points
Modularity
• How the generated code is organized in a monorepo structure
• Separation between services and shared libraries
• Where custom code can be added
Technology Choices
• Where framework choices can be made (Express/Fastify)
• ORM integration points (Prisma/Sequelize)
• Database connectivity
Testing & Quality
• Test implementation points
• CI/CD integration
• Quality check implementations