Skip to content

pnaskardev/Likes-Service-v1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Likes-Services-V1

Likes-Services-V1 is a microservice designed to encapsulate and manage all processing related to Likes within our (hypothetical) system. This microservice provides functionality to store Like events, check if a user has liked a particular content, and retrieve the total number of likes for a content. Additionally, it includes a placeholder implementation to showcase how push notifications would be handled when a user receives 100 likes.

Architecture

Tech Stack

  • Programming Language: Python
  • Web Framework: Django
  • Database: SQLite3
  • Containerization: Docker
  • Message Broker: RabbitMQ (for handling events and notifications)
  • Placeholder Push Notification Handling: Custom code to simulate push notifications
  • Version Control: Git
  • Deployment: Docker Compose (for local development) and Kubernetes (for production)

Features

The Likes-Services-V1 microservice offers the following features:

  • Store Like Event
  • Check User Liked Content
  • Total Likes for Content
  • Push Notification Placeholder
    • When a user receives 100 likes, the microservice showcases a placeholder code to demonstrate how push notifications would be handled. This serves as an example of how the system could respond when a significant milestone is reached.

Run Locally

  • The entiree project is Dockerized

Clone the project

  git clone https://github.com/pnaskardev/Likes-Service-v1

Go to the project directory

  cd Likes-Service-v1

Install dependencies

    docker-compose up

The microservices will struggle to connect with RabbitMQ at start but after 2-3 starts they will be able to connect and ready to recieve requests

API Reference

Superuser Credentials

username password service name
lenovo test123 main_service
lenovo test123 like_service

Get all Quotes

  GET http://localhost:8000/quotes/
Parameter Type Description
None None Get all the Quotes

Post a Quote

  Post http://localhost:8000/quotes/
Parameter Type Description
title string Required. Title of the Quote
created_by Positive Integer Required. Id of the created user

Post a Like

  Post http://localhost:5000/api/post-like/
Parameter Type Description
user_id Positive Integer Required. Id of the User
post_id Positive Integer Required. Id of the Quote

Get Like Count

  http://localhost:5000/api/like/like-count/
Parameter Type Description
post_id Positive Integer Required. Id of the Quote

Check Like Status

  http://localhost:5000/api/like/check-like-status/
Parameter Type Description
post_id Positive Integer Required. Id of the Quote
user_id Positive Integer Required. Id of the User

Screenshots

Authors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published