Local Dev Setup
This guide walks you through setting up the Sema Link frontend app on your local machine.
Prerequisites
- Node.js 22+ — installed via Homebrew (
brew install node@22) - Git — with SSH access to the
Sema-LinkGitHub org - npm — comes with Node
Node.js PATH Issue
If npm is not found after installing Node via Homebrew, add this to your ~/.zshrc:
sh
export PATH="/usr/local/opt/node@22/bin:$PATH"Then run source ~/.zshrc.
1. Clone the Repo
sh
git clone git@github.com:Sema-Link/semalink-frontend.git
cd semalink-frontend2. Install Dependencies
sh
npm install3. Create Your Environment File
sh
cp .env.example .env.localOpen .env.local and fill in the values. For local development against mock data, you can leave the VITE_CF_ACCESS_* values as placeholders.
sh
VITE_API_BASE_URL=https://staging-arc.semalink.africa
VITE_CF_ACCESS_CLIENT_ID=your-client-id-here
VITE_CF_ACCESS_CLIENT_SECRET=your-client-secret-here
VITE_ENV=stagingSee Environment Variables for a full description of each variable.
4. Start the Dev Server
sh
npm run devThe app will be available at http://localhost:5173 (or the next available port if 5173 is in use).
Available Scripts
| Command | Description |
|---|---|
npm run dev | Start local dev server with hot reload |
npm run build | Type-check and build for production |
npm run preview | Preview the production build locally |
npm run test:unit | Run unit tests with Vitest |
npm run lint | Lint and auto-fix with ESLint + oxlint |
npm run format | Format source files with Prettier |