Angular Material, Firebase, Firestore
ORDER, ORDER, ORDER!
First Order’s mission is to develop websites
with cutting edge technology and best web design guidelines that support all devices and browsers.
This website uses Google Firebase as back-end.
This website uses Cloud Firestore as a database, it’s a NoSQL cloud database to store and sync data for client- and server-side.
npm install -g firestore-backup-restore
firestore-backup-restore --accountCredentials path/to/account/credentials/file.json --backupPath backups/myDatabase
firestore-backup-restore --restoreAccountCredentials path/to/account/credentials/file.json --backupPath backups/myDatabase --prettyPrint
Note: All titles and descriptions MUST be defined in English in the database under the ‘en’ parameter, and optionally in other languages ‘de’, ‘ar’.
This to ensure proper fallback to ‘en’ in case a translation is not found.
Firebase Storage can keep all the files that are not static assets to the project.
These can be product files, profile pictures or uploaded files.
We recommend storing file metadata in the Database using the same path and :fileid like is Storage:
Database/files/:fileid/metadata
Storage/files/:fileid/filename.ext
npm install or yarn
npm install -g firebase-tools
cd functions && npm install && cd ..
For Development (Client-side only rendering)
npm run start
which will start ng serve
. You can now test your website locally with Chrome on http://localhost:4200
For Production (also for testing SSR/Pre-rendering locally)
npm run build:ssr && npm run serve:ssr
- Compiles your application and spins up a Node Express to serve your Universal application on http://localhost:4000
.
npm run build:prerender && npm run serve:prerender
- Compiles your application and pre-renders your applications files, spinning up a demo http-server so you can view it on http://localhost:8080
Note: To deploy your static site to a static hosting platform you will have to deploy the dist/browser
folder, rather than the usual dist
Firebase Hosting can be used to host your static dist/browser
website files. It takes care of your https security certificates for free, caches your files and much more.
First connect your domain to the hosting in the Firebase console -> Development -> Hosting.
You should have 3 domains like this:
yourwebsite-com.firebaseapp.com => Default (already created)
yourwebsite.com => Serve traffic from this domain
www.yourwebsite.com => Redirect this domain to another -> yourdomain.com
Here is how you can deploy your website
In this repo the firebase.json file is already initialized to deploy your static pre-rendered files from the dist/browser
folder to Firebase Hosting, so just run:
firebase login
firebase deploy
All done. Navigate to https://yourwebsite.com to see it live.