Skip to content

Niranjan2003/DIstributedSystems_k8s

 
 

Repository files navigation

PrimePass

This project was built for the Distributed Systems course at the University of Oulu.


Final Demo Video

Final Demo Video

For the full project report, see Project-report.pdf.

Purpose

The project aims to reach the following features:

Event ticket sales requires reliable, fault-tolerant systems to handle large amounts of concurrent purchases. The goal is to build a distributed platform for real-time ticket sales and ML-based event recommendations.

Novelty: integrates multiple services (ticket sale, event management, recommendation engine) to ensure consistency, scalability, and personalized suggestions.

The following is a list of features that are to be implemented:

  • Introduction: Single-node ticketing simulation with minimal events and users.
  • Communication: Build API endpoints for event browsing, ticket reservation, and purchases.
  • Concurrency & Consistency: Ensure ticket availability is accurate under heavy traffic.
  • Non-Functional Requirements: Fault-tolerant services, horizontal scaling, low-latency responses.
  • Replication & Data Management: Each service owns its database; replicate critical data for high availability.
  • Resource Management & Load Balancing: Distribute requests across multiple service instances to reduce load on an individual instance.
  • System Architecture: Microservices for users, events, tickets, payments, and recommendations using APIs.
  • Middleware: Centralized logging, distributed data tracing, and caching of frequently requested data.
  • Cloud & Deployment: Containerize services; deploy on Kubernetes or cloud platform with scalable infrastructure.

Tools

  • Python
  • Flask
  • Docker
  • PostgreSQL

Installation

  1. Build and start containers in Primepass root folder

     docker-compose up --build -d
    

Use populate_db script to add content (Or if you are trying replication, go to backend/DB_SETUP.md):

    docker exec -it primepass_backend python populate_db.py
  1. Test POST request

     curl -X POST http://localhost:5000/api/purchase \
    

-H "Content-Type: application/json"
-d '{"user_id":"00000000-0000-0000-0000-000000000001","ticket_id":1,"quantity":1}'

  1. List purchases

     curl "http://localhost:5000/api/orders?user_id=00000000-0000-0000-0000-000000000001"
    
  2. Stop containers when done

     docker-compose down
    

Note

Windows note (CRLF/LF)

If the backend container keeps restarting with exec ./entrypoint.sh: no such file or directory, ensure backend/entrypoint.sh uses LF line endings. This repo includes a .gitattributes to enforce LF for .sh files.

Qui laborum fugiat sunt dolor. Corrupti velit laboriosam magni voluptatum ipsam dicta. Facere voluptatem quo expedita delectus aut libero maiores. Iure quaerat commodi rerum illum ab voluptatem quis non. Vitae nobis dignissimos ullam id deserunt enim optio.

Ullam aperiam animi qui perspiciatis consequatur dolores. Ea recusandae consequatur necessitatibus dolorem. Sed doloremque adipisci ut natus velit. Sed quam magni natus natus ea ut rerum est.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 76.1%
  • JavaScript 10.1%
  • HTML 6.8%
  • Shell 4.7%
  • Dockerfile 2.3%