Version 1.0.0
Created by: Bloberry Consulting
This is the landing page of the application. Navigate through the app to explore its features.
Loading information...
Loading information...
This project is a web-based application designed to manage user information and API interactions. The 'ApiController' handles various API-related functionalities, including viewing, creating, and managing API keys, client profiles, and customer queries. The 'UserController' focuses on user-related operations, such as retrieving user information, selecting APIs for users, and assigning roles. Secure access is enforced through different roles, ensuring that each endpoint is accessed only by authorized users. The communication flow is designed to be straightforward, with clear endpoints for each specific task.
The ApiController is designed to manage API interactions and user requests for transcription services, API key management, and more. It incorporates security with role-based access control, ensuring that only authorized users can execute specific operations.
@PostMapping("/transcription")
: Uploads audio files for transcription. Utilizes the WhisperTranscribe service for processing and returns the transcription text.
@GetMapping("/keys/manage")
: Retrieves API keys owned by the current user or their company. Implements OAuth for security.
@PostMapping("/keys/manage")
: Allows creating new API keys and associating them with the current user's profile.
@GetMapping("/client/profiles")
: Provides a list of all client profiles, accessible to site administrators for oversight.
ROLE_CUSTOMER, ROLE_SITE_ADMINISTRATOR, ROLE_CLIENT_ADMINISTRATOR
The UserController focuses on operations related to user management, including information retrieval, API selection for users, and user-client association. It ensures secure access through authentication and authorization mechanisms.
@GetMapping("/info")
: Retrieves details about the currently authenticated user, leveraging OAuth2 for security.
@PutMapping("/selectAPI/{apiKey}")
: Assigns a specified API to the current user, updating their profile with the new API key.
@PutMapping("/{userId}/attach/{clientId}")
: Attaches a user to a client, enabling them to utilize the client's APIs.
@GetMapping("/findByEmail")
: Searches for a user by their email address, useful for administrative tasks and user support.
ROLE_CUSTOMER, ROLE_SITE_ADMINISTRATOR, ROLE_CLIENT_ADMINISTRATOR
This controller is responsible for creating Stripe Checkout Sessions. It initializes with the Stripe API key and sets up payment sessions with configurable amounts and success or cancellation URLs. The session creation endpoint takes payment details, creates a checkout session, and returns a session ID for frontend redirection to the Stripe payment page.
@PostMapping("/stripepayment/create-checkout-session")
The amount is dynamically mapped to price IDs configured in Stripe, allowing for flexible payment options. Successful payment sessions redirect users to a success page, and metadata including the user's ID is attached for tracking and confirmation purposes.
This controller handles webhook events from Stripe, particularly focusing on the completion of checkout sessions. It verifies the event signature to ensure legitimacy, then processes the event data to perform actions such as updating user credits based on the payment amount.
@PostMapping("/stripepayment/webhook")
Upon receiving a "checkout.session.completed" event, the controller extracts customer details and the payment amount from the session data. It then updates the corresponding user's credit in the system, based on the customer's email and the total payment amount. This automated process ensures that user credits are accurately and efficiently managed following successful transactions.