/twitter-backend-node

Primary LanguageTypeScriptGNU Affero General Public License v3.0AGPL-3.0

Moo - A Twitter Clone

Backend API for Moo using Nest framework (NodeJS + TypeScript + PostgreSQL)

NodeJS Workflow DeepSource codecov

About

Idea

Moo is a parody of Twitter. Further information about features and DB schema requirements can be found on this discussion board : scaleracademy/open-source-projects#81

UI Design

The UI is being designed on Figma if you'd like to view

Tutorials

If you'd like to see how the initial project was built please watch the following YouTube video
▶️ Building Twitter Clone from Scratch | End-to-End Coding Project

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Setup Database

create database moodb;
create user mooadmin with password 'moopass';
grant all privileges on database moodb to mooadmin;

Progress

  • auth

    • POST /auth/login
  • users

    • GET /users 📃
    • GET /users/@{username}
    • GET /users/{userid}
    • POST /users
    • PATCH /users/{userid} 🔒
    • PUT /users/{userid}/follow 🔒
    • DELETE /users/{userid}/follow 🔒
    • GET /users/{userid}/followers 📃
    • GET /users/{userid}/followees 📃
  • posts

    • GET /posts 📃
      • filter by author
      • filter by replyTo
      • filter by origPosts
      • full-text-search on post content
    • GET /posts/{postid}
    • POST /posts 🔒
      • simple posts
      • reply to a post
      • repost / quote post
      • #hashtags
      • @mentions
    • DELETE /posts/{postid} 🔒
    • PUT /posts/{postid}/like 🔒
    • DELETE /posts/{postid}/like 🔒
  • hashtags

    • GET /hashtags 📃
    • GET /hashtags/{tag}/posts 📃

License

This project is under the GNU AGPL v3.0 license