Quick start
Get started with Portcall!
Spin up a Portcall instance
Quick steps to get started with Portcall.
Clone the repo
git clone https://github.com/useportcall/portcall.git
cd portcallRun with Docker
Spin up portcall services with Docker Compose.
cd docker
docker compose -f docker-compose.db.yml -f docker-compose.auth.yml -f docker-compose.tools.yml -f docker-compose.workers.yml upRun dashboard app
cd ../apps/dashboard/frontend
npm install
npm run build
cd ..
go run .Access the dashboard
Open your browser and navigate to http://localhost:8082 to access the Portcall dashboard.
Input demo and demo1234 to log in with the default demo account.
Add a user
Navigate to /users and add a new user to your Portcall instance. This user will be used to assign plans and entitlements.
Create a plan
Once you have your Portcall instance up and running, it's time to create your first plan in Portcall!
You can set a plan name, (base) price, define included features, as well ass add metered features that may come with a standalone pricing model on top of your base price.
Learn more about adding plans here
Subscribe a user to a plan
To subscribe the user you created above, simply create a checkout session:
curl --location `localhost:8600/v1/checkout-sessions` \
--header 'x-api-key: {{secret}}' \
--header 'Content-Type: application/json' \
--data '{
"plan_id": "{{plan_id}}",
"user_id": "{{user_id}}",
"cancel_url": "{{cancel_url}}",
"success_url": "{{success_url}}"
}'Navigate to the url returned in the response to let the user complete the checkout process.
{
"url": "..."
}Check weather user is entitled to a feature
You should add entitlement checks, where relevant, for any features in the plan you created. These checks can be done by calling the entitlements endpoint:
curl -X GET https://api.portcall.com/v1/users/{{user_id}}/entitlements/{{entitlement_id}} \
-H "X-API-Key YOUR_SECRET_API_KEY" \
-H "Content-Type: application/json"See this for more details on querying entitlements and metered feature usage.