All Projects → scopsy → Nestjs Monorepo Starter

scopsy / Nestjs Monorepo Starter

A full-stack nestjs starter project. Includes authorization, authentication, MongoDB, Redis queue support, Crons jobs, and end-to-end testing.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Nestjs Monorepo Starter

Chrome Extension Typescript Starter
Chrome Extension TypeScript Starter
Stars: ✭ 601 (+936.21%)
Mutual labels:  starter, boilerplate
Vue Electron Typescript Quickstart
A boilerplate of Electron app that uses Vue in TypeScript.
Stars: ✭ 22 (-62.07%)
Mutual labels:  starter, boilerplate
Lass
👧 Lass scaffolds a modern package boilerplate for Node.js
Stars: ✭ 615 (+960.34%)
Mutual labels:  starter, boilerplate
Starter Laravel Angular
Laravel and AngularJS Starter Application Boilerplate featuring Laravel 5.3 and AngularJS 1.5.8
Stars: ✭ 373 (+543.1%)
Mutual labels:  starter, boilerplate
Web Extension Starter
🖥🔋Web Extension starter to build "Write Once Run on Any Browser" extension
Stars: ✭ 987 (+1601.72%)
Mutual labels:  starter, boilerplate
Nestjs Bff
A full-stack TypeScript solution, and starter project. Includes an API, CLI, and example client webapp. Features include production grade logging, authorization, authentication, MongoDB migrations, and end-to-end testing.
Stars: ✭ 450 (+675.86%)
Mutual labels:  nestjs, boilerplate
Node Express Boilerplate
A boilerplate for building production-ready RESTful APIs using Node.js, Express, and Mongoose
Stars: ✭ 890 (+1434.48%)
Mutual labels:  starter, boilerplate
Create React App Material Typescript Redux
A ready to use boilerplate for starting big react projects
Stars: ✭ 257 (+343.1%)
Mutual labels:  starter, boilerplate
Suicrux
🚀 Ultimate universal starter with lazy-loading, SSR and i18n. [not maintained]
Stars: ✭ 958 (+1551.72%)
Mutual labels:  starter, boilerplate
Typescript Starter
Nest framework TypeScript starter ☕️
Stars: ✭ 853 (+1370.69%)
Mutual labels:  starter, nestjs
React Native Navigation Redux Starter Kit
React Native Navigation(v2) Starter Kit with Redux, Saga, ESLint, Babel, Jest and Facebook SDK 😎
Stars: ✭ 271 (+367.24%)
Mutual labels:  starter, boilerplate
Niklick
Rails Versioned API solution template for hipsters! (Ruby, Ruby on Rails, REST API, GraphQL, Docker, RSpec, Devise, Postgress DB)
Stars: ✭ 39 (-32.76%)
Mutual labels:  starter, boilerplate
Nestjs Boilerplate
NestJS Boilerplate 😻(Authentication, TypeORM, Configuration, Swagger)
Stars: ✭ 267 (+360.34%)
Mutual labels:  nestjs, boilerplate
Hartija Css Print Framework
Universal CSS for web printing
Stars: ✭ 509 (+777.59%)
Mutual labels:  starter, boilerplate
Vue Electron Template
An Electron & Vue.js template with Hot-reloading enabled and common Vue plugins, dev, debug and build scripts configured.
Stars: ✭ 260 (+348.28%)
Mutual labels:  starter, boilerplate
Laravel Boilerplate
Laravel Boilerplate / Starter Kit with Gentelella Admin Theme
Stars: ✭ 704 (+1113.79%)
Mutual labels:  starter, boilerplate
starter-reactnative-nestjs-mysql
Starter mobile ReactNative NestJS MySQL with continuous integration and AWS deployment
Stars: ✭ 16 (-72.41%)
Mutual labels:  starter, nestjs
nest-js-boilerplate
Nest.js boilerplate
Stars: ✭ 79 (+36.21%)
Mutual labels:  starter, nestjs
Next Boilerplate
A well-structured production ready Next.js boilerplate with Typescript, Redux, Jest, Enzyme, Express.js, Sass, Css, EnvConfig, Fetch, Reverse Proxy, Bundle Analyzer and Built-in Project CLI. https://pankod.github.io/next-boilerplate/
Stars: ✭ 936 (+1513.79%)
Mutual labels:  starter, boilerplate
Ultimate Backend
Multi tenant SaaS starter kit with cqrs graphql microservice architecture, apollo federation, event source and authentication
Stars: ✭ 978 (+1586.21%)
Mutual labels:  nestjs, boilerplate

NestJS Mono repo starter

CI

This is a monorepo boilerplate to quickly start nestjs projects, this start includes an api, client and shared libraries.

Overview

The repository is powered by Lerna and Yarn. Lerna is responsible for bootstrapping, installing, symlinking all of the packages/apps together.

What's inside

This repo includes multiple packages and applications for a hypothetical project called nest-starter. Here's a rundown of the components:

  • shared: Shared utilities between server and client (TypeScript)
  • core: Shared utilities between servers
  • client: Angular app (depends on shared)
  • api: NestJS Api server (depends on shared + core)
  • landing: A static landing page

Tweaking for your project

You should run a search and replace on the word nest-starter and replace with your project name.

TypeScript

Referencing packages from other packages/apps

Each package can be referenced within other packages/app files by importing from @<name>/<folder> (kind of like an npm scoped package).

import * as React from 'react';
import { Button } from '@nest-starter/shared';

class App extends React.Component<any> {
  render() {
    return (
      <div className="App">
        <header className="App-header">
          <h1 className="App-title">Welcome to React</h1>
        </header>
        <Button>Hello</Button>
        <p className="App-intro">
          To get started, edit <code>src/App.tsx</code> and save to reload.
        </p>
      </div>
    );
  }
}

export default App;

IMPORTANT: YOU DO NOT NEED TO CREATE/OWN THE NPM ORGANIZATION OF YOUR PROJECT NAME BECAUSE NOTHING IS EVER PUBLISHED TO NPM.

For more info, see the section on package versioning

Installing

Install lerna globally.

npm i -g lerna
git clone [email protected]:scopsy/nestjs-monorepo-starter.git
cd typescript-monorepo-starter
rm -rf .git
lerna bootstrap

Development

Lerna allows some pretty nifty development stuff. Here's a quick rundown of stuff you can do:

  • yarn start: Run's the yarn start command in every project and pipe output to the console. This will do the following:
    • api: Starts the api in dev mode on port 3000
    • client: Starts the app in dev mode on port 4200
    • shared: Starts TypeScript watch task
    • core: Starts TypeScript watch task
  • yarn build: Build all projects
  • lerna clean: Clean up all node_modules
  • lerna bootstrap: Rerun lerna's bootstrap command

Package Management

**IF you run yarn add <module> or npm install <module> from inside a project folder, you will break your symlinks.** To manage package modules, please refer to the following instructions:

Installing a module from Yarn

To add a new npm module to ALL packages, run

lerna add <module>

To add a new npm module(s) to just one package

lerna add <module> --scope=<package-name> <other yarn-flags>

# Examples (if your project name was `nest-starter`)
lerna add classnames --scope=@nest-starter/api
lerna add @types/classnames @types/jest --scope=@nest-starter/api --dev

Uninstalling a module from a package

Unfortunately, there is no lerna remove or lerna uninstall command. Instead, you should remove the target module from the relevant package or packages' package.json and then run lerna bootstrap again. Reference issue: https://github.com/lerna/lerna/issues/1229#issuecomment-359508643

Package Versioning and TS Paths

None of the packages in this setup are ever published to NPM. Instead, each shared packages' (like shared and core) have build steps (which are run via yarn prepare) and get built locally and then symlinked. This symlinking solves some problems often faced with monorepos:

  • All projects/apps are always on the latest version of other packages in the monorepo
  • You don't actually need to version things (unless you actually want to publish to NPM)
  • You don't need to do special stuff in the CI or Cloud to work with private NPM packages

This project works great with WebStorm when opened from the root, this means all imports, Go to should work correctly when navigating between packages. You are welcome.

Docker image

Build the docker image:

docker build -t api -f Docker.api .

Run the Docker Container:

docker run -p 3000:3000 api

Inspiration

A LOT of this has been shameless taken from palmerhq/monorepo-starter.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].