% npm install
% npm run serve
% npm run test
% npm run lint
% npm run test:unit
% npm run build
% npm run build -- --mode staging
- Setup base path for the app
If you wish to use a non-root directory for the front-end, in that case Vue router must know the
path prefix to perform navigation properly. Environment variable VUE_APP_UI_BASE_PATH
makes that
happen.
Create a file .env.staging.local
or .env.production.local
depending on which environment are you
building for and add the following content.
VUE_APP_AUTH_TOKEN_FETCH_STRATEGY=api
VUE_APP_UI_BASE_PATH=/<path>
Note: If you wish to deploy to your own domain, then you can safely remove
VUE_APP_AUTH_TOKEN_FETCH_STRATEGY
in which case it's going to default to cookies
. Strategy api
enables the app to be deployed for demonstration purposes where both the back-end and the front-end
are deployed to completely different domains given by the underlying cloud provider
(eg. <projectId>.appspot.com
and <projectId>.firebaseapp.com
).
- Setup API base URL
A default value for VUE_APP_API_BASE_URL
is set for both staging
and production
and you'll
have to change that for your own deployment. The procedure is the same as above, that is, add the
custom value to .env.staging.local
or .env.production.local
.
- Compile and minify for
staging
orproduction
% npm run build -- --mode staging
% npm run build
- Authenticate with Firebase
% firebase login
- Create and add a project
Open the Firebase Console to create a project.
Note: Firebase projects are Google Cloud Platform projects that use Firebase services. This means that unique identifiers for a project (like Project ID) are shared across consoles.
% firebase use --add
- Upload front-end
% firebase deploy
- Setting up a custom domain.
Refer to Connect a custom domain on how to add a custom domain to your deployment if you have one.