Git Product home page Git Product logo

boilerplate-monorepo's Introduction

@boilerplate-monorepo

CircleCI codecov

A monorepo setup for winning.

😎 Show Me Already

View the demo here

😴 We're big fans of siestas so we let our app take nap too. ⏳ Please be patient while it spins up.

πŸ—³οΈ What's in the box?

  • Postgres (database)
  • GraphQL (service)
  • React (ui)

βš™οΈ System Requirements

  1. Docker v19.03+
  2. Node v14.2.0+
  3. Yarn v1.19.1+

πŸ” Recommended Tooling

  • Insomnia v7.0.6+
    • Easily call GraphQL queries/mutations
    • Make REST calls too!
    • Take a tour of our schema with built-in Docs
    • Load up the config and go!

🏎 Getting Started

# 1. ⬇️ Clone this repo
git clone [email protected]:n8io/boilerplate-monorepo.git

# 2. πŸ› οΈ Generate local environment variable files
(
  cd packages \
  cp -n service/.env.example service/.env \
  cp -n ui/.env ui/.env.local \
  ;
)

# 3. 🌱 Install dependencies
yarn

# 4. ↩️ Add hosts file entry (if needed)
yarn hosts

πŸ€“ Development Experience

# Start all the things!
yarn start # πŸ‘πŸ€œπŸ€›πŸΎπŸ₯³

# When you're done dev'ing, spin down the Docker containers
yarn down

πŸ§ͺ Testing

🏘️ Unit Tests

# Run all the tests
yarn test

# Watch all the tests
yarn test:watch

🌲 End-to-End Tests

This project is setup to run functional tests using Cypress.

# Opens up Cypress test dashboard
yarn e2e:dev

πŸ—‚ Database Migrations

NOTE Database migrations are ran adhoc. You must manually run them before using the app.

Run existing migrations

yarn db:migrate

Rollback a single migration

yarn db:migrate:down

Generate a new migration

yarn db:migrate:gen create-table-foo # the name is up to you

Existing migration files can be found in packages/service/src/migrations.

🧰 Tooling

🎣 Hook Code Generator

There is a handy dandy generator for creating React hooks for our GraphQL queries/mutations. Give it a try!

cd packages/tool-hook-generator

# Refresh your schema file
# Make sure your GraphQL server is running before you run this command
yarn codegen # Rerun as needed

# Creates a `useUserRegister` mutation hook
yarn hook:mutation UserRegister

# Creates a `useUserSelf` query hook
yarn hook:query UserSelf

πŸ“˜ Cutting a release

WARNING: Running the command below will:

  1. Bump versions in all package.json's using conventional commits
  2. Update READMEs using conventional commits
  3. Tag and push a new release to GitHub
  4. Assuming you have a CircleCI workflow setup...
    1. It will kick off a release build
    2. Don't worry, it won't deploy until you manually approve the deployment in CircleCI

While it is possible to unravel, please make sure you mean to release a new version of the repo when running it.

Pending you have permissions to push to master, run the following:

GH_TOKEN=<YOUR_GITHUB_PERSONAL_ACCESS_TOKEN> yarn release

# Follow the prompts

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.