Skip to content

Getting Started

An Apilane Instance consists of two services (Portal + API) and can be deployed in any environment.

1. Start the Services

Execute the provided docker-compose.yaml to spin up both services:

docker-compose -p apilane up -d

This starts:

2. Log in to the Portal

Open http://localhost:5000 and log in with the default credentials:

  • Email: admin@admin.com
  • Password: admin

Important

Change the admin password immediately after first login. You can also override the admin email via the AdminEmail environment variable before deployment.

3. Create Your First Application

  1. In the Portal, navigate to Applications and click Create
  2. Enter a name (e.g., MyApp)
  3. Select a Server (the API service)
  4. Choose a Storage Provider (SQLite is recommended for getting started)
  5. Click Create

Your application is now ready. Note the Application Token — you'll need it for API calls.

4. Define an Entity

  1. Open your application in the Portal
  2. Navigate to Entities and click Create
  3. Name it Products
  4. Add properties:
    • Name (String, Required)
    • Price (Number)
    • InStock (Boolean)

5. Make Your First API Call

With your entity created, you can start making API calls. Replace {appToken} with your Application Token.

Create a record:

curl -X POST "http://localhost:5001/api/Data/Post?entity=Products" \
  -H "x-application-token: {appToken}" \
  -H "Content-Type: application/json" \
  -d '{"Name": "Widget", "Price": 9.99, "InStock": true}'

Response: [1] — an array containing the new record's ID.

Read records:

curl "http://localhost:5001/api/Data/Get?entity=Products" \
  -H "x-application-token: {appToken}"

Response:

{
  "Data": [
    { "ID": 1, "Name": "Widget", "Price": 9.99, "InStock": true, "Owner": null, "Created": 1704067200000 }
  ]
}

Update a record:

curl -X PUT "http://localhost:5001/api/Data/Put?entity=Products" \
  -H "x-application-token: {appToken}" \
  -H "Content-Type: application/json" \
  -d '{"ID": 1, "Price": 12.99}'

Delete a record:

curl -X DELETE "http://localhost:5001/api/Data/Delete?entity=Products&ids=1" \
  -H "x-application-token: {appToken}"

6. Register a User

To use authenticated endpoints, first allow user registration in the Portal under Security, then:

curl -X POST "http://localhost:5001/api/Account/Register" \
  -H "x-application-token: {appToken}" \
  -H "Content-Type: application/json" \
  -d '{"Email": "user@example.com", "Username": "john", "Password": "SecurePass123!"}'

Login and get an auth token:

curl -X POST "http://localhost:5001/api/Account/Login" \
  -H "x-application-token: {appToken}" \
  -H "Content-Type: application/json" \
  -d '{"Email": "user@example.com", "Password": "SecurePass123!"}'

Response:

{
  "AuthToken": "a1b2c3d4-...",
  "User": { "ID": 1, "Email": "user@example.com", "Username": "john", ... }
}

Use the AuthToken in subsequent requests via the Authorization header:

curl "http://localhost:5001/api/Data/Get?entity=Products" \
  -H "x-application-token: {appToken}" \
  -H "Authorization: Bearer a1b2c3d4-..."

Environment Variables

Regardless of deployment method (Docker, k8s, cloud), you can override default settings via environment variables.

Portal

Variable Default Description
Url http://0.0.0.0:5000 URL where the Portal is served
ApiUrl http://127.0.0.1:5001 URL to the initial API service
FilesPath /etc/apilanewebportal Path for Portal database files (SQLite)
InstallationKey 8dc64403-... Shared key between Portal and API. Change this and keep it secret.
AdminEmail admin@admin.com Admin email, created on first deployment. Change before deploying.

API

Variable Default Description
Url http://0.0.0.0:5001 URL where the API is served
PortalUrl http://127.0.0.1:5000 URL to the Portal
FilesPath /etc/apilanewebapi/Files Path for API-generated files
InstallationKey 8dc64403-... Must match the Portal's key

Next steps