This project is a sophisticated ticketing system built using a microservices architecture, showcasing modern, scalable application design and development practices.
To run the project successfully, follow these steps:
Before you begin, ensure you have the following installed on your machine:
- Node.js: JavaScript runtime environment.
- pnpm: Fast, disk space efficient package manager.
- Docker: Platform for developing, shipping, and running applications inside containers.
- Kubernetes: Container orchestration system for automating application deployment, scaling, and management.
- Skaffold: Command line tool that facilitates continuous development for Kubernetes applications.
```sh
git clone <repository_url>
cd <repository_directory>
```
```sh
kubectl create secret generic jwt-secret --from-literal JWT_SECRET=your_secret_key
```
```sh
kubectl create secret generic stripe-secret --from-literal STRIPE_KEY=your_secret_key
```
```sh
pnpm install
```
```sh
skaffold dev
```
By following these steps, you can set up and run the project locally, ensuring all services, including payments, are properly configured and operational.
- Microservices: Multiple independent services (Auth, Tickets, Orders, Payments) each responsible for specific business functionalities.
- Event-Driven Design: Inter-service communication via NATS Streaming, ensuring loose coupling and high scalability.
- Database Per Service: Implemented to ensure data independence and service autonomy, using MongoDB.
- Kubernetes: Orchestrates container deployment, scaling, and management.
- Docker: Containerizes each service for consistency across environments.
- TypeScript & Express.js: Primary languages and frameworks for service development.
- NATS Streaming: Facilitates reliable, asynchronous communication between services.
- MongoDB: Database solution for persistent data storage, configured with replica sets.
- Next.js: Used for the client-side application.
- Stripe: Integrated for handling payments.
- Skaffold: Facilitates continuous development with Kubernetes.
- GitHub Actions: Potential CI/CD pipeline (based on project structure).
- Ingress-Nginx: Manages external access to the services.
The system comprises several microservices, including:
- Auth Service
- Tickets Service
- Orders Service
- Payments Service
- Client (Next.js application)
Each service is independently deployable and scalable, maintaining data consistency through event-based communication.
This project emphasizes:
- Cloud-native development practices
- Scalable and maintainable code architecture
- Robust testing strategies (using Vitest)
- Efficient inter-service communication
- Secure authentication using JWT
- Authentication: Implements JWT for secure, stateless authentication across services.
- Transactional Operations: Uses MongoDB transactions for data consistency.
- Error Handling: Custom error handling and middleware for consistent error responses.
- Environment Flexibility: Configurable for different environments (development, testing, production).
- Payments: Integrated Stripe for secure and reliable payment processing.
The architecture and technology choices reflect a commitment to building resilient, scalable systems capable of handling complex business requirements in a distributed environment.