Code Monkey home page Code Monkey logo

django-twitterme6's Introduction

django-twitterme

Tech Stack:

Python, Django REST Framework, MySQL, HBase, Redis, Memcached, RabbitMQ, Amazon S3/EC2, Thrift,

Summary:

This project is to design, develop, and implement Restful APIs to operate Twitter-like backend service as close to real-world development as possible based on Django REST Framework. For performance optimization, structured and unstructured databases are both implemented in this project according to the nature of the tables.

• Built push model to fanout news feeds

• Leveraged Redis and Memcached to reduce DB queries for tables which has lot reads and lot writes

• Used Key-value store HBase to split DB queries for tables which has less reads and lot writes

• Utilized denormalization to store the number of comments & likes to reduce DB queries

• Adapted Message Queue to deliver asynchronized tasks to reduce response time

• The whole project resulted in 10000 lines of code changes, cost over 3 months

Features:

  • User Authentification: Allow users to log in or sign up with emails
  • Allow users to follow, unfollow other users
  • Allow users to view, comment, and like others' posts, also users can cancel their comments and likes on the posts
  • Allow users to create, delete, update posts and view the count of likes and comments of their posts
  • Send out newfeeds to followers
  • Display tweets in newfeeds in endless pagination format

APIs

User and Profile

GET /api/users/ Only admin users have the access permission.

POST /api/accounts/signup/ It also creates user profile.
POST /api/accounts/login/
POST /api/accounts/logout/
GET /api/accounts/login_status/

PUT /api/profiles/:profile_id Updates nickname and/or avatar.

Tweet

GET /api/tweets/?user_id=xxx

POST /api/tweets/

GET /api/tweets/:id

Friendship

POST /api/friendships/:user_id/follow/
POST /api/friendships/:user_id/unfollow/
GET /api/friendships/:user_id/followings/
GET /api/friendships/:user_id/followers/

Newsfeed

GET /api/newsfeeds/
Endless Paginationimage

Comment

POST /api/comments/
PUT /api/comments/:id
DELETE /api/comments/:id
GET /api/comments/?tweet_id=xxx

Like

POST /api/likes/
POST /api/likes/cancel/

Notification

GET /api/notifications/
GET /api/notifications/unread-count/
POST /api/notifications/mark-all-as-read/
PUT /api/notifications/:notification_id

django_hbase Module

Django Rest Framework alike ORM to access hbase.

Implemented functions: Deine models and fields similar to DRF. Save, create, filter operations similar to Django ORM.

GateKeeper Module(Rate limiter):

Function: GrayRelease, Whitelisting, Reverse Commit

System Architecture

image

django-twitterme6's People

Contributors

twistedalex avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.