Development
Guide to developing with Routstr
Development Guide
This guide covers how to set up and develop with Routstr, whether you’re building an application that uses Routstr, or contributing to Routstr itself.
Repository Structure
The Routstr project consists of several key components:
Development Environment
Prerequisites
- Node.js 19 or higher
- Docker (for containerized development)
- A Lightning wallet or node (for payment testing)
- Cashu mint (optional, for token payments)
Setting Up the Proxy
Setting Up the Frontend
Running Tests
We use Jest for JavaScript/TypeScript testing:
Working with the Protocol
The Routstr Improvement Proposals (RIPs) define the standards and protocols that make up the Routstr network:
- RIP-01: OpenAI-API Proxy with Cashu micropayments
- RIP-02: Nostr event announcements for inference nodes
- RIP-03: Web interface for browsing and filtering nodes
- RIP-04: Anonymous quality evaluations
- RIP-05: Smart clients with Tor/proxy routing
When developing for Routstr, refer to these specifications to ensure compatibility.
Local Development Network
For local development, you can set up a complete Routstr network locally:
Start a local Nostr relay
Start a local Cashu mint
Configure a local proxy
Create a config with the local relay and mint:
Run the proxy
Docker Deployment
For production deployment, use the official Docker image:
Contributing to Routstr
We welcome contributions to all aspects of the Routstr ecosystem:
- Fork the repository you want to contribute to
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Coding Standards
- We use TypeScript for type safety
- Follow the existing code style and include tests
- Documentation is required for new features
Building and Deploying
Building the Proxy
The built package will be in the dist
directory.
Building the Frontend
The built site will be in the out
directory.