Code Monkey home page Code Monkey logo

fakeflix's Introduction

fakeflix

express_node

IADT CC Y4 Advanced JS CA1


Models & Endpoints:

Titles

GET

  • /all
  • /title/:type
  • /type/:type
  • /show/:show
  • /id/:id

POST

  • /create

PUT

  • /update/:id

DELETE - /delete/:id

Users

POST

  • /register
  • /login

PUT

  • /edit/:id?

DELETE

  • /delete/:id?

GET

  • /profile
  • /manageProfiles
  • /viewMyList
  • /avatars
Avatars

GET

  • /all

POST

  • /

PUT

  • /:id

DELETE

  • /:id

Features

  • Additional info API call from TVMaze: Use the ?moreDetail=true query param on the show/:id endpoint to get more detail about the show.

  • Multi-tiered user authentication:

    • User permissions object generated from maturity settings, subscription type, and user type.
    • Preliminary calls are made before each request with no filtering applied, filters are then validated against the response to let the user know why they can't access a specific resource.
    • User types are admin/user/child. Each user/child has an admin ID, tying them to an admin user. An admin can edit their sub-users (apart from changing key features like their admin ID or subscription type), and deleting themselves will cascade the delete to also remove their sub-users.
    • Only the above types have been faked, but another valid type 'database_admin' exists. This user is permitted to create, update, and delete Title listings.
  • User favourites: Each user has a favourites list tied to object IDs. This list can be populated when viewing users using the ?populate=my_list query param on the /manageProfiles endpoint.

  • User avatars: Similar to above, each user has an avatar ID tied to an avatar object. Use ?populate=avatars to populate with their real values when viewing users

  • Automated seeding:

    • Mongoose schema converted to JSON schema using mongoose-schema-jsonschema. Fake data then generated using json-schema-faker.
    • Use npm run seed to generate 10 Avatars and 100 Users, with object references between the two, and references to real Title objects in each user's 'my_list'.
    • A subset of users will be admins. Between the admins and sub-users are real object references using the 'admin_id' field.
  • A search key has been added to the database, enabling fuzzy search on the /title/:title and /show/:show endpoints. The latter also accepts IMDB IDs, which are validated.

  • Sort by, sort direction, and limit query params may be applied to all Title endpoints excluding /id/:id.

  • Stripe integration - When registering a new user, stripe customer and charge objects are generated, the correct fee is charged depending on the type of subscription the user has chosen, and stripe details are applied to the user object. The transaction is saved to my Stripe account, appearing on the dashboard.

  • Avatar images hosted on S3 bucket.

    fakeflix1fakeflix2

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.