Terrazzo is a modern web application designed to streamline project management and collaboration. It offers a suite of tools to help teams organize tasks, track progress, and communicate effectively.
Terrazzo is built entirely with Typescript in this monorepo, leveraging a modular architecture to ensure scalability and maintainability. The core components include:
- terrazzo-api: The main backend service that handles business logic and data management.
- terrazzo-common: Shared utilities and types used across different services.
- terrazzo-db: Database schema and migration scripts.
- terrazzo-ui: The frontend application built with React.
The API is built with Node.js, Express, and Socket.io. While there are a few REST endpoints, the primary mode of communication is through WebSockets, enabling first-class real-time features.
This package contains shared types, interfaces, and utility functions that are used across the API and UI, promoting code reuse and consistency. All shared logic that doesn't belong specifically to either the API or UI should be placed here and unit tested.
This package manages the database schema using the Sequelize ORM. It includes migration scripts to ensure the database structure is up-to-date with the application requirements.
The frontend is built with React and TypeScript, providing a responsive and user-friendly interface for managing projects. It communicates with the Terrazzo API primarily through WebSockets for real-time updates.
- The latest version of npm
- Node.js (version 22 higher. Use nvm to manage multiple versions)
- Docker and Docker Compose for redis (technically optional, but highly recommended)
-
Clone the repository:
git clone https://github.com/mosaiq-software/terrazzo.git cd terrazzo -
Install dependencies: This will install all necessary packages across the monorepo, and build the shared packages (
terrazzo-commonandterrazzo-db).npm i
-
Set up environment variables: Create a
.envfile in the root directory and populate it with the necessary environment variables. You can refer to the.env.examplefile or the .env doc for guidance.Make sure to set
VOLUME_PATHto an absolute path on your machine where the database files will be stored! -
Create the database:
npm run migrate:db
-
Start the development environment: Open 4 terminal windows/tabs, one for each of the following commands:
- Start the Redis server (Make sure Docker is running):
npm run redis:start
- Build the shared packages in watch mode:
npm run build-watch
- Start the Terrazzo API:
npm run start:api
- Start the Terrazzo UI:
npm run start:ui
You can also use
npm run startto start everything in a single terminal, but this is not recommended for development. - Start the Redis server (Make sure Docker is running):
-
Access the application: Open your web browser and navigate to
http://localhost:8080to access the Terrazzo UI.
- Modular Code: Keep code modular and reusable. Use the
terrazzo-commonpackage for shared utilities and types. - Type Safety: Leverage TypeScript's type system to ensure absolute type safety across the codebase. Never use type assertions (
askeyword) or unsafe types (any,unknown). - Real-Time First: Design features with real-time collaboration in mind. Use Socket.IO events for data synchronization.
- Data integrity: Always validate and sanitize data at both the API and UI layers to prevent inconsistencies and security vulnerabilities.
- Testing: Write unit tests for critical components and functionalities. Use the testing frameworks set up in the monorepo.
- Documentation: Keep documentation up-to-date. Use README files in each package to explain their purpose and usage.