Local Development
Set up Portr for local development and contribution
This guide covers how to set up Portr for local development, whether you want to contribute to the project or modify it for your needs.
Architecture Overview
Portr consists of several components:
- Admin Server: Python/FastAPI backend with Svelte frontend
- Tunnel Server: Go-based SSH and proxy server
- Client: Go-based CLI tool for creating tunnels
Development Setup
Admin Setup
Set up the admin dashboard for local development.
Tunnel Server Setup
Run the tunnel server locally for development.
Client Setup
Build and test the Portr client locally.
Prerequisites
Before you begin, ensure you have the following installed:
- Python 3.11+ with rye (0.43.0+)
- Go 1.23+
- Node.js 20+
- pnpm 9.15.0+
- PostgreSQL 16+
Quick Start
The recommended development approach is to start all components in the following order: database → admin server → tunnel server → client.
1. Clone the repository
git clone https://github.com/amalshaji/portr.git
cd portr
2. Set up the database
Start a PostgreSQL instance locally or use Docker:
docker run --name portr-postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres:16
3. Start development servers
Follow the individual setup guides for each component to get everything running locally.
Contributing
We welcome contributions! Here's how to get started:
- Fork the repository on GitHub
- Create a feature branch for your changes
- Set up the development environment using the guides above
- Make your changes and test them thoroughly
- Submit a pull request with a clear description of your changes
Development Workflow
Making Changes
- Start all required services locally
- Make your changes to the relevant component
- Test your changes thoroughly
- Ensure all tests pass
- Update documentation if needed
Testing
Each component has its own test suite. Run tests before submitting changes:
# Admin tests (from admin/ directory)
make test
# Tunnel server tests (from tunnel/ directory)
make test
# Client tests (from tunnel/ directory)
make test-cli