Starter Code for projects of high-complexity that use Webflow, Vue and Firebase
After cloning this repository, follow the following steps:
- Replace all text occurrences of
project-xxx
with the name of your project (ex: acme-corp-marketing-site). - At the root of the repository, run
yarn
to install the base dependencies - Still at the root of the repository, run
yarn prepare
so Husky can be set up - Head over to the Firebase Console and setup the Firebase project that will be used for this project. Note down the project information.
- CD into
packages/types
and runyarn build
- CD into the
packages/front-end
folder, and run the following commands:firebase login:use YOUR_FIREBASE_EMAIL_HERE
. This will make firebase use the correct account to deploy the code of this application. - CD into the
packages/back-end
folder and run the same command you ran in step #6 - Register a web app in your Firebase project, copy the configuration provided by Firebase and paste it into
packages/front-end/src/services/firebase.ts
dev config and prod config. If in the future you decide to setup a new project in firebase to act as a development environment, make sure to replace the value of "devConfig".
- For each new page, update the
webpack.config.js
file and add new pages under the 'entries' object of the configuration. - When ready to start developing, run
yarn dev
, write your code, and use the Content Override feature of browsers to override the application scripts with code from your machine. - To see new changes on the page you're working at, keep the developer panel open on your browser and reload the page.
- Update the config object on
front-end/services/firebase
and any other place that might use firebase. - Update the dev output folder in the
webpack.config.js
file. Structure it like so:local-{{project-name}}/{{project-domain}}/scripts
- Run
yarn deploy
- To add new back-end functions to the codebase, just add exported entries to the
index.ts
file at the root of thesrc
folder. - To work on your back-end functions and test them with the Firebase Shell, open two terminal windows;
- From the first terminal window, run
yarn start:dev
oryarn start:prod
; - From the second terminal window, run
yarn dev:dev
oryarn dev:prod
; - Go back to the first terminal window and interact with your back-end functions following Firebase's guide. Example:
users.login({email:"[email protected]", password:"12345"})
- Run
yarn deploy:prod
oryarn deploy:dev
to have your local changes take effect and be pushed live