Giter VIP home page Giter VIP logo

movies-explorer-api's Introduction

header

Hello there! 🖐️ My name is Tatiana.

I am a Frontend develоper and HTML-coder.

Feel free to write to me:

Email Badge

JavaScript React
NPM Gulp Webpack
HTML5 CSS3 SASS Bootstrap
Git Figma ESLint Postman

💂‍♂️ Side skills

English - advanced

📈 My stats

Codewars

GitHub stats

movies-explorer-api's People

Contributors

proactative avatar

Stargazers

 avatar

Watchers

 avatar

movies-explorer-api's Issues

🗄️ Level-1: deploy

  • 1) set-up the server
  • 2) create a domain (movies-explorer.nomoreparties.co/api.) necessary with api
  • 3) certificates
  • 4) .env-file (NODE_ENV=production, JWT_SECRET, process.env.NODE_ENV !== 'production')
    в папке back на сервере touch .env
  • 5) add a domain at README.md

🗄️ Level-1: init the project

  • make a new branch 'level-1'

  • init package.json
    - scripts
    1) dev with hot-reload
    2) start without hot-reload

  • add:

    • 📁 middlewares
    • 📁 constants
    • 📁 models, controllers, routes
    • .gitignore
    • .editorconfig
    • .eslintrc расширяющий конфигурацию airbnb-base, а также необходимые для работы линтера dev-зависимости;
  • install

  1. express
  2. mongoose
  3. nodemon (dev)
  4. eslint (dev) - 3 dependencies
  5. winston - 2 dependencies
  6. bcryptjs
  7. body-parser
  8. jsonwebtoken
  9. celebrate
  10. validator
  • fill with basic code app.js
    use localhost:3000
    database : bitfilmsdb

🗄️ Level-1: create routes

users.js

  • GET /users/me возвращает информацию о пользователе (email и имя);

  • PATCH /users/me — обновляет информацию о пользователе;

movies.js

  • GET /movies все сохранённые пользователем фильмы;

  • POST /movies создаёт фильм с переданными в теле данными;

  • DELETE /movies/_id удаляет сохранённый фильм по _id;

index.js

Все роуты подключены в файле index.js, который находится в 📁 routes. Оттуда единый роут подключается в файле app.js

🗄️ Level-1: handle errors

  • create classes which extend class Error for codes:
    400, 401, 403, 404, 409

  • codes & messages constants

  • middleware error for code 500

🗄️ Level-1: create models

  • user
  1. email (required, unique, validation)
  2. password — hash-password. (required, string, select: false)
  3. name — (required, string, min 2 , max 30)
  • movie
    country — required string
    director — required string
    duration — required (number)число.
    year — год выпуска фильма. Обязательное поле-строка.
    description — required string.
    image — ссылка на постер к фильму. Обязательное поле-строка. Запишите её URL-адресом.
    trailerLink — ссылка на трейлер фильма. Обязательное поле-строка. Запишите её URL-адресом.
    thumbnail — миниатюрное изображение постера к фильму. Обязательное поле-строка. Запишите её URL-адресом.
    owner — _id пользователя, который сохранил фильм. Обязательное поле.
    movieId — id фильма, который содержится в ответе сервиса MoviesExplorer. Обязательное поле.
    nameRU — название фильма на русском языке. Обязательное поле-строка.
    nameEN — название фильма на английском языке. Обязательное поле-строка.

🗄️ Level-1: validation

  • validatin consts:
  1. validateSignin,
  2. validateSignup,
  3. validateUpdateUser
  4. validateAddMovie
  • import in routes

  • use central processing in app.js

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.