Prerequisites
Before getting started with Skiff development, ensure you have the following installed:- Node.js: Version 20.9.0 or higher
- Yarn: Version 4.0.1 (managed via Corepack)
- Git: For version control
Initial Setup
Follow these steps to set up your local development environment:Clone the Repository
Fork and clone the Skiff repository to your local machine:Add the upstream remote to keep your fork synchronized:
Set Yarn Version
The project uses Yarn Berry (v4.0.1). Set the correct version:This ensures you’re using the Yarn version specified in the project’s
packageManager field.Install Dependencies
Install all workspace dependencies:This will install dependencies for all workspaces in the monorepo, including:
- Root dependencies
- Library packages in
libs/ - Application packages (
skemail-web,calendar-web, etc.)
Build Libraries
Before running any application, build the shared libraries:This command builds the libraries in the following order:
skiff-utilsskiff-mail-protosskiff-graphql@skiff-org/skiff-cryptoskiff-front-graphqlskiff-front-utils
Libraries must be built in topological order due to their dependencies on each other.
Running Individual Applications
The monorepo contains multiple applications. Here’s how to run each one:Skiff Mail (skemail-web)
http://localhost:4200/mail/inbox
Skiff Calendar (calendar-web)
http://localhost:4200/calendar
Development Scripts
Root-Level Scripts
| Script | Description |
|---|---|
yarn build:lib | Build all libraries in libs/ |
yarn dev | Run skemail-web in development mode |
Application-Level Scripts
Each application (skemail-web, calendar-web) has its own set of scripts:| Script | Description |
|---|---|
yarn dev | Start development server |
yarn build | Production build |
yarn test | Run tests |
yarn lint | Check code style with ESLint |
yarn lint:fix | Auto-fix linting issues |
yarn ts | Type-check without emitting files |
Common Development Tasks
Syncing Your Fork
Keep your local main branch up to date:Creating a Feature Branch
Cleaning Build Artifacts
If you encounter build issues, clean the build artifacts:Environment Configuration
Some applications use environment variables for configuration:- skemail-web: Uses
dotenvfor environment configuration - calendar-web: Uses
dotenvwith different configs for dev/production
Troubleshooting
Build Fails with Module Not Found
Build Fails with Module Not Found
Ensure you’ve built the libraries first:Libraries must be built before applications can use them.
Yarn Version Mismatch
Yarn Version Mismatch
The project requires Yarn 4.0.1. Reset the version:Check the version:
Port Already in Use
Port Already in Use
If port 4200 is already in use, you can:
- Stop the process using the port
- Modify the webpack dev server configuration to use a different port
Next Steps
Monorepo Structure
Learn about the workspace organization
Contributing
Read the contribution guidelines
Testing
Understand the testing setup