Skip to content

penavincent/buvie-server

 
 

Repository files navigation

Schema

User

{
  username: {
    type: String,
    required: true,
    unique: true
    },
   password: {
    type: String,
    required: true
   },
   email: {
    type: String,
    required: true,
    unique: true,
    validate:  [validateEmail,'Validation of `{PATH}` failed with value `{VALUE}`']
   },
   genres: [
        {
            type: String
        }
   ],
   movies: [
        Ref Movie
        movieId
   ]
}

Movie

{ title: String, genre: String, poster: String }

API Overview

/api
.
├── /auth
│   └── POST
│       ├── /login
│       └── /refresh
├── /users
│   └── GET
│   └── GET/:id
│   └── POST
│       └── /
├── /

POST /api/auth/login

// req.body
{
  email: String,
  password: String
}

// res.body
{
  authToken: String
}

POST /api/auth/refresh

// req.header
Authorization: Bearer ${token}

// res.body
{
  authToken: ${token}
}

GET /api/users/

// req.query
{
  ?
}

// res.body
[
    {
        username: String,
        movies: [],
        genres: String
    }
]

GET /api/users/:id

// req.params
{
  id: ID
}

// res.body
    {
        username: String,
        movies: [],
        genres: String
    }

POST /api/users/

// req.body
{
  email: String,
  username: String,
  password: String
}

// res.body
{
  name: String,
  username: String
}

PUT /api/users/:id

// req.body
{
  genres: [String]
}

// res.body
{
   genres: [String],
   movies: [ID]
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%