This guide walks you through setting up a complete local development environment for StarkEd's three packages: contracts (Rust/Soroban), backend (Node/Express), and frontend (Next.js).
Install the following before you begin:
| Tool | Version | Notes |
|---|---|---|
| Node.js | v18+ | LTS recommended; CI runs on Node 18 |
| pnpm | latest | Workspace package manager (npm i -g pnpm) |
| Rust + Cargo | stable | Install via rustup |
| Stellar / Soroban CLI | latest | cargo install --locked stellar-cli |
| PostgreSQL | 15+ | Or MongoDB, depending on your config |
| Redis | 7+ | Caching and sessions |
| Git | latest | Version control |
You will also want a Stellar wallet such as Freighter for interacting with the frontend.
Add the WebAssembly target used by Soroban contracts:
rustup target add wasm32-unknown-unknown# Fork the repo on GitHub, then clone your fork
git clone https://github.com/<your-username>/starked-education.git
cd starked-education
# Add the upstream remote so you can sync later
git remote add upstream https://github.com/jobbykings/starked-education.git
# Install every workspace's dependencies and build contracts
pnpm install:allpnpm install:all installs the JavaScript workspaces and runs cargo build for the
contracts.
There are environment files at the repo root and in the backend:
cp .env.example .env
cp backend/.env.example backend/.envEdit each file with your local values. Key backend variables include:
DATABASE_URL— connection string for PostgreSQL (or your Mongo URI).REDIS_URL— e.g.redis://localhost:6379.JWT_SECRET— any sufficiently random string for local development.- IPFS and Stellar settings — see
backend/.env.examplefor the full list.
Make sure PostgreSQL and Redis are running locally (via your OS package manager, a service manager, or Docker):
# Example with Docker
docker run -d --name starked-postgres -e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=starked_dev -p 5432:5432 postgres:15
docker run -d --name starked-redis -p 6379:6379 redis:7From the repo root, run the backend and frontend together:
pnpm devThis uses concurrently to start dev:backend and dev:frontend.
cd backend
pnpm dev # nodemon + ts-node, hot reload on src/Useful backend scripts:
| Command | Description |
|---|---|
pnpm run build |
Compile TypeScript to dist/ |
pnpm run typecheck |
Type-check without emitting |
pnpm run lint |
Run ESLint |
pnpm run lint:fix |
Auto-fix lint issues |
pnpm test |
Run the Jest test suite |
cd frontend
pnpm dev # Next.js dev server at http://localhost:3000Useful frontend scripts:
| Command | Description |
|---|---|
pnpm run build |
Production build |
pnpm run type-check |
Type-check without emitting |
pnpm run lint |
Run Next.js / ESLint |
pnpm test |
Run the Jest test suite |
cd contracts
cargo build # debug build
cargo build --release # optimized build for deployment
cargo test # run contract tests
cargo fmt # format code
cargo clippy # lintTo run a local Stellar network and deploy contracts:
# Start a local standalone network
stellar standalone start
# Build and deploy (see scripts/ for project-specific helpers)
cd contracts
cargo build --releaseBefore starting work, confirm everything builds and passes:
# From the repo root
pnpm build
# Per-package checks
cd backend && pnpm run typecheck && pnpm test
cd ../frontend && pnpm run type-check && pnpm test
cd ../contracts && cargo testgit checkout main
git fetch upstream
git merge upstream/main
git push origin mainwasm32-unknown-unknowntarget missing — runrustup target add wasm32-unknown-unknown.- Backend cannot connect to the database/Redis — confirm the services are running and
that
DATABASE_URL/REDIS_URLinbackend/.envare correct. - Frontend build runs out of memory — increase the Node heap, e.g.
NODE_OPTIONS="--max-old-space-size=4096" pnpm run build(this is what CI uses). - Type errors after pulling — reinstall dependencies with
pnpm installin the affected workspace.
- Read ARCHITECTURE.md to understand how the packages fit together.
- Read TESTING.md before writing tests.
- Read ../CONTRIBUTING.md for the contribution workflow.