How imaginate-ai/api works
Project type and purpose
• This is a Flask-based RESTful web service ("imaginate_api") that groups its functionality into three blueprints: date, image, and user.
• It also serves two HTML templates (index.html, verification_portal.html), so it’s a lightweight full-stack app (backend + minimal frontend) rather than just a library or CLI tool.
• CI/CD is configured via GitHub Actions, and deployment is Dockerized.
File structure
• Top-level:
• Dockerfile, .dockerignore, Makefile – containerization & local setup
• .github/workflows/*.yml – CI/CD pipeline
• pyproject.toml & poetry.toml – Python dependency management
• README.md – run & setup commands
• “imaginate_api/”:
• app.py – Flask app factory & server entrypoint
• config.py – environment/configuration definitions
• extensions.py – Flask extensions initialization (e.g. DB, Marshmallow)
• utils.py – shared helper functions
• schemas/ – Marshmallow schemas for data validation (date_info, user_info)
• templates/ – Jinja2 HTML templates
• date/, image/, user/ – individual blueprints under routes.py
• “tests/” covers unit tests for the app.
README for additional insights
• It outlines local setup, dependency installation, and how to launch the Flask server.
Elements
• Blue for backend components
• Green for external dependencies (e.g., third-party APIs)
• Orange for CI/CD steps