Skip to content

mustkem/yo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Yo - A Twitter Clone

Backend API for Yo using Nest framework (NodeJS + TypeScript + MySQL)

About

Yo is a Twitter Clone.

🖼️ Avatar Upload to AWS S3 (Presigned URL)

Methodology

  1. Generate Presigned URL
    Backend provides a presigned S3 URL and object key for secure direct image upload.

  2. Upload Image
    Frontend uses the URL to upload the image directly to S3 via a PUT request.

  3. Save Image Key
    The S3 object key is saved in the database as the user's avatar reference.

  4. Access Avatar
    The avatar can later be accessed using a signed URL generated by the backend.

🔁 Kafka Integration

Methodology

  1. Kafka Config Setup
    Kafka broker and client settings are loaded via ConfigService and made globally available. Broker connects to multiple topics dynamically.

  2. Kafka Producer/Consumer Modules
    Services use Kafka client to emit and consume events (e.g., user created).

  3. Microservice Communication
    Kafka enables decoupled communication between services for handling async operations.

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 yoodb;
create user yooadmin with password 'yoopass';
grant all privileges on database yoodb to yooadmin;

Endpoints

  • 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 📃

About

Yo - A Twitter Clone - Backend API for Yo using Nest framework (NodeJS + TypeScript + MySQL)

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published