This is a Node.js application running an Express server and using React for server-side rendering. The application displays a list of your GitHub repositories (that's you, the developer).
Accompanying slides can be found here.
- Create a new personal GitHub access token with read access to your repositories
- Set the environment variable
GITHUB_TOKEN
in.env
file (see.env.example
for an example) - Install dependencies:
yarn
(ornpm i
) - Run the development server with hot reloading:
yarn dev
- Navigate to localhost:3000
- To build the app and run in production mode:
yarn build && yarn start
Run tests:
$ yarn test
Everything is skipped because nothing's implemented yet: we'll do that!
Note that running tests should not require a GitHub access token: they should use Unmock.
- SSR 101
- Tour of the app
Hands-on:
- Fork the repository
- Get the application to run locally
- Make any pull request to your fork, "approve" and merge 🦄
- Make a pull request to
unmock/shortcut-startup-school-workshop
- Introduction to CI/CD
Hands-on:
- Log into CircleCI
- Add CircleCI to your fork
- Add command to run tests
- Slides
- Tour of Unmock
Hands-on:
- Writing tests for our application
- Hack away and ask questions
- Ideas:
- Add test reporter
- Add support for fetching all GitHub repositories
- Add continuous deployment to Heroku
Note that the application server renders static markup and does not attempt to hydrate the markup. So adding event listeners etc. will fail. If you want to add interactivity, client-side routing, and/or more complex logic on what to fetch in server and in client, you might want to take a look at a framework like Next.js.
- Add the deploy job from
noitulos
branch to.circleci/config.yml
- Login to Heroku, install CLI, create API key
- Login with CLI:
heroku login
- Create app:
heroku create
- Add GITHUB_TOKEN in Heroku as ENV var
- Add
HEROKU_API_KEY
andHEROKU_APP_NAME
in CircleCI