GUNICORN advises between 2-4 workers per core
The --threads option defines how many threads a single worker can use
current configuration is “–workers 1 --threads 16”
API Documentation
This documentation provides information on how to use the API for the client-side developer.
Verify-Payment
Endpoint:/verify-payment
Method:POST
Description: This endpoint receives a
-payment-token (apple receipt) and fcm_token in body
-and debuggindMode (true/false) to check for debugging environment (here original_transaction_id mst be 0)
Verifies payment token from apple.
check if a user already exists with that token using the original-transaction-id
if a new subscription then create a new user
else get the existing user and update it in db with new updated info if any
create a new jwt token for user and return it
if invalid payment-token then error with 400 status code is returned
verifies fcm_token if sent and stores in user document in db Note: fcm token is optional
List of cases where verify payement returns 400 bad request errors
if payment_tokenis not sent in request body
if payment_type is not sent or is not equal to apple
if fcm_token is sent but is still invalid
if any of required values inside payment_token is missing, these required values are "expires_date", "expires_date_ms", "original_transaction_id", "product_id", "transaction_id", if any one is missing backend responds with 400 bad request error
if the values inside payment_token are not the same as values received from apple getTransactionInfo api called for transaction_id
packs-info
Endpoint/packs-info
Method:GET
Description: This api returns all the packs names, display name and their thumbnail_urls for our app, also returns the list of featured packs with their thumbnails specific to be sown when they are featured
Database Format
-db path for common configs for all packs /CONFIGS/prompt_configs
-db path for pack specific configs /CONFIGS/prompt_configs/packs/pack_name
-For Featured packs
display-name(string)
is_active(boolean)
featured(boolean)
featured_thumbnail(string)
num_images_per_prompt(number)
num_prompts(number)
secondary-thumbnail-images(array)
thumbnail(array)
-For Simple Packs
display-name(string)
is_active(boolean)
num_images_per_prompt(number)
num_prompts(number)
secondary-thumbnail-images(array)
thumbnail(array)
is_active field is used for keeping tabs on which packs are current(active) or obsolete(inactive) adn not to be shown in explore screen.