You are tasked with building a backend system for a marketplace platform that allows creators to sell digital products. The platform needs to handle payments from customers and distribute the earnings among multiple connected accounts (e.g., the creator, the platform, and potentially other stakeholders).
- Create a GraphQL API using TypeScript that integrates with Stripe.
- Implement the following functionalities: a. Create Stripe Connect accounts for creators. b. Accept payments from customers. c. Distribute payment amounts between multiple connected accounts.
- Containerize the application using Docker.
- Implement proper error handling and logging.
- Write unit tests for critical components.
- Initialize a new TypeScript project.
- Set up a GraphQL server using any framework or library of your choice.
- Configure Docker for the project.
- Implement Stripe Connect account creation for creators.
- Create a payment intent for customer purchases.
- Handle successful payments and failed payments.
- Implement a flexible payment distribution system that can split payments between multiple connected accounts based on predefined rules.
- Ensure the system can handle various scenarios (e.g., platform fee, creator earnings, affiliate commissions).
- Design and implement a GraphQL API that supports the required operations:
- Creating Connect accounts
- Creating payment intents
- Confirming payments
- You have flexibility in naming and structuring your GraphQL operations.
- Implement proper error handling for Stripe API calls and other potential failure points.
- Set up a logging system to track important events and errors.
- Write unit tests for critical components, especially those handling payment distribution logic.
- Create Dockerfile(s) to containerize the application.
- Create a Docker compose file if needed
- Code quality and organization
- Proper use of TypeScript features
- GraphQL API design and implementation
- Stripe API integration and error handling
- Payment distribution logic correctness
- Docker configuration
- Test coverage and quality
- Documentation and code comments
- Provide a GitHub repository with your solution.
- Include a README.md file with:
- Setup instructions
- An overview of your solution's architecture
- Any assumptions or design decisions you made
- Suggestions for further improvements or scaling considerations