Development Setup
Set up your development environment for contributing to Trial Submission Studio.
Prerequisites
Required
| Tool | Version | Purpose |
|---|---|---|
| Rust | 1.92+ | Programming language |
| Git | Any recent | Version control |
Optional
| Tool | Purpose |
|---|---|
| cargo-about | License generation |
| cargo-watch | Auto-rebuild on changes |
Step 1: Fork and Clone
Fork on GitHub
- Go to Trial Submission Studio
- Click “Fork” in the top right
- Select your account
Clone Your Fork
git clone https://github.com/YOUR_USERNAME/trial-submission-studio.git
cd trial-submission-studio
Add Upstream Remote
git remote add upstream https://github.com/rubentalstra/Trial-Submission-Studio.git
Step 2: Install Rust
Using rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Verify Installation
rustup show
Expected output should show Rust 1.92 or higher.
Install Required Toolchain
rustup toolchain install stable
rustup component add rustfmt clippy
Step 3: Platform Dependencies
macOS
No additional dependencies required.
Linux (Ubuntu/Debian)
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libxdo-dev
Windows
No additional dependencies required.
Step 4: Build the Project
Debug Build
cargo build
Release Build
cargo build --release
Check Build
cargo check
Step 5: Run the Application
cargo run --package tss-gui
Step 6: Run Tests
# All tests
cargo test
# Specific crate
cargo test --package xport
# With output
cargo test -- --nocapture
Step 7: Run Lints
# Format check
cargo fmt --check
# Apply formatting
cargo fmt
# Clippy lints
cargo clippy -- -D warnings
IDE Setup
RustRover / IntelliJ IDEA
- Open the project folder
- Rust plugin auto-detects workspace
- Configure run configuration for
tss-gui
VS Code
- Install
rust-analyzerextension - Open the project folder
- Extension auto-configures
Recommended VS Code Extensions
- rust-analyzer
- Even Better TOML
- Error Lens
- GitLens
Project Structure
trial-submission-studio/
├── Cargo.toml # Workspace config
├── crates/ # All crates
│ ├── tss-gui/ # Main application
│ ├── xport/ # XPT I/O
│ └── ... # Other crates
├── standards/ # Embedded CDISC data
├── mockdata/ # Test data
└── docs/ # Documentation
Development Workflow
Create Feature Branch
git checkout main
git pull upstream main
git checkout -b feature/my-feature
Make Changes
- Edit code
- Run tests:
cargo test - Run lints:
cargo clippy - Format:
cargo fmt
Commit Changes
git add .
git commit -m "feat: add my feature"
Push and Create PR
git push origin feature/my-feature
Then create PR on GitHub.
Useful Commands
| Command | Purpose |
|---|---|
cargo build | Build debug |
cargo build --release | Build release |
cargo test | Run all tests |
cargo test --package X | Test specific crate |
cargo clippy | Run linter |
cargo fmt | Format code |
cargo doc --open | Generate docs |
cargo run -p tss-gui | Run application |
Troubleshooting
Build Fails
- Ensure Rust 1.92+:
rustup update stable - Clean build:
cargo clean && cargo build - Check dependencies:
cargo fetch
Tests Fail
- Run with output:
cargo test -- --nocapture - Run specific test:
cargo test test_name - Check test data in
mockdata/
GUI Won’t Start
- Check platform dependencies installed
- Try release build:
cargo run --release -p tss-gui - Check logs for errors
Next Steps
- Coding Standards - Style guide
- Testing - Testing guide
- Architecture - Understand the codebase