Skip to content

Quickstart

Get a store running against PostgreSQL in three steps.

Terminal window
# PostgreSQL
sudo -u postgres psql -c "CREATE DATABASE rcommerce;"
sudo -u postgres psql -c "CREATE USER rcommerce WITH PASSWORD 'your_password';"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE rcommerce TO rcommerce;"

Create config.toml:

[server]
host = "0.0.0.0"
port = 8080
[database]
db_type = "Postgres"
host = "localhost"
port = 5432
database = "rcommerce"
username = "rcommerce"
password = "your_password"
[security.jwt]
secret = "change-this-to-a-random-string"
expiry_hours = 24
Terminal window
rcommerce serve -c config.toml

The API is now running on http://localhost:8080. Migrations run automatically on first start.

Terminal window
# Health check
curl http://localhost:8080/health
# List products (empty on fresh install)
curl http://localhost:8080/api/v1/products
Terminal window
curl -X POST http://localhost:8080/api/v1/products \
-H "Content-Type: application/json" \
-d '{
"title": "Sample Product",
"slug": "sample-product",
"price": 29.99,
"currency": "USD",
"sku": "SAMPLE-001",
"inventory_quantity": 100,
"is_active": true
}'