Git Product home page Git Product logo

assignment-rprasetyob's Introduction

Twitter-like Back-End project

This is a backend application for a Twitter-like platform, built using Flask and SQLAlchemy. The backend provides essential functionalities such as user registration, tweet creation, user profiles, and moderation actions.

Features

  • User Registration: Allows users to register with unique usernames, bio, and passwords.

  • User Login: Allows users to login.

  • User Authentication: Secures endpoints with JWT-based authentication, ensuring user data remains private.

  • Tweet Creation: Enables users to create tweets with a character limit of 150.

  • User Profiles: Provides user profiles displaying basic information, following status, and their tweets.

  • Follow System: Allows users to follow and unfollow each other.

  • Moderation Actions: Moderators can suspend users, flag tweets as spam, and perform other administrative actions.

Instalation

  1. Clone the repository:

    git clone https://github.com/RevoU-FSSE-2/Assignment-RPrasetyoB.git
    
  2. Install dependencies:

    pip install pipenv
    
    pipenv shell
    
    pipenv install
    
  3. Run the application:

    flask run
    

API Endpoint

API documentation:

https://documenter.getpostman.com/view/29092304/2s9YeD7sxj

Postman file :

week21.postman_collection.json - Google Drive

Methods Endpoint Requirement & Authorization Body
Register POST /auth/registration - username, bio, password
Login POST /auth/login user is_suspended? username, password
Create Tweet POST /tweet bearer_token, user is_suspended? tweet
User Profile GET /user-profile bearer_token -
Follow POST /following/:target_user.id bearer_token -
Flag spam POST /moderation/tweet bearer_token, moderator role tweet.id, is_spam
Suspend user POST /moderation/user bearer_token, moderator role user.id, is_suspended

Some feature images :

  • Suspended user in database:

Screenshot_3

  • Suspended user cannot login:

Screenshot_5

  • If suspended user have last login token and still not expired, user still cannot create tweet:

Screenshot_4

  • Flag Spam tweets in database:

Screenshot_2

User for Testing

  • Moderator
{
    "username":"rpb",
    "password":"rpb123"
}
  • User
{
    "username":"rpb2",
    "password":"rpb123"
}
{
    "username":"rpb3",
    "password":"rpb123"
}

assignment-rprasetyob's People

Contributors

rprasetyob avatar github-classroom[bot] avatar

Watchers

Alvian Zachry Faturrahman avatar Guntur Kurniawan Heryanto avatar

Forkers

rprasetyob

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.