The Progressive Web App frontend for Blerp, built with React and next.js.
Use withLogging for tracking
Project is managed with npm.
$ npm install
This installs all production and development dependencies needed to work with this codebase locally.
After installing all dependencies do a npm run build
To have hot loading enabled first run npm run dev
We use the sw-precache-webpack-plugin to create a service worker to cache things heavily on the frontend
npm run start
will start the app in production mode .dist/server.js
New pages are created in the pages folder
We want to make component specific to pages within a single pack in the packs/page
folder
When we delete a page we should be able to safe delete the whole pack
related to the page
Use VS code with ESLint dbaeumer.vscode-eslint Dirk Baeumer when running this project. Prettier should be configured on save.
All styles and styled components should be run through stylelint
Example: npx stylelint src/components/buttons/rectangle-text-button.js
Jest command runs all projects defined in package.json jest-[runners].config.js
on all files
npm run jest
Don't run ./deploy.sh install directive on your local computer. I haven't tested it yet, but even still it's for setting npm + yarn on a completely fresh debian install. ./deploy.sh ./deploy.sh run ./deploy.sh stop ./deploy.sh clean are all safe
We deploy to google serverless functions for all the routing. Essentially the serveApp function in server.ts is what gets hit in lambda.
It starts up next.js and the routing is configured for the pages. Our frontend website is hosted mainly on firebase. Firebase links all the functions to the right spots. The firebase.json
file is what defines blerps cloud function mappings. To change the routing you will need to run firebase deploy --project blerp-staging-ac0d7 --token $FIREBASE_TOKEN
.
npm install -g serverless
Get a JSON service key file from and a on admin google cloud. Copy the file to ~/.gcloud/blerp-keyfile.json
. Go to the src/config/project
file and change the export variable to projectConfig.staging
. Run yarn:deploy:staging
. Wait for the magic to happen. Access the endpoint at the host url listed in the project config for the deployed environment.
npm install -g serverless
Get a JSON service key file from and a on admin google cloud. Copy the file to ~/.gcloud/blerp-keyfile.json
. Go to the src/config/project
file and change the export variable to projectConfig.production
. Run yarn:deploy:production
. Wait for the magic to happen. Access the endpoint at the host url listed in the project config for the deployed environment.
Node.js is the only required prerequisite for working with this codebase. Yarn is reccomeneded.
Building is handled using webpack
- as configured in this repo - and serverless-webpack
.
Deploying is best handled by the CI - as defined in this repo's .gitlab-ci.yml
.
This project uses the centralized Blerp API located at https://api.blerp.com. Documentation for this can be found in the the @blerp/api
repo.
This project is proprietary and closed source. All Rights Reserved to Blerp Inc.
Images not related to bites. Images can be served from the static folder. However we host most of our images from https://console.cloud.google.com/storage/browser/blerp-web-images/static/?project=blerp-cf7ae in order to minimize load time.
Using styled components we had to setup thishttps://bilalbudhani.com/using-next-js-with-styled-components/ and this /_ https://www.styled-components.com/docs/tooling#serverside-rendering _/