Skip to content

aminjonshermatov/nestjs-mediumclone

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.
Nest REST APIs Medium clone

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

# generate migration
$ npm run db:create

# migrate
$ npm run db:migrate

# drop migration
$ npm run db:drop

# seed data
$ npm run db:seed

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Endpoints

Article endpoints

Find all articles

Get  /articles?tag={tag}&author={author}&favorited={favorited}&limit={limit}&offset={offset}
Accept: application/json
Content-Type: application/json

Get Feeds

Get  /articles/feed?limit={limit}&offset={offset}
Accept: application/json
Content-Type: application/json

Create a article

Post  /articles
Accept: application/json
Content-Type: application/json

{
    "title" : "NestJs authentication with OAuth2",
    "description" : "Sample Authntication for NestJs project",
    "body": "Some article body",
    "tagList": ["NestJs", "OAuth2", "rest-api", "Authentication"]
}

Get article by slug

Get  /articles/{slug}
Accept: application/json
Content-Type: application/json

Delete article

Delete  /articles/{slug}
Accept: application/json
Content-Type: application/json

Update article

Put  /articles/{slug}
Accept: application/json
Content-Type: application/json

{
    "title" : "NestJs authentication with OAuth2",
    "description" : "Sample Authntication for NestJs project",
    "body": "Some article body",
    "tagList": ["NestJs", "OAuth2", "rest-api", "Authentication"]
}

Add article to favorites

Post  /articles/{slug}/favorite
Accept: application/json
Content-Type: application/json

Remove article from favorites

Delete  /articles/{slug}/favorite
Accept: application/json
Content-Type: application/json

Add comment to article

Post  /articles/{slug}/comments
Accept: application/json
Content-Type: application/json

{
    "body": "Some comment body",
}

Delete comment from article

Delete  /articles/{slug}/comments/{commentId}
Accept: application/json
Content-Type: application/json

{
    "body": "Some comment body",
}

Profile endpoints

Get profile

Get  /profiles/{username}
Accept: application/json
Content-Type: application/json

Follow to user

Post  /profiles/{username}/follow
Accept: application/json
Content-Type: application/json

Unfollow from user

Delete  /profiles/{username}/follow
Accept: application/json
Content-Type: application/json

Tags endpoints

Get Tags list

Get  /tags
Accept: application/json
Content-Type: application/json

Users endpoints

Create user

Post  /users
Accept: application/json
Content-Type: application/json

{
    "username": "john",
    "email": "john@gmail.com",
    "password": "$3cR3tP@$$w0rD"
}

Login

Post  /users/login
Accept: application/json
Content-Type: application/json

{
    "email": "john@gmail.com",
    "password": "$3cR3tP@$$w0rD"
}

Get current user details

Get  /users
Accept: application/json
Content-Type: application/json

Update user

Put  /users
Accept: application/json
Content-Type: application/json

{
    "user": {
        "email": "john@gmail.com",
        "username": "john",
        "password": "n3Wp@$$w0rD",
        "image": "https://mediumclone.s3.us-west-2.amazonaws.com/john.png",
        "bio": "tl;dr good boy)"
    } 
}

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

About

Medium clone with nestjs by realworld specifications

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published