https://github.com/maksimr/npm-monorepo-example
https://github.com/maksimr/npm-monorepo-example
microservices monorepo nodejs npm-workspaces typescript
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/maksimr/npm-monorepo-example
- Owner: maksimr
- Created: 2024-02-11T19:35:42.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-10T20:55:09.000Z (5 months ago)
- Last Synced: 2026-01-10T23:43:33.562Z (5 months ago)
- Topics: microservices, monorepo, nodejs, npm-workspaces, typescript
- Language: Shell
- Homepage:
- Size: 55.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# npm monorepo template
[](https://codespaces.new/maksimr/npm-monorepo-example?quickstart=1)
This is a template for a monorepo using NPM workspaces, Docker and TypeScript. This describes how to build, develop, deploy and test the nodejs services
## ποΈ Build
Before building the project, you need to install the dependencies. You can do this by running the following command:
```bash
npm ci
```
To build specific packages, you can use the following command:
```bash
npm run build -w
```
If you want to build all packages, you can use the following command:
```bash
npm run build --workspaces --if-present
```
## π₯οΈ Development
To run the service, you can use the following command:
```bash
npm run dev -w
```
If you want to rebuild a service when a service's files change,
you can use the following after running the `dev` command:
```bash
npm run build --watch -w
```
## π Deployment
### π³ Docker
To deploy the service, you can use the following command:
```bash
docker compose up foo1 --force-recreate --build
```
To stop the service, you can use the following command:
```bash
docker compose down
```
### βΈοΈ Kubernetes
To deploy all services, you can use the following command:
```bash
./scripts/minikube/deploy.sh
```
To deploy specific services, you can use the following command:
```bash
./scripts/minikube/deploy.sh ...
```
## π§ͺ Test
To run the all tests, you can use the following command:
```bash
npm run test:all -w
```