BLUEPRINTS = {
    'flask': {
        '__init__': {
            'db': (
                "import os"
                "\nfrom flask import Flask"
                "\nfrom flask_sqlalchemy import SQLAlchemy"
                "\nfrom flask_migrate import Migrate\n"
                "\napp = Flask(__name__)"
                "\napp.config['SECRET_KEY'] = os.getenv('SECRET_KEY')"
                "\napp.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DATABASE_URL')\n"
                "\ndb = SQLAlchemy(app)"
                "\nmigrate = Migrate(app, db)\n"
                "\nfrom app.models import *"
                "\ndb.create_all()"
                "\ndb.session.commit()\n"
                "\nfrom app import routes\n"
            ),
            'nodb': (
                "import os"
                "\nfrom flask import Flask\n"
                "\napp = Flask(__name__)"
                "\napp.config['SECRET_KEY'] = os.getenv('SECRET_KEY')\n"
                "\nfrom app import routes\n"
            ),
        },
        'wsgi': (
            "from dotenv import load_dotenv"
            "\nload_dotenv()\n"
            "\nfrom app import app\n"
            "\nif __name__ == '__main__':"
            "\n    app.run(debug=True)\n"
        ),
        'routes': {
            'db': (
                "# Create your routes here.\n"
                "\nfrom app import app, db\n"
                "\nfrom app.models import *\n"
                "\nfrom flask import Response\n"
                "\n@app.route('/')"
                "\ndef default():"
                "\n    return Response(status=200)\n"
            ),
            'nodb': (
                "# Create your routes here.\n"
                "\nfrom app import app\n"
                "\nfrom flask import Response\n"
                "\n@app.route('/')"
                "\ndef default():"
                "\n    return Response(status=200)\n"
            ),
        },
        'models': (
            "# Create your models here.\n"
            "\nfrom app import db\n"
            "\nfrom sqlalchemy import Column, Integer\n"
            "\nclass ExampleModel(db.Model):"
            "\n    id = Column(Integer, primary_key=True)\n"
        ),
        'forms': (
            "# Create your forms here.\n"
            "\nfrom flask_wtf import FlaskForm"
            "\nfrom wtforms import StringField"
            "\nfrom wtforms.validators import DataRequired\n"
            "\nclass ExampleForm(FlaskForm):"
            "\n    example_field = StringField('Example', validators=[DataRequired()])\n"
        ),
    },

    'fastapi': {
        'asgi': (
            "from dotenv import load_dotenv"
            "\nload_dotenv()\n"
            "\nfrom os import getenv"
            "\nfrom fastapi import FastAPI\n"
            "\nimport routers"
            "\nfrom db import models, DB_ENGINE\n"
            "\napp: FastAPI = FastAPI("
            "\n    debug=True if getenv('DEBUG') else False,"
            "\n    docs_url='/docs' if getenv('DEBUG') else False,"
            "\n    redoc_url='/redoc' if getenv('DEBUG') else False,"
            "\n    title=getenv('PROJECT_NAME')"
            "\n)\n"
            "\nmodels.DB_BASE.metadata.create_all(DB_ENGINE)\n"
            "\napp.include_router(routers.server.router)\n"
            "\nif __name__ == '__main__':"
            "\n    import uvicorn, psycopg2"
            "\n    uvicorn.run(app, host='127.0.0.1', port=8000) # alternatively host='localhost'\n"
        ),
        '__init__db': (
            "from os import getenv\n"
            "\nfrom sqlalchemy import create_engine"
            "\nfrom sqlalchemy.ext.declarative import declarative_base"
            "\nfrom sqlalchemy.orm import sessionmaker"
            "\nfrom sqlalchemy.orm.attributes import flag_modified\n"
            "\nuri = getenv('DATABASE_URL')"
            "\nif uri.startswith('postgres://'):"
            "\n    uri = uri.replace('postgres://', 'postgresql://', 1)\n"
            "\nif getenv('DEBUG'):"
            "\n    DB_ENGINE = create_engine(uri, connect_args={'check_same_thread': False})"
            "\nelse:"
            "\n    DB_ENGINE = create_engine(uri)"
            "\ndel uri\n"
            "\nDB_SES_LOCAL = sessionmaker(bind=DB_ENGINE)"
            "\nDB_BASE = declarative_base()\n"
            "\ndef get_db():"
            "\n    db = DB_SES_LOCAL()"
            "\n    try:"
            "\n        yield db"
            "\n    finally:"
            "\n        db.close()\n"
        ),
        'models': (
            "# Create your models here.\n"
            "\nfrom sqlalchemy import Column, Integer, String\n"
            "\nfrom db import DB_BASE\n"
            "\nclass Exacple(DB_BASE):"
            "\n    __tablename__ = 'example'\n"
            "\n    id = Column(Integer, primary_key=True, index=True)\n"
        ),
        '__init__utils': (
            "from .hashing import *\n"
        ),
        'schemas': (
            "# Create your schemas here.\n"
            "\nfrom typing import List, Optional"
            "\nfrom pydantic import BaseModel\n"
            "\nclass Example(BaseModel):"
            "\n    example_field: str\n"
        ),
        'hashing': (
            "from passlib.context import CryptContext\n"
            "\nPWD_CXT = CryptContext(schemes=['bcrypt'], deprecated='auto')\n"
            "\nclass Hash():"
            "\n    def bcrypt(password: str):"
            "\n        return PWD_CXT.hash(password)\n"
            "\n    def verify(plain_password, hashed_password):"
            "\n        return PWD_CXT.verify(plain_password, hashed_password)\n"
        ),
        '__init__routers': (
            "from os import getenv\n"
            "\nfrom fastapi import APIRouter, Depends"
            "\nfrom sqlalchemy.orm import Session\n"
            "\nfrom db import *"
            "\nfrom db.models import *\n"
            "\nfrom utils import *\n"
            "\nfrom .server import router\n"
        ),
        'server': (
            "from . import *\n"
            "\nrouter = APIRouter(tags=['Server'])\n"
            "\n@router.get('/')"
            "\ndef default():"
            "\n    return {'status': 'Live'}\n"
        ),
    },
}

818a98045c3973746a7a4763e2e0692d68dfd35b
<mask token>

BLUEPRINTS = {'flask': {'__init__': {'db':
    """import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate

app = Flask(__name__)
app.config['SECRET_KEY'] = os.getenv('SECRET_KEY')
app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DATABASE_URL')

db = SQLAlchemy(app)
migrate = Migrate(app, db)

from app.models import *
db.create_all()
db.session.commit()

from app import routes
"""
    , 'nodb':
    """import os
from flask import Flask

app = Flask(__name__)
app.config['SECRET_KEY'] = os.getenv('SECRET_KEY')

from app import routes
"""
    }, 'wsgi':
    """from dotenv import load_dotenv
load_dotenv()

from app import app

if __name__ == '__main__':
    app.run(debug=True)
"""
    , 'routes': {'db':
    """# Create your routes here.

from app import app, db

from app.models import *

from flask import Response

@app.route('/')
def default():
    return Response(status=200)
"""
    , 'nodb':
    """# Create your routes here.

from app import app

from flask import Response

@app.route('/')
def default():
    return Response(status=200)
"""
    }, 'models':
    """# Create your models here.

from app import db

from sqlalchemy import Column, Integer

class ExampleModel(db.Model):
    id = Column(Integer, primary_key=True)
"""
    , 'forms':
    """# Create your forms here.

from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms.validators import DataRequired

class ExampleForm(FlaskForm):
    example_field = StringField('Example', validators=[DataRequired()])
"""
    }, 'fastapi': {'asgi':
    """from dotenv import load_dotenv
load_dotenv()

from os import getenv
from fastapi import FastAPI

import routers
from db import models, DB_ENGINE

app: FastAPI = FastAPI(
    debug=True if getenv('DEBUG') else False,
    docs_url='/docs' if getenv('DEBUG') else False,
    redoc_url='/redoc' if getenv('DEBUG') else False,
    title=getenv('PROJECT_NAME')
)

models.DB_BASE.metadata.create_all(DB_ENGINE)

app.include_router(routers.server.router)

if __name__ == '__main__':
    import uvicorn, psycopg2
    uvicorn.run(app, host='127.0.0.1', port=8000) # alternatively host='localhost'
"""
    , '__init__db':
    """from os import getenv

from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm.attributes import flag_modified

uri = getenv('DATABASE_URL')
if uri.startswith('postgres://'):
    uri = uri.replace('postgres://', 'postgresql://', 1)

if getenv('DEBUG'):
    DB_ENGINE = create_engine(uri, connect_args={'check_same_thread': False})
else:
    DB_ENGINE = create_engine(uri)
del uri

DB_SES_LOCAL = sessionmaker(bind=DB_ENGINE)
DB_BASE = declarative_base()

def get_db():
    db = DB_SES_LOCAL()
    try:
        yield db
    finally:
        db.close()
"""
    , 'models':
    """# Create your models here.

from sqlalchemy import Column, Integer, String

from db import DB_BASE

class Exacple(DB_BASE):
    __tablename__ = 'example'

    id = Column(Integer, primary_key=True, index=True)
"""
    , '__init__utils': 'from .hashing import *\n', 'schemas':
    """# Create your schemas here.

from typing import List, Optional
from pydantic import BaseModel

class Example(BaseModel):
    example_field: str
"""
    , 'hashing':
    """from passlib.context import CryptContext

PWD_CXT = CryptContext(schemes=['bcrypt'], deprecated='auto')

class Hash():
    def bcrypt(password: str):
        return PWD_CXT.hash(password)

    def verify(plain_password, hashed_password):
        return PWD_CXT.verify(plain_password, hashed_password)
"""
    , '__init__routers':
    """from os import getenv

from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session

from db import *
from db.models import *

from utils import *

from .server import router
"""
    , 'server':
    """from . import *

router = APIRouter(tags=['Server'])

@router.get('/')
def default():
    return {'status': 'Live'}
"""
    }}

BLUEPRINTS = {
    'flask': {
        '__init__': {
            'db': (
                "import os"
                "\nfrom flask import Flask"
                "\nfrom flask_sqlalchemy import SQLAlchemy"
                "\nfrom flask_migrate import Migrate\n"
                "\napp = Flask(__name__)"
                "\napp.config['SECRET_KEY'] = os.getenv('SECRET_KEY')"
                "\napp.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DATABASE_URL')\n"
                "\ndb = SQLAlchemy(app)"
                "\nmigrate = Migrate(app, db)\n"
                "\nfrom app.models import *"
                "\ndb.create_all()"
                "\ndb.session.commit()\n"
                "\nfrom app import routes\n"
            ),
            'nodb': (
                "import os"
                "\nfrom flask import Flask\n"
                "\napp = Flask(__name__)"
                "\napp.config['SECRET_KEY'] = os.getenv('SECRET_KEY')\n"
                "\nfrom app import routes\n"
            ),
        },
        'wsgi': (
            "from dotenv import load_dotenv"
            "\nload_dotenv()\n"
            "\nfrom app import app\n"
            "\nif __name__ == '__main__':"
            "\n    app.run(debug=True)\n"
        ),
        'routes': {
            'db': (
                "# Create your routes here.\n"
                "\nfrom app import app, db\n"
                "\nfrom app.models import *\n"
                "\nfrom flask import Response\n"
                "\n@app.route('/')"
                "\ndef default():"
                "\n    return Response(status=200)\n"
            ),
            'nodb': (
                "# Create your routes here.\n"
                "\nfrom app import app\n"
                "\nfrom flask import Response\n"
                "\n@app.route('/')"
                "\ndef default():"
                "\n    return Response(status=200)\n"
            ),
        },
        'models': (
            "# Create your models here.\n"
            "\nfrom app import db\n"
            "\nfrom sqlalchemy import Column, Integer\n"
            "\nclass ExampleModel(db.Model):"
            "\n    id = Column(Integer, primary_key=True)\n"
        ),
        'forms': (
            "# Create your forms here.\n"
            "\nfrom flask_wtf import FlaskForm"
            "\nfrom wtforms import StringField"
            "\nfrom wtforms.validators import DataRequired\n"
            "\nclass ExampleForm(FlaskForm):"
            "\n    example_field = StringField('Example', validators=[DataRequired()])\n"
        ),
    },

    'fastapi': {
        'asgi': (
            "from dotenv import load_dotenv"
            "\nload_dotenv()\n"
            "\nfrom os import getenv"
            "\nfrom fastapi import FastAPI\n"
            "\nimport routers"
            "\nfrom db import models, DB_ENGINE\n"
            "\napp: FastAPI = FastAPI("
            "\n    debug=True if getenv('DEBUG') else False,"
            "\n    docs_url='/docs' if getenv('DEBUG') else False,"
            "\n    redoc_url='/redoc' if getenv('DEBUG') else False,"
            "\n    title=getenv('PROJECT_NAME')"
            "\n)\n"
            "\nmodels.DB_BASE.metadata.create_all(DB_ENGINE)\n"
            "\napp.include_router(routers.server.router)\n"
            "\nif __name__ == '__main__':"
            "\n    import uvicorn, psycopg2"
            "\n    uvicorn.run(app, host='127.0.0.1', port=8000) # alternatively host='localhost'\n"
        ),
        '__init__db': (
            "from os import getenv\n"
            "\nfrom sqlalchemy import create_engine"
            "\nfrom sqlalchemy.ext.declarative import declarative_base"
            "\nfrom sqlalchemy.orm import sessionmaker"
            "\nfrom sqlalchemy.orm.attributes import flag_modified\n"
            "\nuri = getenv('DATABASE_URL')"
            "\nif uri.startswith('postgres://'):"
            "\n    uri = uri.replace('postgres://', 'postgresql://', 1)\n"
            "\nif getenv('DEBUG'):"
            "\n    DB_ENGINE = create_engine(uri, connect_args={'check_same_thread': False})"
            "\nelse:"
            "\n    DB_ENGINE = create_engine(uri)"
            "\ndel uri\n"
            "\nDB_SES_LOCAL = sessionmaker(bind=DB_ENGINE)"
            "\nDB_BASE = declarative_base()\n"
            "\ndef get_db():"
            "\n    db = DB_SES_LOCAL()"
            "\n    try:"
            "\n        yield db"
            "\n    finally:"
            "\n        db.close()\n"
        ),
        'models': (
            "# Create your models here.\n"
            "\nfrom sqlalchemy import Column, Integer, String\n"
            "\nfrom db import DB_BASE\n"
            "\nclass Exacple(DB_BASE):"
            "\n    __tablename__ = 'example'\n"
            "\n    id = Column(Integer, primary_key=True, index=True)\n"
        ),
        '__init__utils': (
            "from .hashing import *\n"
        ),
        'schemas': (
            "# Create your schemas here.\n"
            "\nfrom typing import List, Optional"
            "\nfrom pydantic import BaseModel\n"
            "\nclass Example(BaseModel):"
            "\n    example_field: str\n"
        ),
        'hashing': (
            "from passlib.context import CryptContext\n"
            "\nPWD_CXT = CryptContext(schemes=['bcrypt'], deprecated='auto')\n"
            "\nclass Hash():"
            "\n    def bcrypt(password: str):"
            "\n        return PWD_CXT.hash(password)\n"
            "\n    def verify(plain_password, hashed_password):"
            "\n        return PWD_CXT.verify(plain_password, hashed_password)\n"
        ),
        '__init__routers': (
            "from os import getenv\n"
            "\nfrom fastapi import APIRouter, Depends"
            "\nfrom sqlalchemy.orm import Session\n"
            "\nfrom db import *"
            "\nfrom db.models import *\n"
            "\nfrom utils import *\n"
            "\nfrom .server import router\n"
        ),
        'server': (
            "from . import *\n"
            "\nrouter = APIRouter(tags=['Server'])\n"
            "\n@router.get('/')"
            "\ndef default():"
            "\n    return {'status': 'Live'}\n"
        ),
    },
}
