Local Setup
Get your development environment running
Prerequisites
- Node.js 20.x or later
- pnpm 9.x (
npm install -g pnpm) - Git with SSH access to the repo
- mkcert for HTTPS development (optional)
Installation
1. Clone the Repository
git clone git@github.com:positlabs/positlabs.git
cd positlabs
2. Install Dependencies
pnpm install
This installs all workspace dependencies including the web app and packages.
3. Environment Variables
cp .env.example .env
Edit .env with your credentials:
# AWS Cognito
COGNITO_USER_POOL_ID=us-east-1_xxxxxx
COGNITO_CLIENT_ID=xxxxxxxxxxxxxxxxxx
AWS_REGION=us-east-1
# Solana
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
# Optional
JUPITER_API_KEY=your-api-key
4. Start Development Server
pnpm dev
This starts the web app at http://localhost:3000
HTTPS Development
For testing OAuth or secure features locally:
1. Install mkcert
brew install mkcert
mkcert -install
2. Generate Certificates
cd apps/web
mkdir -p certs
mkcert -key-file certs/positlabs.local+3-key.pem -cert-file certs/positlabs.local+3.pem positlabs.local localhost 127.0.0.1 ::1
3. Add Host Entry
sudo echo "127.0.0.1 positlabs.local" >> /etc/hosts
4. Start HTTPS Server
pnpm dev:https
Access at https://positlabs.local:3000
Available Scripts
# Development
pnpm dev # Start dev server (HTTP)
pnpm dev:https # Start dev server (HTTPS)
# Build
pnpm build # Build all packages
pnpm typecheck # Run TypeScript checks
# Linting
pnpm lint # Run ESLint
Troubleshooting
WebSocket HMR Errors
With HTTPS, you may see WebSocket connection errors. Hot reload still works but requires manual page refresh. This is a known limitation with self-signed certificates.
Module Not Found
If you see module resolution errors, try:
pnpm install
pnpm build
Port Already in Use
lsof -i :3000
kill -9 <PID>
Need help? Check #dev-support on Slack or ask in the team chat.