Giter Site home page Giter Site logo

movie-flix's Introduction

Setup

  • Docker v23
  • Node v16.19.1 (through nvm)

Database

Create and run dev database:

docker run -d \
-e POSTGRES_DB=movieDB \
-e POSTGRES_USER=irfan \
-e POSTGRES_PASSWORD=123456 \
-p 5434:5432 postgres

Create and run test database:

docker run -d \
-e POSTGRES_DB=testDB \
-e POSTGRES_USER=irfan \
-e POSTGRES_PASSWORD=123456 \
-p 5435:5432 postgres

Start the development server

The backend resides in the server directory and the frontend resides in the client directory.

For backend:

cd server
npm i
npm run dev

For frontend:

cd client
npm i
npm run dev

Test

To run the test suites:

cd server
npm test

API

CRUD on movie

  • GET /movie fetch all movies
  • GET /movie/:title fetch movie with the given title
  • POST /movie create a new movie. Required fields are: title, plan, rentPeriod, rentPrice. Optional fields are: releaseYear, posterUrl, and tags. tags should be an array of strings.
  • PUT /movie/:id update movie details with given id
  • DELETE /movie/:id delete the movie with given id.

CRUD on cast

  • GET /cast fetch all casts
  • GET /cast/:name fetch cast with the given name
  • POST /cast create a new cast. The required field is: name
  • PUT /cast/:id update cast details with given id
  • DELETE /cast/:id delete the cast with given id.

CRUD on user

  • GET /user fetch all users data.
  • GET /user/:id fetch user with the given id.
  • POST /user create a new user. Required fields: name, email, password, plan
  • PUT /user/:id update the user with the given id.
  • DELETE /user/:id delete the user with the given id.

Fetch data from OMDb

  • GET /fetch?t=[title] fetch data from OMDb with given title
  • GET /fetch?i=[imdbId] fetch data from OMDb with given imdbId

Catalogue

  • GET /catalogue fetch all movies in the catalogue along with cast information.
  • GET /basic fetch all movies available in the basic plan.
  • GET /premium fetch all movies available in the premium plan.
  • POST /catalogue add a movie to catalogue. Required fields: movie, casts.
    • movie should contain required fields: title, plan, rentPeriod, rentPrice.
    • casts should be an array of cast names.

Auth

  • POST /auth/register register a user. Required fields: name, email, password, plan.
  • POST /auth/login login a user. Required fields: email, password

Rent

  • GET /rent fetch all rent data.
  • GET /rent/status check rent status for a movie and a user. Required query parameters: userId and movieId
  • GET /rent/user/:id fetch all rent data of the user with id id.
  • GET /rent/movie/:id fetch all rent data of the movie with id id.
  • POST /rent create a rent. Required fields: userId, movieId, rentPeriod, rentPrice.
  • PUT /rent update a rent. Required fields: userId and movieId.
  • DELETE /rent delete a rent. Required fields: userId and movieId.

movie-flix's People

Contributors

irfanabduhu 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.