Installation & Setup
Installation & Setup
Section titled “Installation & Setup”Prerequisites
Section titled “Prerequisites”Before starting, ensure you have:
- .NET SDK (supports .NET 8.0, 9.0, and 10.0+)
- PostgreSQL database (for persistent event store)
- dbmate (optional, but highly recommended for migration management)
Installing the NuGet Package
Section titled “Installing the NuGet Package”Add the NuGet package Sharpino to your project:
dotnet add package SharpinoProject Template Installation
Section titled “Project Template Installation”You can bootstrap a project quickly using the official dotnet templates:
# Install the templatesdotnet new install Sharpino.Templates
# Create a new projectdotnet new sharpinoThis sets up a minimal project template including a docker-compose configuration for PostgreSQL.
Database Configuration
Section titled “Database Configuration”- dbmate templates: Sharpino samples use
dbmatetemplates to configure PostgreSQL tables for event and snapshot storage. - Environment Variables: Set up a
.envfile in your project root containing the database connection URL:DATABASE_URL=postgres://username:password@localhost:5432/db_name?sslmode=disable - Run Migrations: Run the migration tool:
Terminal window dbmate up
Note that the template already contains a Docker-ready PostgreSQL database, so you can simply run:
docker-compose up -ddbmate updotnet runRunning Tests
Section titled “Running Tests”If you clone the entire project from GitHub, you will need to configure a .env file for each project.
Once the database and environment variables are configured, you can run all tests for a specific sample folder (e.g., Sharpino.Sample.12) using:
runTests.shTo run a single project, navigate to its test folder, configure the .env file, and execute:
dotnet testRabbitMQ Integration (Optional)
Section titled “RabbitMQ Integration (Optional)”Some examples support RabbitMQ integration. Make sure RabbitMQ is running (e.g., via rabbitmq-server), then run the project with:
dotnet run --configuration:rabbitmqOnline Interactive Playground (StackBlitz)
Section titled “Online Interactive Playground (StackBlitz)”You can run and test a memory-storage-based version of the Sharpino template directly in your browser without any local database setup:
- StackBlitz Demo: Run sharpinoTemplateMem in StackBlitz
- Source Repository: tonyx/sharpinoTemplateMem
