Azure-Samples / contoso-real-estate

Intelligent enterprise-grade reference architecture for JavaScript, featuring OpenAI integration, Azure Developer CLI template and Playwright tests.
MIT License
894 stars 534 forks source link

[Task] Create an azd template for setup of Strapi resources #61

Closed aaronpowell closed 1 year ago

aaronpowell commented 2 years ago

Following the guide outlined on the docs for azd, a template needs to be created that will include the following Azure resources

It should also boostrap the Dockerfile that is required for deploying to Container Apps.

The template shouldn't include Strapi itself, instead it should expect that the user will either already have Strapi in their repo (we'll dictate conventions to where it should be) or they will run the create-strapi-app command themselves.

* Ideally there will be a prompt option on whether they want to use PostgreSQL or MySQL, but due to limitations in the template engine, we'll have to dictate a database option as default, but there will be both resource sets in there for the user to change if desired.

aaronpowell commented 1 year ago

Now that scenario 3 has been implemented, I've pondered how a template could be made for it.

Strapi has a template feature for setting up new projects, but it works on a specific structure of what files exist where. The other alternative is that Strapi has starters, which use templates but are more complete applications (so combine something like Next.js + Strapi).

On the other hand you have azd templates, which are really just taking an existing GitHub repo, cloning it and pushing to Azure using azd up. These need to be more structured like a standard repo, so could be similar to the starters concept from the Strapi CLI.

Then there's the idea proposed in the initial description, don't have Strapi in the azd template repo, just the infra/azure.yaml/etc. files so you can azd-ify an existing repo. This would essentially be using the Make your project azd compatible approach, but some how make it easier to import the various files needed, rather than copy/paste them from docs/online.

Here's my pro/con list for the approaches:

manekinekko commented 1 year ago

It looks like the template for azd and Strapi has already been created. Can we close this issue? cc @sinedied

https://github.com/Azure-Samples/contoso-real-estate/blob/be1aeb2212b97a651d46c255550c7e91ac134b1d/infra/main.bicep#L118-L136