An API designed to manage events, supporting features like event creation, user authentication, ticket generation, and payment processing. This project follows modern software development practices and uses robust technologies to ensure scalability and reliability.
- Endpoint to create an event with the following fields:
- Event Title
- Description
- Location
- Start and End Time
- Price (if paid)
- Number of tickets available
- Update and delete events created by the user.
- List events belonging to the authenticated user.
- Process payments for paid events using Stripe.
- Generate unique tickets for participants.
- Store generated tickets for future validation.
- Validate tickets using QR code or unique codes.
- RESTful API design.
- Adequate performance to handle 1000 concurrent users.
- Comprehensive API documentation.
- Backend Framework: Gin
- Database: PostgreSQL
- Authentication: OAuth2 (Google, GitHub) via golang.org/x/oauth2
- Payments: Stripe
- API Documentation: Swagger (Swaggo)
- Testing:
- Containerization: Docker
- Optional:
- Monitoring: Grafana + Prometheus
- Orchestration: Kubernetes
- Initial Setup
- Configure Gin.
- Set up basic project structure.
- Connect to PostgreSQL and configure migrations using
golang-migrate
.
- Documentation
- Set up Swagger for API documentation.
- Draw the architecture with tools like Excalidraw.
- Draw or write the Use Cases .
- Basic Endpoints
- Create Event.
- List Events.
-
- Create a helper for pagination
- Create a BaseResponse and Metadata about pagination.
- Containerization and Deployment
- Configure Docker for development and production environments.
- Create CD rotine to first deploy.
- Make a deployment.
- Authentication (Needs first deploy and a domain to simplify OAuth2 google configuration to test...)
- Configure in GCP.
- Implement OAuth2 login with Google using OpenID for authentication.
- Return the JWT token if the authentication is successful.
- Refactor: Change to Struct-Based Controller,Service and Repository.
- Refresh token endpoint.
- Private routes.
- Event Management
- Update and delete events.
- Add pagination for event listings.
- Protect endpoints with Private endpoints.
- Payments
- Integrate Stripe for processing payments (Checkout Sessions).
- Ticket Handling
- Generate unique tickets upon successful payment.
- Store ticket details in the database.
- Ticket Validation
- Implement QR code simulation or unique code validation.
- Testing
- Write unit and integration tests.
- Perform load testing with k6 or Artillery.
- CI/CD
- Create Github action CI.
- Create a workflow to automate releases (using semantic commit).
- Optional
- Create Kubernetes deployments and services.
- Integrate Grafana and Prometheus for monitoring.
- Controllers: Handle HTTP requests and responses.
- Services: Contain business logic.
- Repositories: Handle database interactions.
- Models: Define data structures.
./scripts/migrate.sh up
./scripts/migrate.sh down
./scripts/migrate.sh version
Contributions are welcome! Please open an issue or submit a pull request for any suggestions or improvements.