-
-
Notifications
You must be signed in to change notification settings - Fork 9
Initial design considerations #1
Comments
Do we really need this or can we handle it via |
I think need do it via lite(core) version |
@schmunk42 what is your worry about having a separate template? For me, having something specific is much more desirable than something trying to do all things, otherwise they are not really templates. @rustamwin Can you link to the lite version and what that is so I can see? |
It would be good to have separate templates:
|
My experience is that whether you have an API, CLI or web-site your application (eg. models, components, modules, ...) account for most of the code. I.e. all web-applications also have CLI commands, eg. So it boils down to three "entrypoints" for your application:
|
I'm talking about microservice architecture where each service is absolutely independent from other components. @schmunk42, you are talking about monolith app. |
It’s often needed a service which 1) takes data from message queue channel, 2) does some conversion / processings / sending emails or push notifications, and so on, 3) sends data to another message queue channel. There is no need in any endpoints other than CLI there. It should have very simple skeleton but with logs, tests, The same is about API app — mostly it has to serve API endpoints and send / get data from other services via internal API or message queue. Here also CLI needed but just for basic things like migrations. Web app has much different structure and more visual components than API app. So definitely all these three app types will be used for absolutely different purposes. Now to create such services I have either to create a new microservice app from scratch (manually adding logs, tests, caches), or use “advanced” app and then remove all obsolete things (like backend or frontend namespaces) from there. Both these options take time, and prevent me from using updates, improvements or bugfixes for “advanced” or “basic” apps. |
@roslov I agree in several points, currently there are way too many files in the app template, IMHO. That's why I created a proposal here yiisoft/app#41 There will be always trade-offs, but nonetheless I think the above PR would be a step in the right direction. CC: @yiisoft/core-developers @yiisoft/reviewers |
Having worked on angular for a while I found the approach that NRWL takes quite helpful. Maybe that would be something Yii could also offer, a workspace, where you have one A structure could look like this then:
Currently we are working on a software that started with template from kartik-v. We moved and deleted stuff ... now we are switching slowly to vuejs components, so there is a need for api controllers. I think this mix of pure php "web" and more api-driven code may become more common now. Just my two cents worth :) EDIT: E.g. |
Actually I would prefer one modular template with everything (separate endpoints for backend, frontend, api, console) and some initial script which will ask 2-3 questions and remove unnecessary parts of template. |
That's probably a very good idea. |
I was just considering the same thing, we get to have a single source for the template but still allow correct customisation. For example, you could ask the dev if they want cookies enabled or not and modify the config appropriately. Is this easy enough to do directly with Composer or would there be an easier way? Perhaps run a Yii console command after installing with Composer? |
In addition to the above I'd like to see something like:
...to get a theme.
or
to install a user-module. |
I'd no tie this to composer.
A console command which is part of the framework would be great. |
Why not? |
What do we want the script to configure for the developer?
We can start with a simple set and see whether Composer can handle it. The script should be able to delete unrequired folders/files, modify config files and modify composer require. Anything else? |
https://github.com/yiisoft/yii2-composer is a good example of what could be tied to Composer. |
Because composer's task is to install packages, not to prepare the project and its environment. |
Why should you? |
Because I don't want to bake the setup of my application into the package manager, as said above. The question is more, why should we use composer for that? I also don't think |
OK. How do you see it? |
For application setup I'd like to see a console command as part of the framework, see yiisoft/app-api#1 (comment)
We're using |
Does it make sense to re-run that init command after install is done? |
Sure, for debugging or in case you have removed a folder like There is also difference between interactive setups (eg. first time project creation) and non-interactive ones for deployments. |
You'll never deploy a template. It's always interactive. |
We are talking about multiple tasks here:
|
I don't think we should bloat framework core with commands for app initialization. We could create separate composer package, which will provide commands for this task. These commands can be triggered by composer or manually. After initialization package could be just removed. But with good design it could be used event after initialization, for example to add separate endpoint to existing application. |
So is everyone agreed that we will start by creating something with Composer and an interactive shell and see if we can get that to work? |
Yep, I think that's the way to go. |
Basic design considerations expound here yiisoft/yii-base-web#45 (comment) @samdark I can not close this issue, btw |
@schmunk42 should it be closed? |
I think so, installation is done via |
Is it has been finished? |
The template? No. But we agreed on how to proceed with it. |
No description provided.
The text was updated successfully, but these errors were encountered: