How juanjolopez19/automatapi works
Main Components
• Frontend: The "automatAPI" directory is an Angular-based web application. It comprises views, common components, modals, and dashboard-related components which handle user interactions, API template selections, and customization.
• Backends: There are two major backend implementations:
– "flaskBack": Built in Python/Flask, leveraging Cookiecutter to generate API templates for Flask (and containing templates for Django as well).
– "nodeBack": Written in Node.js with TypeScript and Express, providing endpoints for authenticating users, managing templates, and API generation.
• Databases & Cloud Services: The tech stack indicates the use of PostgreSQL and MongoDB along with cloud services like AWS Cloudfront and AWS S3 for hosting assets or templates.
• Additional Layers: There are middleware components (e.g., PassportJS for authentication in nodeBack, social authentication middleware, and specialized middleware in Flask) along with configuration files that manage settings, certificates, and routes.
Component Relationships and Interactions
• User Interaction Flow: The frontend (Angular app) interacts with both backends. It may communicate with the Node.js backend (via RESTful API endpoints) for actions such as user management and template generation requests.
• API Generation Workflows: Based on the user’s customization choices, requests from the frontend are routed to the appropriate backend (Flask or Node) that then uses predefined templates (located in their respective “templatesStuff” directories or template services) to create the API projects.
• Authentication & Middleware: The Node backend integrates PassportJS and related middleware for secure login, while the Flask component has its own routing (and potentially uses Cookiecutter for scaffolding).
Architectural Patterns and Design Principles
• Separation of Concerns: Different directories in the file tree suggest clear separation between frontend components, backend controllers, services, middleware, and template management.
• Modular and Layered Architecture: Each backend has its own set of modules (e.g., controllers, routes, database models) and the frontend is organized into components and views.
• Template-driven Code Generation: The use of Cookiecutter templates (for Flask and Django) and Express templates is a unique aspect that should be highlighted.