> ## Documentation Index
> Fetch the complete documentation index at: https://shivamgoyal.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture

> Technical architecture and system design of the CodeNull platform

# CodeNull Architecture

CodeNull follows a modern, scalable architecture designed to provide a seamless experience for creating web applications without coding. This document outlines the technical components and how they interact to power the platform.

## System Overview

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/shivamgoyal/images/codenull-architecture-diagram.png" alt="CodeNull Architecture Diagram" />
</Frame>

The CodeNull platform is built on a microservices architecture with a clear separation between frontend interfaces, backend services, AI processing, and data storage layers. This architecture ensures scalability, maintainability, and the ability to evolve individual components independently.

## Architecture Components

<CardGroup cols={2}>
  <Card title="User Interface Layer" icon="desktop">
    Next.js-based frontend with dashboard interfaces
  </Card>

  <Card title="API Services Layer" icon="server">
    FastAPI-powered backend services
  </Card>

  <Card title="AI Generative Core" icon="brain">
    AI models for code and content generation
  </Card>

  <Card title="Database Systems" icon="database">
    MongoDB for flexible data storage
  </Card>

  <Card title="Storage Services" icon="hard-drive">
    Asset management and file storage
  </Card>

  <Card title="DevOps Infrastructure" icon="gears">
    CI/CD pipelines and containerization
  </Card>
</CardGroup>

## Technical Stack

<Tabs>
  <Tab title="Frontend">
    <CardGroup cols={3}>
      <Card title="Next.js" icon="react">
        React framework for server-rendered applications
      </Card>

      <Card title="Tailwind CSS" icon="paintbrush">
        Utility-first CSS framework
      </Card>

      <Card title="ShadCN" icon="components">
        Accessible component library
      </Card>

      <Card title="Lucide" icon="icons">
        High-quality icon set
      </Card>

      <Card title="Liveblocks" icon="users">
        Real-time collaboration features
      </Card>
    </CardGroup>

    The frontend is built with Next.js, offering server-side rendering for optimal performance and SEO. Tailwind CSS and ShadCN provide a consistent design system, while Liveblocks enables real-time collaboration features.
  </Tab>

  <Tab title="Backend">
    <CardGroup cols={3}>
      <Card title="Python 3.10+" icon="python">
        Core programming language
      </Card>

      <Card title="FastAPI" icon="bolt">
        High-performance API framework
      </Card>

      <Card title="Uvicorn" icon="server">
        ASGI web server
      </Card>

      <Card title="Poetry" icon="book">
        Python dependency management
      </Card>

      <Card title="Docker" icon="docker">
        Containerization
      </Card>
    </CardGroup>

    The backend services are developed with Python and FastAPI, providing asynchronous request handling with high performance. Uvicorn serves as the ASGI server, while Poetry manages dependencies and Docker containerizes the application for consistent deployment.
  </Tab>

  <Tab title="Database">
    <CardGroup cols={2}>
      <Card title="MongoDB" icon="database">
        NoSQL document database
      </Card>

      <Card title="Mongoose" icon="sitemap">
        MongoDB object modeling
      </Card>
    </CardGroup>

    MongoDB serves as the primary database, offering flexibility for varying data structures. Mongoose provides a schema-based solution for modeling application data.
  </Tab>

  <Tab title="AI/Cloud">
    <CardGroup cols={2}>
      <Card title="Azure OpenAI" icon="microsoft">
        Language model services
      </Card>

      <Card title="NVIDIA NIM" icon="microchip">
        Accelerated inference microservices
      </Card>

      <Card title="Cloudinary" icon="cloud">
        Media asset management
      </Card>
    </CardGroup>

    Azure OpenAI services power the AI code generation capabilities, while NVIDIA NIM accelerates AI inference for faster performance. Cloudinary handles media asset management and optimization.
  </Tab>

  <Tab title="DevOps">
    <CardGroup cols={2}>
      <Card title="Vercel" icon="rocket">
        Frontend deployment platform
      </Card>

      <Card title="Azure Container Apps" icon="cloud">
        Backend service hosting
      </Card>

      <Card title="GitHub Actions" icon="code-branch">
        CI/CD pipeline automation
      </Card>
    </CardGroup>

    Vercel hosts the frontend applications with global edge deployment, while Azure Container Apps runs the containerized backend services. GitHub Actions automates testing and deployment processes.
  </Tab>
</Tabs>

## System Flows

### User Interface Generation Flow

<Steps>
  <Step title="User Input">
    User provides a description of the desired UI component or page
  </Step>

  <Step title="AI Processing">
    The description is processed by the AI generative core
  </Step>

  <Step title="Code Generation">
    AI generates React/Next.js component code with Tailwind styling
  </Step>

  <Step title="Preview Rendering">
    Generated code is rendered in real-time for user preview
  </Step>

  <Step title="Customization">
    User can modify generated components through the visual editor
  </Step>

  <Step title="Integration">
    Component is integrated into the user's project codebase
  </Step>
</Steps>

### API Creation Flow

<Steps>
  <Step title="API Definition">
    User defines API requirements through the visual interface
  </Step>

  <Step title="Schema Generation">
    The system generates OpenAPI schema based on requirements
  </Step>

  <Step title="Logic Implementation">
    Backend logic is created through visual flow builder
  </Step>

  <Step title="Database Connection">
    API endpoints are connected to database collections
  </Step>

  <Step title="Testing">
    Endpoints are tested through the built-in testing interface
  </Step>

  <Step title="Deployment">
    API is deployed as serverless functions or container services
  </Step>
</Steps>

## Scalability Design

The platform is designed for horizontal scalability:

* **Stateless services**: Backend components are stateless for easy scaling
* **Containerization**: All services are containerized for consistent deployment
* **Microservices**: Independent scaling of individual services based on load
* **Database sharding**: Data distribution for high-volume applications
* **Edge computing**: Global CDN for frontend assets and API caching
* **Auto-scaling**: Automatic resource adjustment based on demand

## Next Steps

<CardGroup cols={2}>
  <Card title="Features Overview" icon="star" href="/overview/features">
    Explore the key features of the CodeNull platform
  </Card>

  <Card title="Getting Started" icon="play" href="/guide/getting-started">
    Begin your journey with CodeNull
  </Card>

  <Card title="Frontend Dashboard" icon="palette" href="/frontend-dashboard/overview">
    Learn about the UI development tools
  </Card>

  <Card title="API Dashboard" icon="server" href="/api-dashboard/creation">
    Discover the API creation capabilities
  </Card>
</CardGroup>
