I am very new to vue and I have followed some guideline to use it.
In the first, that is here the project was structure in this way:
1) There is a src directory, and inside I have : assets,components,route,services and view.
2) There is also a server directory and inside I have : src and models directory.
But, In another guide, this one I found this skeleton:
1) There is only a src directory.
Which is the best way and Why is better to use one of this structure?
Thank you
The recommended way is for you to create a project with Vue CLI, which will end up creating the structure you mentioned first.
In a very simple project you can put all just into a simple src directory, but that is off topic here on Stackoverflow, because it is an opinion; there is no such thing as a single correct directory structure.
Don't get hung up on this. If you are new, and you're not aware of having special requirements, start with the templates in vue cli. They are a good common standard. If/when you want to branch out, do so for a reason. Here are some good project templates with various specialisations (enterprise, OAuth, etc)
Related
Often I have code reused by multiple Netlify functions in the same project.
I know that anything within my /functions directory will become a function so I don't want to nest directories there. I could include it in /src, but if feels odd to comingle source with my single-page app (SPA) since they have different dependencies.
Is there a good convention for where to put this code? I can't seem to find any answer to this in any of Netlify's documentation.
Is it possible to have MVC in sub folders (modules) when using node.js express framework?
Today I have this structure of my project:
Controllers
Blog/*
Poll/*
And many more
Models
Blog/*
Poll/*
And many more
View
Blog/*
Poll/*
And many more
Routes
Blog
Poll
And many more
Should it be possible to have this structure in a module way instead?:
Blog
Controllers/*
Models/*
View/*
routes.js
Poll
Controllers/*
Models/*
View/*
routes.js
And more modules
When I develop I feel I mostly work with one part of the project at the time. When I the current structure its a lot of moving between folders. However most of the time I only focus on "module". It will also be easier to remove as module just to delete the sub folder and all it files are removed. If a project has more 30 modules it will be hard to find the file (Its possible to search but should be nice just have it in same folder). I been working with Drupal before that has this type of module system where you can easy add and remove modules (Might be that am used to to it and not yet familiar with this new this way of doing it). What are the main benefits of the first approach over the module way?
Is this possible to achieve in the express framework? If so any tutorials on how to set it up? Any other node.js framework support this?
Objective:
Use a monorepo structure, in which I can share domain models and generic implementations (using a provider pattern) across the different Bounded Contexts
Ability to deploy each bounded context or client application independently of the others (thus all of this in a monolith under one src directory is not acceptable.
Background: Typical tech stacks for me is Angular + .Net Core. I am starting to move away from Angular and also exploring the code sharing benefits if I do my API development with Nestjs.
I am trying to figure out the best way to set up shared code between the client and API and running into some issues.
I have the following directory structure. I would like to figure out the best way to shared the models that are in the domain/models/comestibles in the api/comestibles and in the web application. I am ok with putting all of the shared code in a packages folder as well (was looking at Lerna)
I can easily point the code to the directory from the api/comestibles, but that is making the dist folder structure undesirable and also messing up things (like Swagger). I also had the change the outDir in the tsconfig.json from
"outDir": "./dist"
to
"outDir": "./dist/api/comestibles/src"
This broke other things in the application though as the directory structure is really altered.
I looked at setting up Bit and I have tracked some files, but I do not see any packages created for those files. Perhaps I am using it incorrectly though. I was also looking at Lerna for this. Given this is the first time I have done a full-stack application via scripting, I am unfamiliar with the best architecture for this solution.
Nx.dev plug-in solved my problem.
https://github.com/ZachJW34/nx-plus/tree/master/libs/vue
I want to create CRUD application using technologies like:
- Vue.js
- Node & Express
- mysqli (xampp)
What is the best way to make project structure (directory and files tree)?
If dividing two folders - front with Vue files and server with others is a correct practice? Or maybe the whole app should base on the one of that, for example vue and all other files/folders should take place inside of vue folder? I know that it is a lot of right ways, but what which of that are the best?
Splitting into front end and backend is usually the first step to take for me, then as development continues you can refactor as needed. I'd take some time to review github and find projects that are well setup, for example:
https://github.com/mozilla-iot/gateway
When I use generator-angular-fullstack's API to build routes, controllers, directives, whathaveyou, it appends naming conventions I don't like. For instance for all the module declarations it appends "App", and I'd prefer to not have "App" appended to my app name. Also, it uses "Ctrl" instead of "Controller", and so on.
I'm not seeing a json file that controls this behavior in my app or my angular-fullstack npm files. There's a good chance I'm overlooking something or not even looking in the right place.
Thanks!
You cannot edit the templates directly. You can either go back and rename them, or generate your own templates by replacing the routing through your .yo-rc.json file. It's located in the root folder of the project in all angular-fullstack apps unless removed.
It looks like angular-fullstack uses the generator-ng-component node module for the templates, here's a link to the github repo for controller template specifically. You could also make your own, fork it, then use it as your own generator.
https://github.com/DaftMonk/generator-ng-component/blob/master/templates/controller/name.controller.js