ambianic-cloud-api v1.6.0
Ambianic-subscriptions
Repo for ambianic premium subscription management
The image below shows the architecture of these serverless functions in connection with the Ambianic PWA.
Running Locally
The serverless functions within this project are managed using netlify-dev. Start the functions emulator from the netlify
directory using yarn netlify-dev
to listen for requests to any of created functions on port 5050
.
All credentials within this project are managed using environment variables and GitHub Secrets. To run the functions here locally using the netlify dev
command, create a .env
file in the root directory with the following values;
STRIPE_TEST_KEY=STRIPE_KEY
# The product ID which users are subscribed to.
EMAIL_PRODUCT_ID=STRIPE_KEY
CI / CD Pipeline
The three currently available serverless function endpoints are all tested using Postman Tests. The API documentation explaining the endpoints can be found in the GitHub pages for this repository here. An exported file of the postman collection in json format is available at ./tests/postman/ambianic-functions-collection.postman_collection.json
.
Continuous integration for this project is managed using GitHub Actions, driven using the steps in the .github/workflows/ci.yaml
file. The following sensitive credentials used within the CI jobs are managed using Github Secrets;
- STRIPE_TEST_KEY
- GITHUB_TOKEN
- NPM_TOKEN
- REPOSITORY_ACCESS_TOKEN