├── app
│ ├── App_Resources
│ ├── layout
│ │ ├── default.vue
│ │ └── index.ts
│ ├── modules
│ │ ├── auth
│ │ │ ├── repository
│ │ │ │ ├── auth.api.ts
│ │ │ │ ├── auth.types.ts
│ │ │ │ └── index.ts
│ │ │ └── store
│ │ │ ├── actions.ts
│ │ │ ├── getters.ts
│ │ │ ├── index.ts
│ │ │ ├── mutations.ts
│ │ │ └── state.ts
│ │ ├── chart
│ │ │ ├── routes
│ │ │ │ └── index.ts
│ │ │ ├── store
│ │ │ └── views
│ │ │ ├── chart.vue
│ │ │ └── index.ts
│ │ ├── home
│ │ └── social
│ ├── repository
│ ├── router
│ ├── store
│ ├── App.vue
│ ├── main.ts
│ ├── package.json
│ └── styles.scss
├── types
│ ├── env.d.ts
│ ├── nativescript-vue.d.ts
│ ├── vue-class.d.ts
│ └── vue-sfc.d.ts
├── .babelrc
├── .eslintignore
├── .eslintrc
├── .gitignore
├── .prettierrc
├── LICENSE
├── package-lock.json
├── package.json
├── README.md
├── tsconfig.esm.json
├── tsconfig.json
└── webpack.config.js
The App/ namespace is equvalent to src/ in other Vue projects. The TSLINT reads files frim App/ and types with the following extension:
The approach is inspired by Domain-Driven Design (DDD), to focus the structure on every feature (per modules). Each modules may contain the following sub-items:
view
of the application. The Component/ is also placed here for easy referencingContains the layout components that you may use in your pages similar to nuxt's layout directory.
Please see social and chart module's view for reference.
Contains the base repository initiliazation. By default, the project uses REST API calls via axios
Injects all the declared routes in modules and inject to the Vue instance
Injects all the declared modules store and inject to the Vue instance
The main vue file
the main file entry point
This directory includes Typescript shims files for global and explicit parsing. E.g
env.d.ts
Environment variables are set in the
webpack.config.js
file within the snippet below:
plugins: [
// ... Vue Loader plugin omitted
// make sure to include the plugin!
new VueLoaderPlugin(),
// Define useful constants like TNS_WEBPACK
new webpack.DefinePlugin({
"global.TNS_WEBPACK": "true",
"TNS_ENV": JSON.stringify(mode),
"TNS_API_URL": (mode === "production") ? JSON.stringify("https://jsonplaceholder.typicode.com") : JSON.stringify("https://jsonplaceholder.typicode.com"),
"process": "global.process"
}),
...
IMPORTANT: TNS_ENV returns mode
development or production
. This is important during builds.
tns doctor
and see resultscd
to project and run npm install
npm run android
npm run ios
npm run lint
npm run lint:fix
npx vue-devtools
and in another terminal, run the platform with the commands above (npm run android or npm run ios
). Please follow this awesome guide from nativescript-vue docstns
commands as usual (e.g tns run android, tns run ios
)--device <device-id>
when using actual devices for android and iOSDuring usual run, project runs with following settings -
# Build, watch for changes and debug the application
tns debug <platform>
To minify code, and prevent Vue logs -
# Build for production
tns build <platform> --env.production
tns run <platform> --env.production
Please file issues to further improve this project here https://github.com/Lyduz/nitibo/issues
Contributions are the most welcome. To request changes, please follow the following:
feature/*
for feature related changes or bugfix/*
for bug related changes