User Management Platform
Customer support requires juggling multiple systems to answer basic questions
Support tickets come in asking about account status, payment history, or usage limits. Answering requires checking Stripe for payments, your database for user details, and logs for token consumption. Each question means switching between three systems. Issuing refunds takes multiple steps. Generating receipts requires manual work. By the time you've gathered information from everywhere, you've spent 10 minutes on what should be a 2-minute response.
About this tool

This dashboard brings user data into one place. Search for any user and see their complete profile: account details, payment history from Stripe, and token usage over time. Issue refunds directly from the interface. Generate and email PDF receipts with billing details. Top up tokens when needed. The token usage chart shows daily consumption patterns to identify unusual activity.
User search by name or email, payment history from Stripe integration, token consumption tracking with daily charts, refund processing, PDF receipt generation and email delivery, billing details management, token balance top-ups, free plan and paid plan status visibility, and dual MongoDB connections (internal and external).
The support team stopped switching between tools to help one customer. They can now search a user, see everything, and fix issues from the same screen.
Prompts used to build this app
I want to build an app that on the home page after the user is authenticated sees a search bar where I can search users by name or by the email. Then when users are fetched I should be able to click and open up the user page. On the user page I should be able to see a user's email, user's name, when did they joined. This is a createdAt parameter in the users collection. I should be able to see clearly if they are on the paid plan or a free plan. I should be able to see their payments and their token usage. If they are on the paid plan I should be able to cancel their subscription and if I cancel it after the confirmation pop-up the user should get a confirmation email that their subscription has been cancelled.
In the Payments section, I should be able to see user's payment history in a list (date of the payment, amount). This should be connected with Stripe, and in Stripe search for all the payments by the customerId. For each of the payments, I should be able to issue a refund and generate a PDF receipt. Once the receipt is generated, I should be able to download it or automatically send it in an email to the user. I should be able to edit user's billing details. By default, fetch the user's billing details from Stripe, but I also want to be able to change the billing details, save them in the internal database. So if there are billing details in the internal database, then fetch that data, and if not, fetch the data from Stripe, and I should be able to turn on automatically receipt sending over email. So if I do that, whenever a user does a payment, we should automatically send them an email with the receipt and their billing details.
In the Token Consumption section, I should be able to see a bar chart by days with the token consumption for each of the days. I should be able to generate a PDF like a receipt with token consumption. I should be able to choose a date range and generate a PDF, and in it, there should be all token consumption by day in a list. Also, I should be able to give free tokens. I should be able to see the current token balance and top up the tokens. I should be able to just add a number and give free tokens. I also want to have a confirmation pop-up for that, and once I do that, send an email confirmation to the user about the free tokens.
As for the implementation details, we want to use the internal database that comes with a template and another MongoDB database (external database) that I will add different MongoDB connection details.
Please implement the connection to Stripe - pulling of the biliing details, editing the billing details and saving them to the database, getting the payment history, generating the receipt for each specific payment and issuing a refund. Also, implement sending emails - receipts and the automatic sending of receipts.
Ok, great, I can see the payments but there are a few issues:
- I see some weird payments of $29.99 on February 14, 2025, January 21, 2025 and January 18, 2025 - there are no such payments. Please check what is with this.
- For billing details, I only see "undefined" - you can leave them blank until I change them myself. You don't have to get them from Stripe.
- If I try Editing the billing details, I get an error. I want to save this data into the internal database, not the external one.
- Generating a receipt doesn't work. I get an error.
I still cannot download the invoice nor send it via email. Please fix. You can create the invoice from the fetched data. also, the company name for the invoice is Pythagora Technologies Inc. Great, I can generate the PDF now - it looks good but it doesn't add the Billing details under the "Bill to:" section.
This works great. Now, please do the following changes:
- On the top of the page put the value user.fullName and under it, the email. Also, on the invoice, in the Bill to section, add only the billing details that I added on the user page.
- for the receipt number, take the receipt number from stripe - it should be something like 2615-8081
Implement topping up tokens by making this POST request:curl -X POST http:s//api.pythagora.ai/add-tokens
-H "Content-Type: application/json"
-d '{"apiKey": "your-api-key-here","userId": "<user_id>","tokens": 1000}'
the apiKey should be set in the .env file and the userId should be fetched for that user._id
Also, implement cancelling of the subscription on stripe.