Running API Server

September 4, 2023 ยท View on GitHub

This document explains how you can setup a development environment for ILLA Builder API server.

Pre-requisites

Local Setup

  1. Setup the PostgreSQL database

    • Running the script to create the database and tables
  2. Setup the illa-supervisor-backend

  3. Change the default env config

    Change the default env config in pkg/db/connection.go to the PostgreSQL config.

    Change the default env config in internal/util/supervisior/token_validator.go to the illa-supervisor-backend config.

  4. Running the ILLA Builder API server

    go run github.com/illacloud/builder-backend/cmd/http-server
    

    This will start the ILLA Builder API server on http://127.0.0.1:8001.

  5. Extract the JWT token for the user root

    curl 'http://{{illa-supervisor-backend-addr}}/api/v1/auth/signin' --data-raw '{"email":"root","password":"password"}' -v
    

    Get the value of response header illa-token as the next API call's Authorization header value.

  6. Test the API server

    curl 'http://127.0.0.1:8001/api/v1/teams/:teamID/apps' -H 'Authorization: {{Value of response header `illa-token`}}'
    

    The value of :teamID is ILAfx4p1C7d0.

Need Assistance

  • If you are unable to resolve any issue while doing the setup, please feel free to ask questions on our Discord channel or initiate a Github discussion. We'll be happy to help you.
  • In case you notice any discrepancy, please raise an issue on Github.