This is a sample architecture for Vue.js projects based on features
, one folder per feature.
vuex
- data storevue-router
- routingvue-axios
- backend callsaxios-mock-adapter
- mocking api calls
feature
- one folder per featureshared
- will contain shared functionalitiescomponents
- shared components used by multiple featuresservices
- shared services used by multiple features
*.vue
- files to hold the vue pages and componentsservices.js
- file to contain all the api calls and any logic functions needed by the featurestore.js
- file to contain the vuex store of the feature and only for that feature
router
- contains all the routes of the applicationstore
- contains the global store where the features stores are imported and global statemock-server
(file) - contains mocks for the apis used in the application. The mocks are disabled automaticaly whenenvironment != development
For api mocking, the following axios package was used: axios-mock-adapter
npm install
or
yarn
npm run serve
npm run build
Happy coding!,
@Imhotepp