Coder Social home page Coder Social logo

stonks-backend's Introduction

Stonks backend assignment

You are free to use any backend stack only PostgreSQL as database

Use this Profile schema and don't modify it

key type unique
id uuid -
fullName string -
username string yes
email string yes
password string -
avatar string -
active boolean -
createdAt timestamp -
updatedAt timestamp -

API fonctionnalities

You will write routes that do the following fonctionnalities and handle auth.

  • Signup/connect with email
  • Signup/connect with OAuth2 Google
  • Fetch/update a profile
  • Add 2fa to a profile
  • Follow/unfollow a profile
  • Push notifications
  • Start a stream -> Push notifications to followers or send emails if users is offline.
  • Create a channel

Websockets

Each users can create a channel, the owner is the HOST of the channel.

Each channels has a livechat where unauth and authenticated users can receive messages.

Fonctions that the backend need to perform from messages

  • /set admin @user : add role ADMIN to @user only HOST can do that
  • /unset admin @user : remove role ADMIN to @user only HOST can do that
  • /mute @user
  • /unmute @user
  • /ban @user
  • /unban @user
  • /suspend : will suspend the channel and can only be perform by SUPERADMIN
  • /set title "title name" : Update channel title
  • /set description "description ... " : Update channel description

Roles

Here is the minimum 3 roles: SUPERADMIN / HOST / ADMIN

  • SUPERADMIN are high level role, only stonks staff can be SUPERADMIN and can perform any actions in any channels.

  • HOST can perform all actions in chat messages.

  • ADMIN can perform /mute /unmute /ban /unban /set title and description.

Bonus

  • Swagger and make a beautiful documentation
  • Webhooks the host can add a webhook endpoint, and once activated will broadcast all events from chat channel to the endpoint.
  • Redis for queuing webhooks

stonks-backend's People

Contributors

edeuxk 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.