Giter Site home page Giter Site logo

monorepo-ts-template's Introduction

Monorepo Typescript Template

This is an example of a monorepo with typescript and docker.

What's inside?

This repository uses Yarn workspaces as a package manager and Turborepo as a task runner.

  • Yarn Workspaces Workspace is a yarn feature that hoists our node modules into the root level in our monorepo while keeping symbolic links for the dependencies within the monorepo—allowing us to work on multiple codebases within a monorepo without manually linking dependencies.
  • Turborepo Turborepo is a tool that builds a dependency graph of our packages and runs pipelines to respect the hierarchy of dependencies. Instead of worrying about running build in all of the packages an application depends on, Turborepo takes care of that for us.

It includes the following packages/apps:

Apps and Packages

  • web: a Next.js app
  • api: an Express server
  • ui: ui: a React component library
  • eslint-config-custom: eslint configurations for client side applications (includes eslint-config-next and eslint-config-prettier)
  • eslint-config-custom-server: eslint configurations for server side applications (includes eslint-config-next and eslint-config-prettier)
  • scripts: Jest configurations
  • logger: Isomorphic logger (a small wrapper around console.log)
  • tsconfig: tsconfig.json;s used throughout the monorepo

Each package/app is 100% TypeScript.

Docker

This repo is configured to be built with Docker, and Docker compose. To build all apps in this repo:

# Create a network, which allows containers to communicate
# with each other, by using their container name as a hostname
docker network create app_network

# Build prod using new BuildKit engine
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose -f docker-compose.yml build --parallel

# Start prod in detached mode
docker-compose -f docker-compose.yml up -d

Open http://localhost:3000.

To shutdown all running containers:

# Stop all running containers
docker kill $(docker ps -q) && docker rm $(docker ps -a -q)

Utilities

This repository has some additional tools already setup for you:

monorepo-ts-template's People

Contributors

pierreandreis avatar

Stargazers

Gabryel Gonçalves Santos avatar zeeh avatar Laurent avatar Lucas Schulze avatar Rodrigo Henrique avatar Jhordy Isensee avatar Matheus Lúcio avatar

Watchers

James Cloos avatar

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.