Sign inSign up

encircle/saas_backend

By encircle

•Updated over 4 years ago

Image
0

2.6K

encircle/saas_backend repository overview

⁠SAAS-backend

This repo contains the source code for the SaaS REST API.

⁠Default Settings

Host:    localhost
Port:    4433
API Key: helloworld

⁠Getting Started

Change directory into the repo root directory.

cd SAAS-backend

Run the stack.

docker-compose up -d

Execute a test request.

curl -k -H 'email: [email protected]' -H 'X-API-Key: helloworld' https://localhost:4433/organizations

The response should be 200 status code and an empty list - []

⁠Stripe

For Stripe to work, you must login to Stripe and get the webhook secret.

  1. Login to Stripe
docker run --rm -it -v /full/path/to/backend/stripe:/root/.config/stripe stripe/stripe-cli:v1.5.14 login
  1. Get the secret key
docker run --rm -it -v /full/path/to/backend/stripe:/root/.config/stripe stripe/stripe-cli:v1.5.14 listen --print-secret
  1. Add the secret key as an environment variable to the Flask container
STRIPE_WEBHOOK_SECRET: whsec_RiTChYZIBbFJNgWE9xhh817qC1lZhnRf
  1. This key will be valid for 90 days!

⁠API docs

The API is documented automatically, to access the API documentation and execute test requests visit the below URL:

https://localhost:4433/apidocs⁠

⁠Notes

If you mount the gunicorn socket directory for proxying via NGINX, that directory should allow access to the app and webserver user.

chown -R 10066:10033 sock

Tag summary

Content type

Image

Digest

Size

99 MB

Last updated

almost 5 years ago

docker pull encircle/saas_backend