BrewMyMac
Possibly the coolest way to install apps and customize your Mac!
Introduction
This article explains the motivation behind this project.
Getting started
Try it: https://brewmymac.sh
Supported package repositories
- Homebrew: The missing package manager for macOS
- Homebrew Cask: An extension to Homebrew that allows you to install macOS applications
- App Store: A macOS app store platform maintained by Apple Inc
Supported macOS tweaks
- macOS tweaks: A collection of nearly 50 macOS customizations
Running locally
You need Node.js and npm installed on your machine.
- Install dependencies
npm i --legacy-peer-deps
- Change the homepage URL in
package.json
to.
- This app uses Bugsnag and Sentry to track errors and Mixpanel to track usage. You can create a
.env
file and adding your own keys by setting theREACT_APP_MIXPANEL_TOKEN
,REACT_APP_BUGSNAG_KEY
andREACT_APP_SENTRY_DSN
environment variables. - Start the development server
npm start
- Open http://localhost:3000 with your browser
Building from source
You need Node.js and npm installed on your machine.
- Install dependencies
npm i --legacy-peer-deps
- Build the app
npm run build
- The built app will be in the
build
folder
Deploying your own instance
Apart from changing the values in steps 2 and 3 in the Running locally section, you will need to create your own API for saving and retrieving sessions.
A session is a generated Shell script that contains the list of apps to be installed and tweaks to be applied and it is uniquely identified by its ID. The minimal data structure of a session is as follows:
{
"sessionId": "string",
"script": "string"
}
This project uses Xano as the backend service which provides persistent data storage and RESTful APIs. You can use any other service that provides similar functionality. If you do that, you need to change the URLs in src/api/session.ts
and src/screens/SessionDetail.tsx
.
Architecture
- The frontend is a React app hosted on GitHub Pages. This project does not involve any backend service implementation.
- The frontend app fetches a list of available apps from Homebrew via its Formulae API.
- The frontend app fetches a list of available apps from Homebrew Cask via its Formulae API.
- The frontend app searches for apps in Apple App Store via a public CORS proxy.
- The frontend app fetches a list of available macOS tweaks from a GitHub repository.
- When the user is ready to install apps and apply tweaks, the frontend app generates a shell script and stores it in Xano which is a no-code database. A link to download the shell script is generated and a single-line command is displayed to the user.
- The user opens Terminal in macOS.
- The user runs the single-line command that downloads the shell script from Xano.
- The shell script downloads an Ansible playbook for macOS tweaks from GitHub.
- The shell script installs apps using Homebrew and mas-cli, and applies macOS tweaks using Ansible.
License
BrewMyMac is open source software released under MIT.