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

feat: support for structured scaffold in create command #970

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

ashupednekar
Copy link

Description

This PR fixes #969

Summary

PR: Add Structured Scaffold Option to Robyn's Create Command

Description:

This PR introduces a new feature to Robyn's create command, allowing users to choose between two scaffold options:

  1. Simple Starter Kit – Ideal for minimal, quick-start projects.
  2. Structured Scaffold – A more opinionated setup, providing separation of concerns and enhanced organization for scaling projects.

Changes:

  • Updated the create command to prompt users with a new option:
    • Would you like the scaffold to be a simple starter kit or an opinionated structure?
  • The simple scaffold remains the same as before with options like Mongo, Postgres, SQLite, etc.
  • Added a structured scaffold with the following structure:
    • api/handlers (for route handlers)
    • middlewares (for middleware definitions)
    • adaptors (with models, selectors, mutators)
    • utils (helper functions like db.py)
    • devops (including Dockerfile, docker-compose)
    • Improved configuration management (e.g., conf.py, config.env).

Example Structured Scaffold:

├── no-db
│   ├── api
│   │   ├── handlers
│   │   │   ├── __init__.py
│   │   │   ├── probes.py
│   │   │   └── sample.py
│   │   └── middlewares
│   │       └── __init__.py
│   ├── conf.py
│   ├── config.env
│   ├── devops
│   │   ├── Dockerfile
│   │   ├── Dockerfile.src
│   │   └── docker-compose.yaml
│   ├── requirements.txt
│   ├── server.py
│   └── utils
│       └── __init__.py
└── sqlalchemy
    ├── adaptors
    │   ├── __init__.py
    │   ├── models.py
    │   ├── mutators
    │   │   └── __init__.py
    │   ├── schema.py
    │   └── selectors
    │       └── __init__.py
    ├── api
    │   ├── handlers
    │   │   ├── __init__.py
    │   │   ├── probes.py
    │   │   └── sample.py
    │   └── middlewares
    │       └── __init__.py
    ├── conf.py
    ├── config.env
    ├── devops
    │   ├── Dockerfile
    │   ├── Dockerfile.src
    │   └── docker-compose.yaml
    ├── requirements.txt
    ├── server.py
    └── utils
        ├── __init__.py
        └── db.py

PR Checklist

Please ensure that:

  • [*] The PR contains a descriptive title
  • [*] The PR contains a descriptive summary of the changes
  • [*] You build and test your changes before submitting a PR.
  • You have added relevant documentation
  • You have added relevant tests. We prefer integration tests wherever possible

Pre-Commit Instructions:

Copy link

vercel bot commented Sep 25, 2024

@pre-commit-ci[bot] is attempting to deploy a commit to the sparckles Team on Vercel.

A member of the Team first needs to authorize it.

@ashupednekar ashupednekar marked this pull request as draft September 25, 2024 17:29
Copy link

codspeed-hq bot commented Sep 25, 2024

CodSpeed Performance Report

Merging #970 will not alter performance

Comparing ashupednekar:feat_structured_scaffold (f155900) with main (9f04b23)

Summary

✅ 116 untouched benchmarks

@ashupednekar ashupednekar changed the title Feat structured scaffold feat: support for structured scaffold in create command Sep 26, 2024
@ashupednekar ashupednekar marked this pull request as ready for review September 26, 2024 05:00
@ashupednekar
Copy link
Author

@sansyrox lmk if you have any suggestions for the scaffold structure

@ashupednekar
Copy link
Author

ashupednekar commented Sep 27, 2024

I'll fix the issues in the create script to make sure tests are passing tomorrow morning

@sansyrox
Copy link
Member

Hey @ashupednekar 👋

Thank you for the PR 😄

But the ci is failing. Could you please have a look?

@ashupednekar
Copy link
Author

ashupednekar commented Sep 28, 2024

Hi, the new flag wasn't being passed in the create_robyn test, added that, with one new test for the new path, it says CI (tests) waiting for approval.

What should I do? Did it cross some limit on number of test runs?

@ashupednekar
Copy link
Author

Screenshot 2024-09-28 at 10 44 53 AM passing locally

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

Successfully merging this pull request may close these issues.

Support for structured scaffolding in create command, retaining current templates
2 participants