Prerequisites
Before you begin, ensure you have the following installed:Required Software
| Software | Version | Purpose |
|---|---|---|
| Node.js | 18+ | Frontend and backend runtime |
| npm or yarn | Latest | Package management |
| Git | Latest | Version control |
| Leo CLI | Latest | Aleo smart contract development |
Optional but Recommended
- VS Code with TypeScript extension
- Aleo Wallet (Leo Wallet or Shield Wallet)
- Postman or curl for API testing
Installation Steps
Install Node.js
Download and install Node.js 18+ from nodejs.org
Install Leo CLI (for contract development)
Install the Leo programming language CLI:
Only required if you plan to work on smart contracts. Frontend/backend developers can skip this.
Install Backend Dependencies
@provablehq/sdk- Aleo blockchain SDKexpress- Web server frameworkcors- Cross-origin resource sharingdotenv- Environment configuration
Install Frontend Dependencies
react&react-dom- UI framework@provablehq/aleo-wallet-adaptor-*- Wallet integrationvite- Build tool and dev servertypescript- Type safetytailwindcss- Styling
Development Workflows
Frontend Development
- HMR: Changes auto-reload without full page refresh
- Port: Default is 5173, configurable in
vite.config.ts - TypeScript: Errors show in terminal and browser
- Network Access: Use
--hostflag for mobile testing
Backend Development
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/health | Health check |
| POST | /api/wallet/connect | Connect with private key |
| POST | /api/wallet/generate | Generate new account |
| GET | /api/wallet/balance/:sessionId | Get wallet balance |
| POST | /api/records/create | Create medical record |
| GET | /api/records/fetch/:sessionId | Fetch user records |
| POST | /api/access/grant | Grant doctor access |
Smart Contract Development
Full Stack Development
To run the complete application:Development with Demo Mode
For testing without blockchain transactions:- All UI features function normally
- Records stored in localStorage
- Access grants simulated
- QR code generation/scanning
- Wallet connection flow
- No real blockchain transactions
- Records don’t persist across devices
- No actual on-chain verification
- Perfect for UI/UX development
Common Development Tasks
Adding a New Frontend Component
Adding a New Backend Endpoint
Adding a New Contract Transition
Troubleshooting
Backend Issues
Cannot connect to backend
Cannot connect to backend
Symptoms: Frontend shows connection errorsSolutions:
- Ensure backend is running on port 3001
- Check
VITE_API_URLin frontend.env - Verify no firewall blocking port 3001
- Check backend console for startup errors
Invalid private key error
Invalid private key error
Symptoms: Wallet connection failsSolutions:
- Private key must start with
APrivateKey1... - Must be exactly 59 characters
- Use “Generate New” to create test account
- Export key from Leo/Shield Wallet if using existing account
Module not found errors
Module not found errors
Symptoms: Import errors in backendSolutions:
Frontend Issues
TypeScript errors
TypeScript errors
Symptoms: Type errors in terminal/browserSolutions:
- Check
tsconfig.jsonconfiguration - Ensure all dependencies are installed
- Restart TypeScript server in VS Code
- Run
npm run buildto see all errors
Vite build fails
Vite build fails
Symptoms: Build errors during
npm run buildSolutions:Wallet adapter errors
Wallet adapter errors
Symptoms: Wallet connection issuesSolutions:
- Clear browser cache and localStorage
- Check wallet extension is installed
- Verify wallet adapter dependencies versions match
- Try different wallet (Leo vs Shield)
Contract Issues
Leo build fails
Leo build fails
Symptoms: Compilation errorsSolutions:
- Check Leo version:
leo --version - Ensure syntax matches Leo 2.x
- Run
leo cleanthenleo build - Check for syntax errors in
main.leo
Tests failing
Tests failing
Symptoms:
leo test shows failuresSolutions:- Read test output carefully
- Check test assertions in
tests/directory - Verify contract logic matches test expectations
- Run individual tests for debugging
Development Tools
Recommended VS Code Extensions
- TypeScript: Built-in, enable suggestions
- ESLint: JavaScript/TypeScript linting
- Tailwind CSS IntelliSense: CSS class autocomplete
- Leo: Syntax highlighting for Leo files (if available)
Browser DevTools
For Frontend Debugging:- Console: View errors and logs
- Network: Monitor API calls
- Application: Inspect localStorage (demo mode)
- React DevTools: Component inspection
API Testing Tools
Test Backend Endpoints:- curl: Command-line requests
- Postman: GUI for API testing
- Thunder Client: VS Code extension
Next Steps
Testing Guide
Learn how to run tests and ensure code quality
Contributing
Submit your first contribution
Architecture
Understand the system architecture
API Reference
Explore the API documentation