Skip to content

Repository files navigation

Ping CRM (powered by InertiaCore)

A demo application to illustrate how Inertia.js works.

Installation

Clone the repo locally:

git clone https://github.com/inertiacore/pingcrm.git pingcrm
cd pingcrm

Install .NET dependencies:

dotnet restore

Install NPM dependencies:

npm ci

Build assets:

npm run dev

Run database migrations:

dotnet ef database update

Run the dev server (the output will give the address):

dotnet run

You're ready to go! Visit Ping CRM in your browser, and login with:

Running with Docker

You can also run the application using Docker Compose:

# Clone the repository
git clone https://github.com/inertiacore/pingcrm.git pingcrm
cd pingcrm
# Run with Docker Compose
docker compose up -d

Create a compose.yml file in the project root:

services:
pingcrm:
image: ghcr.io/inertiacore/pingcrm:latestports:
- "8080:8080"environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_URLS=http://+:8080
- Database__Provider=Sqlite
- Database__ConnectionStrings__Sqlite=Data Source=/app/data/pingcrm.dbvolumes:
- pingcrm_data:/app/datarestart: unless-stoppedvolumes:
pingcrm_data:

Alternative with PostgreSQL:

version: "3.8"services:
pingcrm:
image: ghcr.io/inertiacore/pingcrm:latestports:
- "8080:8080"environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_URLS=http://+:8080
- Database__Provider=PostgreSQL
- Database__ConnectionStrings__PostgreSQL=Host=postgres;Database=pingcrm;Username=pingcrm;Password=pingcrm_passworddepends_on:
- postgresrestart: unless-stoppedpostgres:
image: postgres:15environment:
- POSTGRES_DB=pingcrm
- POSTGRES_USER=pingcrm
- POSTGRES_PASSWORD=pingcrm_passwordvolumes:
- postgres_data:/var/lib/postgresql/datarestart: unless-stoppedvolumes:
postgres_data:

The application will be available at http://localhost:8080

Running tests

To run the Ping CRM tests, run:

dotnet test

Configuration

Environment Variables and appsettings.json Mapping

All configuration options can be set via environment variables that override values in appsettings.json. Environment variables follow the pattern Section__Property (note the double underscore).

Database Configuration

appsettings.jsonEnvironment VariableDescription
Database:ProviderDatabase__ProviderDatabase provider: Sqlite, SqlServer, PostgreSQL, or MySQL
Database:ConnectionStrings:SqliteDatabase__ConnectionStrings__SqliteSQLite connection string
Database:ConnectionStrings:SqlServerDatabase__ConnectionStrings__SqlServerSQL Server connection string
Database:ConnectionStrings:PostgreSQLDatabase__ConnectionStrings__PostgreSQLPostgreSQL connection string
Database:ConnectionStrings:MySQLDatabase__ConnectionStrings__MySQLMySQL connection string

Forwarded Headers Configuration (for Proxy/Load Balancer scenarios)

Add the following to your appsettings.json to configure forwarded headers:

{
"ForwardedHeaders": {
"ForwardLimit": 2,
"KnownProxies": ["127.0.10.1", "192.168.1.100"],
"ForwardedForHeaderName": "X-Forwarded-For"
}
}
appsettings.jsonEnvironment VariableDescription
ForwardedHeaders:ForwardLimitForwardedHeaders__ForwardLimitNumber of proxies to trust (default: 1)
ForwardedHeaders:KnownProxiesForwardedHeaders__KnownProxies__0, ForwardedHeaders__KnownProxies__1, etc.Array of trusted proxy IP addresses
ForwardedHeaders:ForwardedForHeaderNameForwardedHeaders__ForwardedForHeaderNameCustom header name for forwarded-for (default: X-Forwarded-For)

Logging Configuration

appsettings.jsonEnvironment VariableDescription
Logging:LogLevel:DefaultLogging__LogLevel__DefaultDefault log level
Logging:LogLevel:MicrosoftLogging__LogLevel__MicrosoftMicrosoft namespace log level

Other Configuration

appsettings.jsonEnvironment VariableDescription
AllowedHostsAllowedHostsSemicolon-separated list of allowed host headers

About

A demo application to illustrate how InertiaCore works with React.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages