Getting Started
Relevant source files
The following files were used as context for generating this wiki page:
This guide provides instructions for setting up, building, and running the Ever® Demand™ platform. Ever® Demand™ is an open-source, real-time, and reactive platform for collaborative, on-demand, and sharing economies. It is built as a full-stack TypeScript monorepo, featuring a headless commerce framework with a NestJS backend and multiple frontend applications built with frameworks like Angular, Ionic, React Native, and Flutter.
The project uses Lerna to manage its monorepo structure, which includes a core API server and various client applications for administration, shopping, merchants, and carriers. This guide covers the necessary prerequisites, installation steps, and commands to get the entire platform operational on a local development machine. For more specific details on individual packages, refer to the README.md file within each package's directory.
Sources: README.md:14-18, README.md:46-63, package.json:2-5, 212-223
Prerequisites
Before you begin, ensure you have the following software installed on your system.
| Tool | Required Version | Notes | Source |
|---|---|---|---|
| Node.js | >=14.4.0 | The runtime environment for the platform. | [package.json:225](https://github.com/ever-co/ever-demand/blob/HEAD/package.json#L225), [packages/shop-mobile-expo/README.md:46](https://github.com/ever-co/ever-demand/blob/HEAD/packages/shop-mobile-expo/README.md#L46) |
| Yarn | >=1.13.0 | The required package manager for this project. npm is not used for dependency management. | [README.md:120-123](https://github.com/ever-co/ever-demand/blob/HEAD/README.md#L120-L123), [package.json:226](https://github.com/ever-co/ever-demand/blob/HEAD/package.json#L226) |
| Git | Latest | For cloning the repository. | [README.md:108-110](https://github.com/ever-co/ever-demand/blob/HEAD/README.md#L108-L110) |
| MongoDB | >= 3.2 | The default database. The platform assumes a service is running on localhost:27017. | [README.md:60, 154-156](https://github.com/ever-co/ever-demand/blob/HEAD/README.md#L60), [packages/core/README.md:13](https://github.com/ever-co/ever-demand/blob/HEAD/packages/core/README.md#L13) |
Monorepo Management
The project is a monorepo managed by Lerna. Lerna is used to manage dependencies and run scripts across the multiple packages within the packages/ directory. The configuration for workspaces is defined in the root package.json.
Sources: README.md:136-138, package.json:212-223, lerna.json
Installation and Setup
The following diagram illustrates the high-level workflow for getting the platform running.
This diagram shows the sequence of commands from cloning the repository to running the applications.
Sources: README.md:108-110, 126-129, 132-134, 162-171, package.json:25, 30, 42
1. Clone the Repository
First, clone the ever-demand repository from GitHub. The develop branch contains the latest, unstable code, while master is more stable.
For the latest development version:
git clone --branch develop https://github.com/ever-co/ever-demand.git
For the stable master branch:
git clone --branch master https://github.com/ever-co/ever-demand.git
Sources: README.md:108-116
2. Install Dependencies
The project uses Yarn for package management. After cloning, navigate into the project directory and run the bootstrap command. This command installs lerna and then uses it to install all dependencies for every package in the monorepo.
cd ever-demand
yarn bootstrap
This command is a shortcut defined in package.json that runs yarn install followed by yarn lerna bootstrap.
Sources: README.md:120-129, package.json:25
3. Database Setup
The platform is configured to use MongoDB by default. Ensure you have a MongoDB instance running and accessible on localhost:27017. On the first run, the API server will automatically create a database named ever_development and seed it with a default admin user.
Default Admin Credentials:
- Email:
admin@ever.co - Password:
admin
Sources: README.md:154-156, packages/core/README.md:175-181
Building the Platform
You can build all packages within the monorepo using a single command. This script first builds shared common modules and then proceeds to build all other applications like the API server, admin UI, and shop UIs.
yarn build:all
This command executes a series of build scripts defined in the root package.json.
Sources: README.md:132-134, package.json:42
The build process follows a dependency order, as shown below:
This diagram shows that the common and common-angular packages must be built before the applications that depend on them.
Sources: package.json:36-42
Running the Applications
After a successful build, you can run each part of the platform using the yarn run:* scripts from the root directory. Each application will start on a different port.
| Command | Application | Default URL |
|---|---|---|
yarn run:server | API Server (Core) | (API only) |
yarn run:server:dev | API Server (with watch) | (API only) |
yarn run:admin | Admin Website (Angular) | http://localhost:4200 |
yarn run:shopmobile | Shopping Mobile App (Ionic) | http://localhost:4201 |
yarn run:merchant | Merchant Tablet App (Ionic) | http://localhost:4202 |
yarn run:carrier | Carrier Mobile App (Ionic) | http://localhost:4203 |
yarn run:shopweb | Shopping Website (Angular) | http://localhost:3000 |
yarn run:shopexpo | Shopping Mobile App (Expo) | (Expo Dev Server) |
Sources: README.md:162-171, package.json:30-35
For example, to start the API server and the Angular-based admin website, you would run the following commands in separate terminal sessions:
# Terminal 1: Start the API server
yarn run:server
# Terminal 2: Start the Admin Website
yarn run:admin
The API server must be running for the client applications to function correctly. For development, using yarn run:server:dev is recommended as it enables hot-reloading on file changes.
Sources: README.md:174, package.json:31