Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.
/ api-legacy Public archive

🛠️ Koj's open-source backend APIs

Notifications You must be signed in to change notification settings

pabio/api-legacy

Repository files navigation

🛠️ API

This repository contains the API server, primarily for communicating with Firebase. It's a single Node.js file, index.mjs that runs a Polka server which sends data to Firebase.

Node CI semantic-release Uptime Robot status Uptime Robot ratio (7 days)

⚙️ Configuration

The following environment variables are required.

Firebase:

  • FIREBASE_DATABASE_URL is the full Firebase database URL
  • FIREBASE_SERVICE_ACCOUNT is the service account key in JSON

Authentication:

  • TWT_SECRET is the secret used to sign TWTs
  • JWT_SECRET is the secret used to sign JWTs
  • ROOT_USERNAME is the username for logging in
  • ROOT_PASSWORD is the hashed password for logging in

AWS-managed ElasticSearch:

  • AWS_ELASTIC_HOST is the endpoint
  • AWS_ACCESS_KEY_ID is the AWS access key
  • AWS_SECRET_ACCESS_KEY is the AWS secret key
  • AWS_REGION is the AWS region

Sales:

  • PIPEDRIVE_API_KEY is the Pipedrive CRM API key
  • SLACK_BOT_ACCESS_TOKEN is the access token of the Slack bot

Locally, these environment variables are loaded from a .env. This repository also uses GitHub Actions CI/CD and triggers an endpoint for deployment from the master branch. Optionally, you may add the required environment variables as repository secrets (see Creating and storing encrypted secrets).

📄 License

  • Code: MIT © Koj
  • "Firebase" is a trademark of Google LLC

Koj

An open source project by Koj.
Furnish your home in style, for as low as CHF175/month →

Releases

No releases published