Giter Club home page Giter Club logo

news_backend's Introduction

Стек:

DB: MySQL и S3 Framework: NestJS ORM: TypeORM

Описание

Реализован CRUD для сущностей User, Tags и FeedBack.

  1. Пароли не хранятся в открытом виде
  2. Реализована валидация полей на api запросы с кодами ответов и сообщениями об ошибке в теле ответа.
  3. JWT bearer token
  4. Модуль AWS для взаимодействия с сервером JS
  5. Использованы DTO

News:

field type
id uuid
title string(100)
status string(100)
text string(30)
link string(30)
date datetime

User:

field type
id uuid
email string(100)
password string(100)
name string(30)

Feedback:

field type
id uuid
email string(100)
text string(100)

Список API endpoint

  • POST /sign-up
{
  "email": "[email protected]",
  "password": "example",
  "nickname": "nickname"
}

RETURN:

{ 
  "id": 1
  "email": "[email protected]",
  "password": "123e4567-e89b-12d3-a456-426614174000",
  "nickname": "nickname"
}

  • POST /login
{
  "email": "[email protected]",
  "password": "example"
}

RETURN:

{
  "id": 1
  "email": "[email protected]",
  "password": "123e4567-e89b-12d3-a456-426614174000",
  "nickname": "nickname"
}

  • GET /users

    HEADER: Authorization: Bearer {token}

RETURN:

[
 {
  "id": 1
  "email": "[email protected]",
  "password": "123e4567-e89b-12d3-a456-426614174000",
  "nickname": "nickname"
},
{
  "id": 2
  "email": "[email protected]",
  "password": "123e4567-e89b-12d3-a456-426614174000",
  "nickname": "nickname"
  }
 ] 

  • PATCH /reset

    HEADER: Authorization: Bearer {token}

{
  "email": "[email protected]",
  "password": "example"
}

RETURN :

{
  "id": 2
  "email": "[email protected]",
  "password": "123e4567-e89b-12d3-a456-426614174000",
  "nickname": "nickname"
}

  • POST /news
{
  "title": "example",
  "description": "example",
  "status": "Publish",
  "text": "text text"
}
file: png/jpeg/jpg

RETURN :

{ 
  "id": 1
  "title": "example",
  "description": "example",
  "status": "Publish",
  "text": "text text"
}

  • GET /get

RETURN :

[
 {
   "id": 1,
  "title": "example",
  "description": "example",
  "status": "Publish",
  "text": "text text"
},
{
  "id": 2,
  "title": "example",
  "description": "example",
  "status": "Publish",
  "text": "text text"
}
]

  • PUT /update
{
  "id": 1,
  "title": "example",
  "description": "example",
  "status": "Publish",
  "text": "text text"
}
file: png/jpeg/jpg

RETURN :

{
  "id": 1,
  "title": "example",
  "description": "example",
  "status": "Publish",
  "text": "text text"
}
file: png/jpeg/jpg

  • DELETE /tag/{id}

RETURN :

{
  "post": "Deleted",
}
file: png/jpeg/jpg


  • POST /user/tag

    HEADER: Authorization: Bearer {token}

{
  "tags": [1, 2]
}

news_backend's People

Contributors

timurkurbanov1994 avatar

Watchers

 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.