This project hosted at https://smo.data-unknown.com
- Description
- Features
- Installation
- Environment variables
- Contributing
- License
- Authors
- Acknowledgments
This is a project that aims to provide an optimalized and feature rich online map for the game Simrail.
- Signal display
- Delay tracking
- Train schedule display
- Train route display
- Clone the repository with
git clone https://github.com/GNimrodG/simrail-map-optimized.gitor download the repository as a zip file
- Navigate to the
smo-frontenddirectory - Run
yarn installto install the dependencies - Run
yarn devto start the development server - Open
http://localhost:5173/in your browser (by default when running in development mode the frontend will try to use the backend running onhttp://localhost:3000/)
To run the backend you need a PostGIS database running, you can use an external one or you can use the docker-compose.yml file to run one locally in Docker. (You need comment out the webserver part in the docker-compose.yml file to avoid port conflicts.)
- Navigate to the
smo-backenddirectory - Make sure you have the .NET 9.0 SDK installed
- Configure your connection string and other settings either in:
appsettings.Development.jsonfor local development- Environment variables (especially for production deployment)
- .NET User Secrets for local development (
dotnet user-secrets set "ConnectionStrings:DefaultConnection" "your-connection-string")
- Run
dotnet restoreto restore the required packages - Run
dotnet runto start the development server - The backend server will be running on
http://localhost:3000/
You can also open the solution in Visual Studio 2022 or JetBrains Rider for a more integrated development experience.
Backend supports configuring behavior via environment variables (values in parentheses are defaults).
Core and hosting
DATABASE_URL: PostgreSQL connection string (overridesConnectionStrings:DefaultConnection)FRONTEND_URL: CORS origin for the frontend (https://smo.data-unknown.com)ASPNETCORE_ENVIRONMENT: Standard .NET environment (Development/Production)ADMIN_PASSWORD: Enables protected admin endpoints when setSTEAM_API_KEY: Optional Steam API key for player stats ("")
Performance and memory
DB_CONTEXT_POOL_SIZE: EF Core DbContext pool size (32)EF_MEMORY_CACHE_SIZE_MB: EF internal memory cache size in MB (64)
Service polling intervals
{SERVICE}_REFRESH_INTERVAL: Polling interval per service. Accepts TimeSpan (e.g.00:00:05) or seconds (e.g.5). Services:SERVER_REFRESH_INTERVAL(default00:00:30)TRAIN_REFRESH_INTERVAL(default00:00:05)TRAIN-POS_REFRESH_INTERVAL(default00:00:01)TIMETABLE_REFRESH_INTERVAL(default01:00:00= 1 hour)TIME_REFRESH_INTERVAL(default00:05:00= 5 minutes)STATION_REFRESH_INTERVAL(default00:00:05)
Signal analyzer
SIGNAL_BUFFER_DISTANCE_BETWEEN: Extra buffer (meters) in movement validation (50)SIGNAL_MIN_DISTANCE_BETWEEN: Min distance between signals (meters) (200)SIGNAL_MIN_DISTANCE: Distance threshold to treat a train as at a signal (meters) (100)TRAIN_CACHE_MAX_ENTRIES: Capacity of in-memory train->last-signal cache (-1= unlimited)TRAIN_PASSED_CACHE_MAX_ENTRIES: Capacity of passed-signal cache (-1= unlimited)TRAIN_PREV_CACHE_MAX_ENTRIES: Capacity of prev-signal data cache (-1= unlimited)
Station analyzer
STATION_ANALYZER_DISABLED: Disable the station analyzer (false)STATION_ANALYZER_QUEUE_MAX: Max queued station tasks (-1= unlimited)
Route point analyzer
ROUTE_POINT_ANALYZER_DISABLED: Disable the route point analyzer (false)ROUTE_POINT_ANALYZER_ALLOWED_SERVERS: Comma-separated whitelist of server codes (empty = all)ROUTE_POINT_CLEANUP_INTERVAL_HOURS: Hours before old route lines are removed (72= 3 days)ROUTE_POINT_MAX_BATCH_SIZE: Batch size for DB inserts (500)ROUTE_POINT_MAX_CONCURRENCY: Parallelism for processing (min(4, 2x CPU))ROUTE_POINT_MIN_DISTANCE_METERS: Min distance between points on a route (100.0)
Notes
- All
{SERVICE}_REFRESH_INTERVALvalues can be specified as "HH:MM:SS" or as integer seconds. - When
DATABASE_URLis not set,ConnectionStrings:DefaultConnectionfrom appsettings is used. FRONTEND_URLaugments the built-in localhost origins in development.
The backend uses Entity Framework Core for database access. To apply migrations:
- Make sure your database connection string is correctly configured
- Run
dotnet ef database updateto apply all pending migrations
- Fork the repository
- Create a new branch
- Make your changes (please follow the formatting of the existing code, this project uses Prettier for frontend and standard C# formatting for backend)
- Create a pull request
This project is licensed under the AGPL-3.0 license - see the LICENSE file for details
- Nimród Glöckl - gnimrodg
SMO is inspired by the SimRail railway simulator and aims to enhance the experience of players. Thanks to the SimRail community for their support and feedback.
Please note that this project is not officially affiliated with or endorsed by SimRail or its developers.