Welcome to our project! This document will guide you through setting up your development environment and getting started with our monorepo architecture. We've designed our setup process to be straightforward and consistent across team members, prioritizing reproducible development environments.
Our project utilizes a modern JavaScript/TypeScript development stack:
- Nx: Our monorepo management tool that helps us maintain multiple projects in a single repository.
- Bun: A fast all-in-one JavaScript runtime and toolchain.
- PNPM: Our package manager, configured with workspaces for optimal monorepo dependency management.
- Proto (recommended): A unified tool manager that ensures consistent development environments.
We recommend using Proto for managing development tools, as it ensures consistent development environments across the team. Proto will automatically handle the installation and management of all required tools based on our project configuration.
-
Install Proto by following the official installation guide: Proto Installation Guide
-
Initialize your development environment:
proto use
This command will automatically install all necessary dependencies specified in
.prototools
, including the correct versions of Node.js, Bun, and PNPM. -
Install project dependencies:
pnpm install
-
To upgrade tooling when necessary:
proto upgrade proto use
If you choose not to use Proto, you'll need to manually install the required tools. Check the versions specified in .prototools
for:
After installing the required tools, run pnpm install
in the project root.
Note: For platform-specific installation details, refer to the respective tool documentation.
Our monorepo is organized into two main directories:
├── apps/ # Application projects - standalone deployable applications
├── libs/ # Shared libraries - reusable code consumed by apps
├── nx.json # Nx configuration
└── pnpm-workspace.yaml # PNPM workspace configuration
To visualize the project structure and dependencies, use:
bunx nx show project [PROJECT] --web
We use Nx to manage our monorepo, which provides powerful tools for building and testing our applications.
bunx nx [COMMAND] [PROJECT]
To start the development server for backend:
bunx nx dev backend
To build a project:
bunx nx build backend
If you need to run one command (e.g. typecheck) over more projects use:
bunx nx run-many --target=typecheck --all
Need more detailed output? Add the --verbose
flag:
bunx nx dev backend --verbose
If you encounter any issues during setup:
-
Ensure all prerequisites are properly installed:
- If using Proto, verify it's correctly installed and try running
proto use
again. - For manual setup, check that your tool versions match those in
.prototools
.
- If using Proto, verify it's correctly installed and try running
-
Try cleaning and reinstalling dependencies:
- Remove the
node_modules
directory. - Delete the PNPM lock file.
- Run
pnpm install
again.
- Remove the
-
For Nx command issues:
- Use the
--verbose
flag to get detailed output. - Ensure you're running commands from the project root.
- Verify the project name is correct.
- Use the
-
Check common environment issues:
- Ensure you have sufficient disk space.
- Verify you have necessary permissions.
- Address conflicting global installations.
This project is licensed under the Fair Source License (FSL). See LICENSE.md for details.