Development
If you want to further customise Mue, fork it, or open a pull request implementing fixes or changes you can follow this guide here to get started.
Mue Tab
The Mue development utilities we use are Git for version control and Node.js and Webpack to run the development server and create production builds to be submitted to the extension stores. You should always use the latest versions of each unless noted. Cloudflare Pages is linked to our repository in order to automatically deploy new changes to our demo which is embedded on the Mue website. Codacy is also linked to check for errors on the code.
Installation
Requirements
- Git
- Node.JS
- A suitable browser (Only modern versions of Firefox and Chromium-based browsers are supported)
Starting
- Clone the repository using
git clone https://github.com/mue/mue.git --depth 1
- Run
yarn
ornpm i
to install all needed dependencies - Run
yarn start
ornpm start
to start the development server - Code your heart out! (See the sections below for how to build the extension)
Building
- Run
yarn run build
ornpm run build
- Run the command for your browser (Chrome, Firefox), for example
yarn run chrome
Chromium Browser Testing
If you need to add the built extension to your browser, follow these steps:
- Visit the "extensions" page in your browser (this is normally accessible through
<browsername>://extensions
, e.gedge://extensions
) - Check the "Developer Mode" toggle
- Click "Load Unpacked" and find your manifest.json in the build directory
- Click ok and then open a new tab. You may need to disable the production Mue extension for your development one to appear.
Firefox Browser Testing
If you need to add the built extension to your browser, follow these steps:
- Visit the
about:debugging#/runtime/this-firefox
page in Firefox - Click "Load Temporary Add-on..."
- Select your manifest.json in the build directory and then open a new tab. You may need to disable the production Mue extension for your development one to appear.
API
The Mue API is built with JavaScript, Vercel and Supabase. It is available in production at https://api.muetab.com
Installation
Requirements
- A free Vercel account
- A free Supabase account
- An umami instance (optional)
- Git
- Node.js
Starting
- Clone the repository using
git clone https://github.com/mue/api.git
- Run
yarn
ornpm i
to install all needed dependencies - Install Vercel CLI with
npm i -g vercel
oryarn add global vercel
- Set the environment variables for "SUPABASE_URL", "SUPABASE_TOKEN" (these can be found in the API section of your Supabase database settings) and "ADMIN_TOKEN". If using umami, add the environment variables "UMAMI_ID" and "UMAMI_URL", otherwise set it to false in config.json
- Sign in and setup Vercel CLI with
vercel dev
. Use this command to start the server also - Code your heart out!
Database Setup
Your Supabase database will need two tables - images and quotes. The images table has columns for id (uuid), category, file, photographer, location and camera (string). The quotes table has columns for id (uuid), author, quote and language (string). In the future we may provide a script to set up the database.
Marketplace
The Mue Marketplace is built with JavaScript and Vercel. It is available in production at https://marketplace.muetab.com
Installation
Requirements
- A free Vercel account
- An umami instance (optional)
- Git
- Node.js
Starting
- Clone the repository using
git clone https://github.com/mue/marketplace.git
- Run
yarn
ornpm i
to install all needed dependencies - Install Vercel CLI with
npm i -g vercel
oryarn add global vercel
- Sign in and setup Vercel CLI with
vercel dev
. Use this command to start the server also. If using umami, add the environment variables "UMAMI_ID" and "UMAMI_URL", otherwise set it to false in config.json - Code your heart out!
Building
To build the marketplace content JSON (all.json), run cd scripts && node updatejson.js
. This will update the content on the server, and you should run this when developing or pushing your changes.
Proxy
This is the Cloudflare Worker used for proxying requests to Unsplash, Pexels, OpenWeatherMap and Mapbox. Unlike the other APIs, this is not available publicly. Please refrain from using it outside Mue.
Installation
Requirements
- A free Cloudflare account
- An umami instance (optional)
- A free Pexels account and API key
- A free Unsplash account and API key (free for development, needs verification for production usage)
- A free Mapbox account and API key
- A free OpenWeatherMap account and API key
Starting
- Create a new Cloudflare worker (there is a guide here)
- Paste the
src/proxy.js
code fromhttps://github.com/mue/workers
into your worker - Create environment variables where mentioned in the section below
- Click "Save and Deploy"
Environment Variables
MAPBOX_TOKEN
- Mapbox API token with access to the tilesOPENWEATHERMAP_TOKEN
- OpenWeatherMap API tokenPEXELS_COLLECTION
- Pexels collection ID to get images fromPEXELS_TOKEN
- Pexels API tokenUMAMI_ID
- ID of umami siteUMAMI_URL
- URL of umami serverUNSPLASH_COLLECTION
- Unsplash collection ID to get images fromUNSPLASH_REFERRAL
- Name of referral to use, such as "mue"UNSPLASH_TOKEN
- Unsplash API token