I am building MVP, a web application ~domain specific ChatGPT [imagine LLM based financial analyst named QuantAI_123
].
I need some guidance around following pain points:
-
Cookie Management: the user should be able to get 3 responses from QuantAI_123 for free. Then hit a paywall for buying a 30 min chat (~20 messages). Which library should I use for this in Streamlit? Please explain the pseudocode I can use.
I want the user to not be able to pass the trial version by refreshing the browser or switching from chrome to safari
-
Paywall: I want to use the Stripe Payment links for this. Essentially, created a product to be bought over Stripe.
Authentication of successful payment : Once, 3 reponses/free trial is over, user is prompted with a button/link of Stripe product [30 min chat~ 20 messages] to be bought and then if successful, redirected to chatbot. I am having trouble understanding/listening to incoming webhook from Stripe.
2.1) Is a webhook required for this use case? If not, please suggest an alternative.
2.2) If yes, I plan to use a unique cookie session id as client reference id in checkout session to be able to retrieve the status of success/failure.
2.3) Do I need to register the webhook in Stripe orcheckout session
is default.
2.4) How do I listen to this asynchronously? -
As I am planning to scale this web app if it attracts any traffic, I want to avoid switching from Streamlit cloud platform due to [resource limit] (Is there Streamlit App Limitations such as usage time, users etc.? - #2 by mathcatsand) later on. Would it be better to use a paid app hosting service like
Heroku
for this?Please Note: I want to be able to keep the codebase and data powering
QuantAI_123
private and secure.