diff --git a/Brewfile b/Brewfile new file mode 100644 index 0000000000..8e43ffdd88 --- /dev/null +++ b/Brewfile @@ -0,0 +1,18 @@ +### +# This will download all Homebrew dependencies. +### + +# Shared +brew "git" +brew "docker" +brew "docker-compose" +brew "protobuf" +brew "prototool" +cask "docker" + +# Frontend +brew "node@12" +brew "yarn" + +# Backend +brew "go" diff --git a/Makefile b/Makefile index cee6d132cf..125f74565e 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,35 @@ ### -# All-in-one build command. +# All-in-one commands ### -build: build-yarn-dependencies build-protocol-definitions +init: init-secrets +install: install-homebrew-dependencies install-yarn-dependencies install-forego +start: build-protocol-definitions + forego start + +### +# Setup secrets +### +init-secrets: + cp secrets.env.example secrets.env + +### +# Install any Homebrew dependencies specified in Brewfile +### +install-homebrew-dependencies: + brew bundle ### # Download dependencies from the Frontend using Yarn. ### -build-yarn-dependencies: +install-yarn-dependencies: yarn --cwd ${PWD}/frontend install +### +# Install Forego for running both frontend and backend in a single command. +### +install-forego: + go get -u github.com/ddollar/forego + ### # Protobuf Definitions. # This will generate Protobuf definitions from ./proto to both Go and JS/TypeScript. diff --git a/README.md b/README.md index dac98d9f28..75bbf2a0a7 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,22 @@ Backstage is an open platform for building developer portals. ## Getting started +### Install Dependencies with Homebrew and Yarn + +Run the following to install relevant dependencies (such as Git, Docker, etc): + +```bash +# If you don't have Homebrew, run the following command: +# $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +$ make install +``` + ### Secrets To setup secrets, copy the `secrets.env.example` to `secrets.env` as such: ```bash -$ cp secrets.env.example secrets.env +$ make init-secrets ``` ### Protobuf Definitions @@ -28,29 +38,10 @@ See [proto/README.md](proto/README.md) for more information. ## Running Locally -First step is to set up a `secrets.env` file in the root of the repo. Use the following template but fill in your own values (without quotes!): +Once you've installed all dependencies, start serving the frontend using `yarn`: ```bash -# GitHub username -BOSS_GH_USERNAME= -# GitHub Access token with repo scope, created at https://github.com/settings/tokens -BOSS_GH_ACCESS_TOKEN= -``` - -Then run start all backend services using `docker-compose`: - -```bash -$ ./docker-compose.yaml up --build -``` - -And finally install all dependencies and start serving the frontend using `yarn`: - -```bash -$ cd frontend - -$ yarn install - -$ yarn start +$ make start ``` ## Plugins diff --git a/secrets.env.example b/secrets.env.example index c83bd2158b..bac99824e0 100644 --- a/secrets.env.example +++ b/secrets.env.example @@ -1,4 +1,19 @@ +### +# The environment you want to run the frontend (running using create-react-app) in. +# In production, these should be `production` and false respectively. +### NODE_ENV=development NODE_DEBUG=true + +### +# This is the full HTTP endpoint to the GraphQL API you'll want to point to. +# For example (in development): http://localhost:8080/graphql +### REACT_APP_GRAPHQL_API="" + +### +# A valid GitHub access token. +# To create one, visit https://github.com/settings/tokens in your browser. +### +BOSS_GH_USERNAME="" BOSS_GH_ACCESS_TOKEN=""