Livshitz / BundularJS.scaffold

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BundularJS

Build: Netlify Status

libx.js: npm

libx.fuser: npm

BundularJS is .

Features:

  • Serverless - Zero maintenance of any server
  • Static - All resources are compiled, built and bundled ahead of time
  • Progressive - Crucial resources loaded immediately while other components are loaded when needed
  • Slick - Jade/Pug engine is used to precompile neat declarative markdown into HTML
  • Continuously Deployed - Changes are automatically deployed and served, based on the git branch
  • Edge technology - Using Firebase to store and propagate changes to all viewer in real time, manage user authentication and serverless+microservices using Cloud Functions

Tools Used:

  • Firebase - Database, auth, Cloud Functions
  • Netlify - CI/CD, hosting, pre-rendering, routing, DNS management, SSL
  • libx.js (npm) - Swiss army knife full of useful modules and helpers
  • libx.fuser (npm) - A prebuilt framework of script bundles, styles and configurations. Also serves as bundler (like Webpack), and dev env server.

Initial Setup:

  1. Clone the repo and cd into the project folder
  2. npm install to install dependencies for the webapp
  3. npm install -g firebase-tools
  4. Firebase:
    1. Create account in Firebase and grab your personal token by running firebase login:ci
    2. Create new project and realtime-database
    3. cp src/project-secrets-empty.json src/project-secrets.json
    4. Get your service account ('private key'), copy it's content to the file src/project-secrets.json
    5. Create a private passphrase to secure your secrets file export FUSER_SECRET_KEY=<your-secret>
    6. Lock your secrets file node node_modules/libx.fuser --secrets-lock
    7. Edit src/project.json file with relevant paths to your new Firebase project
  5. Netlify (optional):
    1. Create new project and point to your cloned repo

Running Locally:

Run local server: node fuser-client.js --secret=<?>.

With api (local Firebase Cloud Functions): node fuser-client.js --secret=<?> --api.

Useful Commands:

  • node fuser-client.js - Build & run local frontend server with watch and hot-reload
  • node fuser-client.js --build - Build only
  • node fuser-client.js --api - Build & run local frontend server with local backend (cloud functions)
  • node node_modules/libx.fuser --api-run - Run local backend only
  • node fuser-client.js --env=prod - Run local frontend server with production configuration (bundling & compression enabled)
  • node fuser-client.js --api-deploy - Deploy whole api backend
  • node node_modules/libx.fuser --secrets-lock - Encrypt your secrets file
  • node node_modules/libx.fuser --secrets-unlock - Decrypt your secrets file
  • firebase deploy -P <project> --only functions:'<functionsGroupName>.<functionName>' --token <token> - Deploy only one specific Cloud function from your api

Contributing

Fork into your own repo, run locally, make changes and submit PullRequests to the main repository.

License

All projects and packages in this repository are MIT licensed.

About

License:MIT License


Languages

Language:HTML 65.8%Language:JavaScript 24.1%Language:CSS 10.0%