Skip to content

TraxSharp/Trax.Samples

Repository files navigation

Trax.Samples

Build NuGet Version NuGet Downloads .NET License: MIT Last Commit codecov Docs

Sample applications and a dotnet new project template for getting started with Trax.

The Trax Stack

Trax is a layered framework split across several repos. You can stop at whatever layer solves your problem. You are here: Trax.Samples.

Repo Adds
Trax.Core Pipelines, junctions, railway error propagation
Trax.Effect Execution logging, DI, pluggable storage
Trax.Mediator Decoupled dispatch via TrainBus
Trax.Scheduler Cron schedules, retries, dead-letter queues
Trax.Api GraphQL API for remote access
Trax.Dashboard Blazor monitoring UI
Trax.Cli trax-cli project scaffolding tool
Trax.Samples Sample apps and a dotnet new template

Full documentation: traxsharp.net/docs.

Project Template

Scaffold a new Trax server with the control room, timetable, and PostgreSQL persistence already wired up:

dotnet new install Trax.Samples.Templates
dotnet new trax-server -n MyApp

With a custom connection string:

dotnet new trax-server -n MyApp --ConnectionString "Host=db.example.com;Port=5432;Database=myapp;Username=myuser;Password=secret"

The template creates an ASP.NET Core project with:

  • AddTrax configured with AddEffects (Postgres, junction logging, junction progress), AddMediator, and AddScheduler
  • AddTraxDashboard for the control room
  • AddScheduler with a sample HelloWorldTrain departing every 20 seconds
  • A Trains/ directory with an example train, cargo type, interface, and stop

Sample Applications

Scheduler Sample

A full working example of the Trax scheduler with ETL-style pipelines, fleet scheduling, connected departures, dormant trains, and journey log cleanup.

Running it:

# Start PostgreSQL
cd Trax.Samples
docker compose up -d

# Run the sample
dotnet run --project samples/Trax.Samples.Scheduler

Then open http://localhost:5298/trax to see the control room.

The sample includes:

  • HelloWorldTrain — a simple scheduled train that logs a greeting every 20 seconds
  • ExtractImportTrain — a multi-stop ETL train with 10 parallel manifests departing every 5 minutes
  • TransformLoadTrain — a connected departure that runs after extract arrives
  • DataQualityCheckTrain — a dormant train waiting in the yard, activated from a junction when anomalies are detected
  • Journey log cleanup configuration for the HelloWorld train

Flowthru Spaceflights

A data pipeline sample using the Flowthru project conventions, demonstrating Trax trains in an ML-style pipeline context.

License

MIT

Trademark & Brand Notice

Trax is an open-source .NET framework provided by TraxSharp. This project is an independent community effort and is not affiliated with, sponsored by, or endorsed by the Utah Transit Authority, Trax Retail, or any other entity using the "Trax" name in other industries.

About

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors