Getting Started

Getting Started

🚩 Requirements

💨 Quick Start from Template

→ Fork and Deploy to Vercel

You can start by creating your monorepo with web and docs applications by deploying to Vercel by clicking the link:

Deploy with Vercel (opens in a new tab)

→ Manual Setup

You can use GitHub built-in functionality, to generate your repository from this template. Generated repository can always be synced using manual GitHub workflow (opens in a new tab).

→ Using Terraform

At WoD we use Terraform to automate the process of creating new repositories from templates. mineiros-io/terraform-github-repository (opens in a new tab) repository can be used, to manage your GitHub organization state, all repositories and their templates.

Example configuration for creating new repository from template:

repos-frontend.tf
module "repository_next_frontend_[project-name]" {
  source  = "mineiros-io/repository/github"
  version = "~> 0.18.0"
 
  name         = "next-frontend-[project-name]"
  description  = "NextJS based frontend application for [project-name]"
  visibility   = "private"
  homepage_url = "https://[project-name].io"
  push_teams   = [module.team_vb.id]
  admin_teams  = [module.team_infra.id]
 
  template = {
    include_all_branches = true
    owner                = "wayofdev"
    repository           = "next-starter-tpl"
  }
 
  branches = [
    {
      name          = "develop"
      source_branch = "master"
    },
  ]
 
  default_branch = "develop"
 
  branch_protections_v4 = [
    {
      pattern = "master"
    },
    {
      pattern                         = "develop"
      require_conversation_resolution = true
 
      required_pull_request_reviews = {
        require_code_owner_reviews      = false
        required_approving_review_count = 0
      }
    }
  ]
 
  issue_labels                          = tolist(local.default_issue_labels)
  issue_labels_merge_with_github_labels = false
}

💻 Setup

⚠️

Repository with docker-shared-services (opens in a new tab) should be configured, up and running, to ensure *.docker domain support system-wide.

→ Clone Repository

After forking or creating generating repository from template, you can clone it to your local machine. In this example we will use next-starter-tpl repository as starting point.

$ git clone git@github.com:wayofdev/next-starter-tpl.git

→ Generate .env file

Generate .env file from .env.example file.

# add FORCE=true to overwrite existing .env file
$ make env \
  APP_NAME=tpl \
  SHARED_SERVICES_NAMESPACE=ss \
  PROJECT_SERVICES_NAMESPACE=wod

Change generated .env file to match your needs, if needed.

→ Install Dependencies

This command will install all dependencies, through docker container, for this mono-repo and all dependencies.

# default action - runs `make install` and setups git hooks
$ make
 
# or, run each step separately
$ make install
$ make hooks

→ Run docker container in dev mode

This command will start docker container in dev mode, with hot reloading enabled.

make up

Project can be accessed at: