Skip to content

platform-kit/server

Repository files navigation

PlatformKit Server

Self-Hosted Serverless Infrastructure

Deploy serverless functions & static site generators via Express on any cloud platform.

Built with:

Deploy with:

License:

Features

  • Deploy static site generator with custom build commands.
  • Deploy serverless functions on any major cloud provider.
  • Deploy a PostgreSQL database with zero config.

Benefits

  • Prevents vendor lock-in (easily move to/from hosting platforms).
  • Deploy your front-end, back-end, and database in one step.
  • Predictable billing + configurable auto-scaling.
  • Scale via serverless functions when necessary.

Local Development

Clone the project

  git clone https://github.com/platform-kit/server pk-server

Go to the project directory

  cd pk-server

Install dependencies

  npm install && npm run pull && npm run build-functions && npm run build

Start the server

  npm run dev

A local instance is now running at https://localhost:3000

Configuration

Before use, you will need to add the following environment variables to your .env file

The GITHUB_REPOSITORY variable is the repo containing your static site generator.

The BUILD_COMMAND is the command that is used to install/run your site generator.

The PUBLIC_DIRECTORY variable specifies which directory to serve.

The GITHUB_TOKEN is only necessary if your repo is private.

The PORT is 3000 by default, change it if 3000 is taken.

# GitHub
GITHUB_REPOSITORY=platform-kit/platformkit-ui
GITHUB_TOKEN=STRING

# Static Site Generator
BUILD_COMMAND=npm i; npm run build;
PUBLIC_DIRECTORY=dist

Deployment

To deploy to the cloud, simply click one of the buttons below.