Prerequisites
Before you begin, ensure you have the following installed on your system:Exchange Web requires Node.js 18 or higher as specified in the project’s engine requirements.
- Node.js: Version 18 or higher
- Yarn: Version 1.22.22 (specified as the package manager)
- Git: For cloning the repository
Clone the Repository
Understanding the Monorepo Structure
Exchange Web is organized as a Turborepo monorepo with the following structure:Key Components
-
apps/web: The main trading frontend application built with:
- React 18.3+
- Vite 5.4+ for build tooling
- TypeScript 5.5+
- TailwindCSS for styling
- React Router for routing
- Lightweight Charts for trading charts
-
packages/: Shared packages used across the monorepo
- Enables code reuse and consistent configuration
Running the Development Server
Start the dev server
From the root directory, run:The Turborepo command (
yarn dev) will start all development servers in the monorepo with optimized caching.Vite provides hot module replacement (HMR) out of the box, so your changes will be reflected instantly in the browser without a full page reload.
Available Scripts
From the root directory, you can run these Turborepo commands:| Script | Command | Description |
|---|---|---|
| Development | yarn dev | Start development servers for all apps |
| Build | yarn build | Build all apps and packages for production |
| Lint | yarn lint | Run ESLint across the entire monorepo |
| Format | yarn format | Format code with Prettier |
App-Specific Scripts (apps/web)
From theapps/web directory:
| Script | Command | Description |
|---|---|---|
| Development | yarn dev | Start Vite dev server |
| Build | yarn build | TypeScript compilation + Vite build |
| Preview | yarn preview | Preview production build locally |
| Lint | yarn lint | Run ESLint on the web app |
Development Workflow
- Make changes to your code in the
apps/web/srcdirectory - Hot reload automatically updates your browser
- Lint your code with
yarn lintbefore committing - Format your code with
yarn formatto maintain consistency
Turborepo Benefits
Turborepo provides several advantages for development:- Incremental builds: Only rebuilds what changed
- Remote caching: Share build caches across your team
- Parallel execution: Run tasks across workspaces in parallel
- Task pipelines: Automatic dependency ordering
turbo.json configuration defines task dependencies and caching strategies for optimal performance.
Next Steps
Now that your environment is set up, you can:- Learn about building for production
- Explore deployment options
- Review the codebase structure and start developing