Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tool for defining and enforcing project folder structure? #8

Open
jonathanmach opened this issue Nov 27, 2024 · 1 comment
Open

Tool for defining and enforcing project folder structure? #8

jonathanmach opened this issue Nov 27, 2024 · 1 comment
Assignees

Comments

@jonathanmach
Copy link
Owner

jonathanmach commented Nov 27, 2024

Imagine that the team has decided on the following folder structure for their project:

image

Q: How can it be enforced?

Brainstorming

#
# Project structure specification
#
src/:
  domains/: { many: "@domain_module" }
  core/:
    auth/: "*"
  tools/: "*"
  integrations/: "*"
  tests/: "*"

#
# Composables
#
composables:
  # accessed with trailing '@'
  domain_module:
    api/:
      participant/:
        - schemas.py
        - controllers.py
        - errors.py? # same as: { _required: false }
      admin/:
        - schemas.py
        - controllers.py
        - errors.py
      external_api?: "@external_api" # same as: { _composable: "external_api", _required: false }
    dtos.py: { _required: false }
    exceptions.py:
    models.py:
    services.py:
    utils.py: { _required: false }

  external_api:
    - v1/:
        - schemas.py
        - controllers.py
        - errors.py
    - auth.py
    - middlewares.py

Templates

# Templates: can be created via cli:
#     $ gen --template=new_domain $name=blogposts
#     $ gen --template=new_domain $name=users
templates:
  new_domain:
    $name/:
      - api/:
        participant/:
          - schemas.py
          - controllers.py
          - errors.py
        admin/:
          - schemas.py
          - controllers.py
          - errors.py
        rpc/:
          - handlers.py
          - serializers.py
          - errors.py
      - dtos.py
      - exceptions.py
      - models.py
      - services.py
      - utils.py
@jonathanmach jonathanmach self-assigned this Nov 27, 2024
@jonathanmach
Copy link
Owner Author

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant