Skip to content
/ merninator Public template

Node, Yarn Workspaces, Lerna, Typescript, Express, cors, Mongo, Storybook, Sass, CRA, etc.

Notifications You must be signed in to change notification settings

jcamden/merninator

Repository files navigation

The MERNinator

MERN monorepo boilerplate by Djinndex

NOTE: This README is out-of-date.

This repo is a(n evolving) template for how I like to do things. This README provides information about the structure of repository and root-level commands, and also some notes on my preferred standards and packages.

Workspace

Project-wide Specifications:

Terrifically Simple JSON [see also 1]

Tritypical Semantic Versioning:

  • Format Versioning (versions of API requests)[1, 2]
  • Entity Versioning (versions of API entities)[1, 2]
  • Historical Versioning (recovery (or undo) versions of API entities)[1, 3]

1. Designing Quality APIs (Cloud Next '18)
2. API design: Which version of versioning is right for you?
3. Historical Versions Explained

VSCode settings

See .vscode

Packages

@my-org/server

API Documentation [to-do: docs --> Github Pages]
Server Documentation

Note: you must specify a MongoURI in /src/db/db.ts

Specifications

GraphAPI-style architecture

  • nodes — basically individual objects, such as a User, a Project, a Page, or a Match
  • edges — connections between a collection of objects and a single object, such as Projects per User, Pages per Project, or Entries per page.
  • fields — data about an object, such as a Project's name or a Match's entry.

@my-org/lib:

Documentation

Specifications

Atomic web Design @my-app/lib/components

  • /atoms
  • /molecules
  • /organisms
  • /templates
  • /views (pages)

React UI Testing with Storybook
see especially:

@my-org/client:

create-react-app - jest-dom - react-testing-library [pss. obsolete vis-a-vis Storybook testing]

Documentation

Getting Started

Prerequisites:

Installing

First, update package names in all package.jsons and in all imports. Then, in the root directory, run

Yarn

If you need to change the names of the packages later. Delete your root directory node_modules, yarn.lock, and rerun

Yarn

Scripts

Root Directory Lerna Scripts

To run Storybook (@my-app/lib)

"story": "lerna run story --stream",

To build @my-app/lib:

"prestart": "lerna run libbuild --stream",

To build @my-app/lib and run @my-app/client and @my-app/server

"start": "lerna run start --stream",

Root Directory Single-package Script

Self-explanatory:

"server": "yarn workspace @merninator/server start",
"story": "yarn workspace @merninator/storybook storybook",
"test": "FORCE_COLOR=true lerna run lint && CI=true FORCE_COLOR=true lerna run test -- --coverage",
"client": "yarn workspace @merninator/client start",
"add:server": "npx [email protected] workspace @merninator/server add",
"add:lib": "npx [email protected] workspace @merninator/lib add",
"add:story": "npx [email protected] workspace @merninator/storybook add",
"add:client": "npx [email protected] workspace @merninator/client add",
"remove:server": "npx [email protected] workspace @merninator/server remove",
"remove:lib": "npx [email protected] workspace @merninator/lib remove",
"remove:client": "npx [email protected] workspace @merninator/client remove",
"apidoc": "yarn workspace @merninator/server apidoc",
"deploy": "FORCE_COLOR=true lerna run deploy"

To ignore pre-commit testing (including coverage) use --no-verify

git commit -m "TDD remains hypothetical" --no-verify

Deployment

I don't have any idea of how to deploy anything at all.

Contributing

Make a request.

Authors

License

MIT

Acknowledgments

God

Well, sir, there's nothing on earth

Like a genuine, bona fide

Electrified, five-package monorepo.

About

Node, Yarn Workspaces, Lerna, Typescript, Express, cors, Mongo, Storybook, Sass, CRA, etc.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published