Skip to content

safe-global/safe-wallet-monorepo

Repository files navigation

Safe{Wallet}

Safe{Wallet} monorepo

🌐 Safe{Wallet} web app ・ 📱 Safe{Wallet} mobile app

Overview

Welcome to the Safe{Wallet} monorepo! Safe (formerly Gnosis Safe) is a multi-signature smart contract wallet for Ethereum and other EVM chains, requiring multiple signatures to execute transactions.

This repository houses both web and mobile applications along with shared packages, managed under a unified structure using Yarn Workspaces. The monorepo setup simplifies dependency management and ensures consistent development practices across projects.

Key components

  • apps/web - Next.js web application
  • apps/mobile - Expo/React Native mobile application
  • packages/store - Shared Redux store used by both platforms
  • packages/utils - Shared utilities and TypeScript types
  • config/ - Shared configuration files

Getting started

To get started, ensure you have the required tools installed and follow these steps:

Prerequisites

  • Node.js: Install the latest stable version from Node.js.
  • Yarn: Use Yarn version 4.5.3 or later

to install it with the latest node version you can simply do

corepack enable

and then just run

yarn

This will install the required version of yarn and resolve all dependencies.

Note

Corepack is a tool to help with managing versions of your package managers. It exposes binary proxies for each supported package manager that, when called, will identify whatever package manager is configured for the current project, download it if needed, and finally run it.

Initial setup

  1. Clone the repository:
git clone <repo-url>
cd monorepo
  1. Install dependencies:
yarn install

Quick start commands

# Run web app in development mode
yarn workspace @safe-global/web dev

# Run mobile app in development mode
yarn workspace @safe-global/mobile start

# Run tests for web
yarn workspace @safe-global/web test

# Run Storybook for web
yarn workspace @safe-global/web storybook

Monorepo commands

Here are some essential commands to help you navigate the monorepo:

Workspace management

  • Run a script in a specific workspace:
yarn workspace <workspace-name> <script>

Example:

yarn workspace @safe-global/web dev
  • Add a dependency to a specific workspace:
yarn workspace <workspace-name> add <package-name>
  • Remove a dependency from a specific workspace:
yarn workspace <workspace-name> remove <package-name>

Note

Yarn treats commands that contain a colon as global commands. For example if you have a command in a workspace that has a colon and there isn't another workspace that has the same command, you can run the command without specifying the workspace name. For example:

yarn cypress:open

is equivalent to:

yarn workspace @safe-global/web cypress:open

Linting, formatting, and type-checking

  • Run ESLint across all workspaces:
yarn lint
  • Run Prettier to check formatting:
yarn prettier
  • Run type-check for a workspace:
yarn workspace @safe-global/web type-check
yarn workspace @safe-global/mobile type-check

Testing

  • Run unit tests across all workspaces:
yarn test
  • Run E2E tests (web only):
yarn workspace @safe-global/web cypress:open  # Interactive mode
yarn workspace @safe-global/web cypress:run   # Headless mode

Contributing

Adding a new workspace

  1. Create a new directory under apps/ or packages/.
  2. Add a package.json file with the appropriate configuration.
  3. Run:
yarn install

Best practices

  • Use Yarn Workspaces commands for managing dependencies.
  • Ensure type-check, lint, prettier, and tests pass before pushing changes.
  • Follow the semantic commit message guidelines.
  • For AI contributors, see AGENTS.md for detailed guidelines.

Tools & configurations

  • Husky: Pre-commit hooks for linting, formatting, and type-checking.
  • ESLint & Prettier: Enforce coding standards and formatting.
  • Jest: Unit testing framework.
  • Cypress: E2E testing for the web app.
  • Storybook: Component documentation and development for the web app.
  • Expo: Mobile app framework for the mobile workspace.
  • Next.js: React framework for the web workspace.
  • Tamagui: UI component library for the mobile app.

Release process

For information on releasing the web app, see the Automated Release Procedure.

Useful links


If you have any questions or run into issues, feel free to open a discussion or contact the maintainers. Happy coding! 🚀