Skip to content

Commit

Permalink
Merge pull request #4 from brunotot/nx-workspace
Browse files Browse the repository at this point in the history
Nx workspace
  • Loading branch information
brunotot authored May 7, 2024
2 parents f4d83ed + 2058037 commit 56ab750
Show file tree
Hide file tree
Showing 29 changed files with 164 additions and 139 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
</p>

<p align="center">
<img alt="TypeScript badge" src="https://img.shields.io/badge/-TypeScript-black?style=for-the-badge&logoColor=white&logo=typescript&color=2F73BF">
<img alt="React badge" src="https://img.shields.io/badge/-React-black?style=for-the-badge&logo=react&color=23272F">
<img alt="Express badge" src="https://img.shields.io/badge/-Express-black?style=for-the-badge&logoColor=black&logo=express&color=F7DF1E">
<img alt="MongoDB badge" src="https://img.shields.io/badge/-MongoDB-black?style=for-the-badge&logoColor=white&logo=mongodb&color=127237">
<img alt="TypeScript badge" src="https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white">
<img alt="React badge" src="https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB">
<img alt="Express badge" src="https://img.shields.io/badge/Express-404D59?style=for-the-badge&logo=express">
<img alt="MongoDB badge" src="https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white">
</p>

TOC
Expand All @@ -18,17 +18,13 @@ TOC

## Understanding the repository name

**monorepo**

- A **monorepo** refers to a single repository containing multiple codebases that might otherwise be separated into individual repositories. This approach simplifies dependency management, streamlines workflows, and enhances collaboration across different parts of an application. Our repository utilizes this structure to centralize and unify the development process, ensuring consistency and ease of maintenance.

**mern**

- The **MERN** stack is a popular set of technologies (MongoDB, Express.js, React, and Node.js) used for full-stack development. This stack is known for its efficiency in building scalable and performance-oriented web applications. By employing the MERN stack, this repo provides a robust foundation for developing modern web applications with TypeScript, ensuring a seamless fullstack experience.

**railway**
**monorepo**

- **Railway** is a platform as a service (PaaS) that offers easy deployment, scaling, and infrastructure management for cloud applications. It's chosen for this project to simplify the deployment process and provide developers with a quick way to see their applications in production. Utilizing Railway, developers can focus more on code and less on configuring servers.
- A **monorepo** refers to a single repository containing multiple codebases that might otherwise be separated into individual repositories. This approach simplifies dependency management, streamlines workflows, and enhances collaboration across different parts of an application. Our repository utilizes this structure to centralize and unify the development process, ensuring consistency and ease of maintenance.

**starter**

Expand Down
14 changes: 8 additions & 6 deletions md/banner.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<p align="center">
<img src="https://github.com/brunotot/monorepo-mern-railway-starter/blob/main/md/assets/img/logo.png?raw=true" alt="logo"/>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/brunotot/monorepo-mern-railway-starter/blob/main/assets/img/logo-dark.svg?raw=true">
<img width="500px" alt="MERN Monorepo starter banner" src="https://github.com/brunotot/monorepo-mern-railway-starter/blob/main/assets/img/logo-light.svg?raw=true">
</picture>
</p>

<p align="center">
<img alt="TypeScript badge" src="https://img.shields.io/badge/-TypeScript-black?style=for-the-badge&logoColor=white&logo=typescript&color=2F73BF">
<img alt="React badge" src="https://img.shields.io/badge/-React-black?style=for-the-badge&logo=react&color=23272F">
<img alt="Express badge" src="https://img.shields.io/badge/-Express-black?style=for-the-badge&logoColor=black&logo=express&color=F7DF1E">
<img alt="MongoDB badge" src="https://img.shields.io/badge/-MongoDB-black?style=for-the-badge&logoColor=white&logo=mongodb&color=127237">
</a>
<img alt="TypeScript badge" src="https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white">
<img alt="React badge" src="https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB">
<img alt="Express badge" src="https://img.shields.io/badge/Express-404D59?style=for-the-badge&logo=express">
<img alt="MongoDB badge" src="https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white">
</p>
66 changes: 66 additions & 0 deletions md/dependencies/dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# backend

| Name | Version | Description |
| ------------------------- | ------------ | ----------------------------------------------------------------------------- |
| @org/shared | workspace:\* | Contains shared code, models, and types used by both the backend and frontend |
| @ts-rest/core | ^3.45.0 | Core library for building the TypeScript REST API in the backend |
| @ts-rest/express | ^3.45.0 | Integrates the @ts-rest/core library with Express.js in the backend |
| @ts-rest/open-api | ^3.45.0 | Generates OpenAPI documentation from the @ts-rest/core API in the backend |
| @tsvdec/core | ^2.0.11 | Provides core functionality for using TypeScript decorators in the backend |
| @tsvdec/decorators | ^1.0.7 | Collection of decorators used throughout the backend codebase |
| bcrypt | ^5.1.1 | Used for hashing and verifying user passwords in the backend |
| body-parser | ^1.20.2 | Parses incoming request bodies in the Express.js middleware in the backend |
| bottlejs | ^2.0.1 | Inversion of Control (IoC) container for dependency injection in the backend |
| compression | ^1.7.4 | Compresses responses to reduce data transfer in the backend |
| cookie-parser | ^1.4.6 | Parses cookie headers in incoming requests in the backend |
| cors | ^2.8.5 | Provides a middleware for enabling CORS in the Express.js app in the backend |
| cross-dirname | ^0.1.0 | Utility for getting the directory path of a file in the backend |
| dotenv | ^16.4.5 | Loads environment variables from .env files in the backend |
| express | ^4.18.2 | The web framework used for building the backend API |
| express-rate-limit | ^7.2.0 | Provides rate limiting to protect against brute force attacks in the backend |
| helmet | ^7.1.0 | Collection of security middleware for Express.js in the backend |
| hpp | ^0.2.3 | Protects against HTTP Parameter Pollution attacks in the backend |
| jsonwebtoken | ^9.0.2 | Used for generating and verifying JSON Web Tokens (JWT) in the backend |
| mongodb | ^6.5.0 | The official MongoDB driver for Node.js used in the backend |
| morgan | ^1.10.0 | HTTP request logger middleware for Express.js in the backend |
| swagger-jsdoc | ^6.2.8 | Generates OpenAPI documentation from JSDoc comments in the backend |
| swagger-ui-express | ^5.0.0 | Renders the Swagger UI for the OpenAPI documentation in the backend |
| winston | ^3.11.0 | Logging library used for application logging in the backend |
| winston-daily-rotate-file | ^5.0.0 | Winston transport for logging to a rotating file in the backend |
| zod | ^3.22.5 | TypeScript-first schema validation library used throughout the project |

# frontend

| Name | Version | Description |
| -------------------------------- | --------------- | ----------------------------------------------------------------------------------------------- |
| @emotion/react | ^11.11.4 | Used by Material-UI for styling React components in the frontend |
| @emotion/styled | ^11.11.0 | Used by Material-UI for styling React components in the frontend |
| @mui/icons-material | ^5.15.14 | Provides Material Design icons for use in the frontend UI |
| @mui/lab | 5.0.0-alpha.169 | Provides additional components and utilities from Material-UI for the frontend UI |
| @mui/material | ^5.15.14 | The core Material-UI library for building the frontend UI |
| @mui/styles | ^5.15.14 | Used by Material-UI for styling React components in the frontend |
| @mui/x-tree-view | ^7.0.0 | Provides a TreeView component from Material-UI for displaying hierarchical data in the frontend |
| @org/shared | workspace:\* | Contains shared code, models, and types used by both the backend and frontend |
| @preact/signals-react | ^2.0.1 | Provides a way to use Preact signals in React components for the frontend |
| @tanstack/react-query | ^5.32.1 | Used for data fetching and caching in the frontend React application |
| @ts-rest/core | ^3.45.0 | Core library for building the TypeScript REST API in the backend |
| @ts-rest/react-query | ^3.45.0 | Integrates @tanstack/react-query with the @ts-rest/core API for the frontend |
| axios | ^1.6.8 | Used for making HTTP requests in the frontend React application |
| i18next | ^23.10.1 | Provides internationalization (i18n) support for the frontend UI |
| i18next-browser-languagedetector | ^7.2.0 | Detects the user's language in the browser for i18n in the frontend |
| i18next-http-backend | ^2.5.0 | Loads translation files from the server for i18n in the frontend |
| material-ui-popup-state | ^5.1.0 | Provides a state management solution for popups and menus in the Material-UI frontend UI |
| react | ^18.2.0 | The core React library used for building the frontend UI |
| react-dom | ^18.2.0 | Provides DOM-specific methods for React in the frontend UI |
| react-i18next | ^14.1.0 | Integrates i18next with React for internationalization in the frontend UI |
| react-router-dom | ^6.22.3 | Provides routing functionality for the React frontend application |

# shared

| Name | Version | Description |
| -------------------- | ------- | ------------------------------------------------------------------------- |
| @anatine/zod-openapi | ^2.2.5 | Used for generating OpenAPI documentation from Zod schemas in the backend |
| @ts-rest/core | ^3.45.0 | Core library for building the TypeScript REST API in the backend |
| @ts-rest/open-api | ^3.45.0 | Generates OpenAPI documentation from the @ts-rest/core API in the backend |
| http-status | ^1.7.4 | Utility for working with HTTP status codes in the backend |
| zod | ^3.22.5 | TypeScript-first schema validation library used throughout the project |
1 change: 0 additions & 1 deletion md/dependencies/dependencyDescriptions.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"material-ui-popup-state": "Provides a state management solution for popups and menus in the Material-UI frontend UI",
"mongodb": "The official MongoDB driver for Node.js used in the backend",
"morgan": "HTTP request logger middleware for Express.js in the backend",
"openapi3-ts": "Used for generating TypeScript types from OpenAPI specifications in the backend",
"react": "The core React library used for building the frontend UI",
"react-dom": "Provides DOM-specific methods for React in the frontend UI",
"react-i18next": "Integrates i18next with React for internationalization in the frontend UI",
Expand Down
1 change: 0 additions & 1 deletion md/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
| jsonwebtoken | ^9.0.2 | Used for generating and verifying JSON Web Tokens (JWT) |
| mongodb | ^6.5.0 | The official MongoDB driver for Node.js |
| morgan | ^1.10.0 | HTTP request logger middleware for Express.js |
| openapi3-ts | ^4.3.1 | Used for generating TypeScript types from OpenAPI specifications |
| swagger-jsdoc | ^6.2.8 | Generates OpenAPI documentation from JSDoc comments |
| swagger-ui-express | ^5.0.0 | Renders the Swagger UI for the OpenAPI documentation |
| winston | ^3.11.0 | Logging library used for application logging |
Expand Down
8 changes: 2 additions & 6 deletions md/project-name-meaning.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
## Understanding the repository name

**monorepo**

- A **monorepo** refers to a single repository containing multiple codebases that might otherwise be separated into individual repositories. This approach simplifies dependency management, streamlines workflows, and enhances collaboration across different parts of an application. Our repository utilizes this structure to centralize and unify the development process, ensuring consistency and ease of maintenance.

**mern**

- The **MERN** stack is a popular set of technologies (MongoDB, Express.js, React, and Node.js) used for full-stack development. This stack is known for its efficiency in building scalable and performance-oriented web applications. By employing the MERN stack, this repo provides a robust foundation for developing modern web applications with TypeScript, ensuring a seamless fullstack experience.

**railway**
**monorepo**

- **Railway** is a platform as a service (PaaS) that offers easy deployment, scaling, and infrastructure management for cloud applications. It's chosen for this project to simplify the deployment process and provide developers with a quick way to see their applications in production. Utilizing Railway, developers can focus more on code and less on configuring servers.
- A **monorepo** refers to a single repository containing multiple codebases that might otherwise be separated into individual repositories. This approach simplifies dependency management, streamlines workflows, and enhances collaboration across different parts of an application. Our repository utilizes this structure to centralize and unify the development process, ensuring consistency and ease of maintenance.

**starter**

Expand Down
22 changes: 10 additions & 12 deletions md/scripts/output.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<p align="center">
<img src="https://github.com/brunotot/monorepo-mern-railway-starter/blob/main/md/assets/img/logo.png?raw=true" alt="logo"/>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/brunotot/monorepo-mern-railway-starter/blob/main/assets/img/logo-dark.svg?raw=true">
<img width="500px" alt="MERN Monorepo starter banner" src="https://github.com/brunotot/monorepo-mern-railway-starter/blob/main/assets/img/logo-light.svg?raw=true">
</picture>
</p>

<p align="center">
<img alt="TypeScript badge" src="https://img.shields.io/badge/-TypeScript-black?style=for-the-badge&logoColor=white&logo=typescript&color=2F73BF">
<img alt="React badge" src="https://img.shields.io/badge/-React-black?style=for-the-badge&logo=react&color=23272F">
<img alt="Express badge" src="https://img.shields.io/badge/-Express-black?style=for-the-badge&logoColor=black&logo=express&color=F7DF1E">
<img alt="MongoDB badge" src="https://img.shields.io/badge/-MongoDB-black?style=for-the-badge&logoColor=white&logo=mongodb&color=127237">
</a>
<img alt="TypeScript badge" src="https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white">
<img alt="React badge" src="https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB">
<img alt="Express badge" src="https://img.shields.io/badge/Express-404D59?style=for-the-badge&logo=express">
<img alt="MongoDB badge" src="https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white">
</p>

TOC
Expand All @@ -16,17 +18,13 @@ TOC

## Understanding the repository name

**monorepo**

- A **monorepo** refers to a single repository containing multiple codebases that might otherwise be separated into individual repositories. This approach simplifies dependency management, streamlines workflows, and enhances collaboration across different parts of an application. Our repository utilizes this structure to centralize and unify the development process, ensuring consistency and ease of maintenance.

**mern**

- The **MERN** stack is a popular set of technologies (MongoDB, Express.js, React, and Node.js) used for full-stack development. This stack is known for its efficiency in building scalable and performance-oriented web applications. By employing the MERN stack, this repo provides a robust foundation for developing modern web applications with TypeScript, ensuring a seamless fullstack experience.

**railway**
**monorepo**

- **Railway** is a platform as a service (PaaS) that offers easy deployment, scaling, and infrastructure management for cloud applications. It's chosen for this project to simplify the deployment process and provide developers with a quick way to see their applications in production. Utilizing Railway, developers can focus more on code and less on configuring servers.
- A **monorepo** refers to a single repository containing multiple codebases that might otherwise be separated into individual repositories. This approach simplifies dependency management, streamlines workflows, and enhances collaboration across different parts of an application. Our repository utilizes this structure to centralize and unify the development process, ensuring consistency and ease of maintenance.

**starter**

Expand Down
9 changes: 3 additions & 6 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
"scripts": {
"build": "rm -rf dist && npm run compile:ts",
"compile:ts": "tsc && npm run tsc-alias",
"start": "export PACKAGE_JSON_VERSION=$(grep -o '\"version\": *\"[^\"]*\"' package.json | awk -F'\"' '{print $4}') && node --no-warnings --loader ts-node/esm --experimental-specifier-resolution=node ./dist/backend/src/main.js",
"tsc-alias": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json"
"start": "export PACKAGE_JSON_VERSION=$(grep -o '\"version\": *\"[^\"]*\"' package.json | awk -F'\"' '{print $4}') && node --no-warnings --loader ts-node/esm --experimental-specifier-resolution=node ./dist/main.js",
"tsc-alias": "tsc-alias -p tsconfig.json"
},
"keywords": [],
"author": "Bruno Tot",
"license": "MIT",
"dependencies": {
"@anatine/zod-openapi": "^2.2.5",
"@org/shared": "file:../shared/src",
"@org/shared": "workspace:*",
"@ts-rest/core": "^3.45.0",
"@ts-rest/express": "^3.45.0",
"@ts-rest/open-api": "^3.45.0",
Expand All @@ -33,11 +32,9 @@
"express-rate-limit": "^7.2.0",
"helmet": "^7.1.0",
"hpp": "^0.2.3",
"http-status": "^1.7.4",
"jsonwebtoken": "^9.0.2",
"mongodb": "^6.5.0",
"morgan": "^1.10.0",
"openapi3-ts": "^4.3.1",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.0",
"winston": "^3.11.0",
Expand Down
Loading

0 comments on commit 56ab750

Please sign in to comment.