Building from Source
Relevant source files
The following files were used as context for generating this wiki page:This document provides instructions on how to build the Ever Traduora platform from the source code. The project is structured as a monorepo, containing separate packages for the backend API, the frontend web application, and the documentation website. Building from source is necessary for development, contributing to the project, or deploying in a custom environment.
The build process involves installing dependencies for all packages and then running build scripts that compile the code and prepare assets for deployment. The project utilizes Yarn Workspaces and Lerna to manage the monorepo structure and dependencies.
1. Prerequisites
Before building the project, you must have the following tools installed on your system. The required versions are specified in the project's configuration.
| Tool | Required Version | Source |
|---|---|---|
| Node.js | >=18.0.0 | package.json:110-113, api/package.json:138-141, webapp/package.json:100-103 |
| Yarn | >=1.13.0 | package.json:110-113, api/package.json:138-141, webapp/package.json:100-103 |
Sources: package.json:110-113
2. Project Structure
The repository is a monorepo managed with Yarn Workspaces and Lerna. It consists of three main packages located in the root directory.
Sources: lerna.json:9-10, package.json:102-108
The diagram below illustrates the high-level structure of the monorepo and its packages.
| Package | Description |
|---|---|
api | A NestJS application that serves the backend REST API. |
webapp | An Angular single-page application that provides the user interface. |
docs-website | A Docusaurus-based website for the project's official documentation. |
Sources: package.json:104-106
3. Build Process
The build process can be initiated from the root of the repository, which will build all packages concurrently.
3.1. Installing Dependencies
First, install all dependencies for all packages using Yarn. This command leverages Yarn Workspaces to hoist dependencies and link local packages.
# From the monorepo root
yarn bootstrap
This script is an alias for yarn install.
Sources: package.json:28
3.2. Building All Packages
To build the api, webapp, and docs-website packages simultaneously, run the build script from the root directory. This script uses concurrently to execute the individual build scripts for each package.
# From the monorepo root
yarn build
Sources: package.json:29
The following flowchart shows the sequence of commands executed by yarn build.
Sources: package.json:29-33
3.3. Building Individual Packages
You can also build each package individually.
API Build
The API is a TypeScript project. The build process compiles TypeScript files to JavaScript.
- Command:
yarn build(inside theapidirectory) oryarn build:api(from the root). - Action: Executes
tsc && copyfiles src/templates/**/* ../dist. This compiles the TypeScript source inapi/srcand copies email templates to thedistdirectory at the project root. - Output: The compiled backend code is placed in
dist/src.
Sources: api/package.json:28
Webapp Build
The webapp is an Angular project. The build process is managed by the Angular CLI.
- Command:
yarn build(inside thewebappdirectory) oryarn build:webapp(from the root). - Action: Executes
ng build. - Output: The compiled and bundled frontend assets are placed in
dist/public.
Sources: webapp/package.json:27, webapp/angular.json:15
4. Running the Application
After building, you can run the API and webapp locally for development.
| Script | Description | Source - |
|---|---|---|
start:api | Starts the NestJS API in development mode using nodemon, which automatically restarts the server on file changes. | package.json:35, api/package.json:27 - |
start:web | Starts the Angular development server using ng serve, which provides live reloading and opens the application in a browser. | package.json:34, webapp/package.json:25 - |
5. Database Seeding
The project includes scripts to seed the database with initial data, such as a default admin user. This is particularly useful for the first run after setting up the environment.
yarn seed: Runs all available seed scripts. This is controlled by theTR_SEED_DATA=trueenvironment variable.yarn seed:default: Seeds only the default admin user. This is useful when you want a clean instance without demo data. This script is triggered by setting bothTR_SEED_DATA=trueandTR_DEFAULT_SEED_ONLY=true.
These scripts are executed from the api package but can be conveniently run from the monorepo root.
Sources: README.md:120-121, package.json:40-41, api/package.json:37-38
The default admin credentials can be configured via environment variables:
| Variable | Default Value | Description |
|---|---|---|
TR_ADMIN_EMAIL | local.admin@ever.co | Admin user's email. |
TR_ADMIN_PASSWORD | sTr0ngP@ssw0rd!2025 | Admin user's password. |
TR_ADMIN_NAME | Admin | Admin user's display name. |
Sources: README.md:104-106
6. Testing
The api package contains scripts for running unit and end-to-end (e2e) tests.
| Script | Description - |
|---|---|
test | Runs Jest unit tests for the API. - |
test:e2e | Runs Jest end-to-end tests against the API, using a separate test database (tr_e2e). - |
test:ci | A script intended for Continuous Integration environments, which runs both unit and e2e tests. - |
Sources: api/package.json:32-35