Coder Social home page Coder Social logo

meetup-clone-project's Introduction

Meetup Clone Application

Database Schema Design

Db Schema

API Documentation

All endpoints that require authentication

All endpoints that require a current user to be logged in.

  • Request: endpoints that require authentication

  • Error Response: Require authentication

    • Status Code: 401

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Authentication required",
        "statusCode": 401
      }

All endpoints that require proper authorization

All endpoints that require authentication and the current user does not have the correct role(s) or permission(s).

  • Request: endpoints that require proper authorization

  • Error Response: Require proper authorization

    • Status Code: 403

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Forbidden",
        "statusCode": 403
      }

Get the Current User

Returns the information about the current user that is logged in.

  • Require Authentication: true

  • Request

    • Method: GET
    • URL: /session
    • Body: none
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "id": 1,
        "firstName": "John",
        "lastName": "Smith",
        "email": "[email protected]"
      }

Log In a User

Logs in a current user with valid credentials and returns the current user's information.

  • Require Authentication: false

  • Request

    • Method: POST

    • URL: /session

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "email": "[email protected]",
        "password": "secret password"
      }
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "id": 1,
        "firstName": "John",
        "lastName": "Smith",
        "email": "[email protected]",
        "token": ""
      }
  • Error Response: Invalid credentials

    • Status Code: 401

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Invalid credentials",
        "statusCode": 401
      }
  • Error response: Body validation errors

    • Status Code: 400

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Validation error",
        "statusCode": 400,
        "errors": {
          "email": "Email is required",
          "password": "Password is required"
        }
      }

Sign Up a User

Creates a new user, logs them in as the current user, and returns the current user's information.

  • Require Authentication: false

  • Request

    • Method: POST

    • URL: /users

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "firstName": "John",
        "lastName": "Smith",
        "email": "[email protected]",
        "password": "secret password"
      }
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "id": 1,
        "firstName": "John",
        "lastName": "Smith",
        "email": "[email protected]",
        "token": ""
      }
  • Error response: User already exists with the specified email

    • Status Code: 403

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "User already exists",
        "statusCode": 403,
        "errors": {
          "email": "User with that email already exists"
        }
      }
  • Error response: Body validation errors

    • Status Code: 400

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Validation error",
        "statusCode": 400,
        "errors": {
          "email": "Invalid email",
          "firstName": "First Name is required",
          "lastName": "Last Name is required"
        }
      }

Get all Groups

Returns all the groups.

  • Require Authentication: false

  • Request

    • Method: GET
    • URL: /groups
    • Body: none
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "Groups": [
          {
            "id": 1,
            "organizerId": 1,
            "name": "Evening Tennis on the Water",
            "about": "Enjoy rounds of tennis with a tight-nit group of people on the water facing the Brooklyn Bridge. Singles or doubles.",
            "type": "In person",
            "private": true,
            "city": "New York",
            "state": "NY",
            "createdAt": "2021-11-19 20:39:36",
            "updatedAt": "2021-11-19 20:39:36",
            "numMembers": 10,
            "previewImage": "image url"
          }
        ]
      }

Get all Groups joined or organized by the Current User

Returns all the groups.

  • Require Authentication: true

  • Request

    • Method: GET
    • URL: /user/groups
    • Body: none
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "Groups": [
          {
            "id": 1,
            "organizerId": 1,
            "name": "Evening Tennis on the Water",
            "about": "Enjoy rounds of tennis with a tight-nit group of people on the water facing the Brooklyn Bridge. Singles or doubles.",
            "type": "In person",
            "private": true,
            "city": "New York",
            "state": "NY",
            "createdAt": "2021-11-19 20:39:36",
            "updatedAt": "2021-11-19 20:39:36",
            "numMembers": 10,
            "previewImage": "image url"
          }
        ]
      }

Get details of a Group from an id

Returns the details of a group specified by its id.

  • Require Authentication: false

  • Request

    • Method: GET
    • URL: /groups/:groupId
    • Body: none
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "id": 1,
        "organizerId": 1,
        "name": "Evening Tennis on the Water",
        "about": "Enjoy rounds of tennis with a tight-nit group of people on the water facing the Brooklyn Bridge. Singles or doubles.",
        "type": "In person",
        "private": true,
        "city": "New York",
        "state": "NY",
        "createdAt": "2021-11-19 20:39:36",
        "updatedAt": "2021-11-19 20:39:36",
        "numMembers": 10,
        "images": ["image url"],
        "previewImage": "/images/my_image.png",
        "Organizer": {
          "id": 1,
          "firstName": "John",
          "lastName": "Smith"
        }
      }
  • Error response: Couldn't find a Group with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Group couldn't be found",
        "statusCode": 404
      }

Create a Group

Creates and returns a new group.

  • Require Authentication: true

  • Request

    • Method: /POST

    • URL: /groups

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "name": "Evening Tennis on the Water",
        "about": "Enjoy rounds of tennis with a tight-nit group of people on the water facing the Brooklyn Bridge. Singles or doubles.",
        "type": "In person",
        "private": true,
        "city": "New York",
        "state": "NY"
      }
  • Successful Response

    • Status Code: 201

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "id": 1,
        "organizerId": 1,
        "name": "Evening Tennis on the Water",
        "about": "Enjoy rounds of tennis with a tight-nit group of people on the water facing the Brooklyn Bridge. Singles or doubles.",
        "type": "In person",
        "private": true,
        "city": "New York",
        "state": "NY",
        "createdAt": "2021-11-19 20:39:36",
        "updatedAt": "2021-11-19 20:39:36"
      }
  • Error Response: Body validation error

    • Status Code: 400

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Validation Error",
        "statusCode": 400,
        "errors": {
          "name": "Name must be 60 characters or less",
          "about": "About must be 50 characters or more",
          "type": "Type must be Online or In person",
          "private": "Private must be a boolean",
          "city": "City is required",
          "state": "State is required"
        }
      }

Edit a Group

Updates and returns an existing group.

  • Require Authentication: true

  • Require proper authorization: Group must belong to the current user

  • Request

    • Method: PATCH

    • URL: /groups/:groupId

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "name": "Evening Tennis on the Water",
        "about": "Enjoy rounds of tennis with a tight-nit group of people on the water facing the Brooklyn Bridge. Singles or doubles.",
        "type": "In person",
        "private": true,
        "city": "New York",
        "state": "NY"
      }
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "id": 1,
        "organizerId": 1,
        "name": "Evening Tennis on the Water",
        "about": "Enjoy rounds of tennis with a tight-nit group of people on the water facing the Brooklyn Bridge. Singles or doubles.",
        "type": "In person",
        "private": true,
        "city": "New York",
        "state": "NY",
        "createdAt": "2021-11-19 20:39:36",
        "updatedAt": "2021-11-20 10:06:40"
      }
  • Error Response: Body validation error

    • Status Code: 400

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Validation Error",
        "statusCode": 400,
        "errors": {
          "name": "Name must be 60 characters or less",
          "about": "About must be 50 characters or more",
          "type": "Type must be Online or In person",
          "private": "Private must be a boolean",
          "city": "City is required",
          "state": "State is required"
        }
      }
  • Error response: Couldn't find a Group with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Group couldn't be found",
        "statusCode": 404
      }

Delete a Group

Deletes an existing group.

  • Require Authentication: true

  • Require proper authorization: Group must belong to the current user

  • Request

    • Method: DELETE
    • URL: /groups/:groupId
    • Body: none
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Successfully deleted",
        "statusCode": 200
      }
  • Error response: Couldn't find a Group with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Group couldn't be found",
        "statusCode": 404
      }

Get all Members of a Group specified by its id

Returns the members of a group specified by its id.

  • Require Authentication: false

  • Request

    • Method: GET
    • URL: /groups/:groupId/members
    • Body: none
  • Successful Response: If you ARE the organizer of the group. Shows all members, regardless of their status, and their status.

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "Members": [
          {
            "id": 2,
            "firstName": "Clark",
            "lastName": "Adams",
            "Membership": {
              "status": "co-host"
            }
          },
          {
            "id": 3,
            "firstName": "John",
            "lastName": "Smith",
            "Membership": {
              "status": "member"
            }
          },
          {
            "id": 4,
            "firstName": "Jane",
            "lastName": "Doe",
            "Membership": {
              "status": "pending"
            }
          }
        ]
      }
  • Successful Response: If you ARE NOT the organizer of the group. Shows all members that don't have a status of "pending".

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "Members": [
          {
            "id": 2,
            "firstName": "Clark",
            "lastName": "Adams",
            "Membership": {
              "status": "co-host"
            }
          },
          {
            "id": 3,
            "firstName": "John",
            "lastName": "Smith",
            "Membership": {
              "status": "member"
            }
          }
        ]
      }
  • Error response: Couldn't find a Group with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Group couldn't be found",
        "statusCode": 404
      }

Request a Membership for a Group based on the Group's id

Request a new membership for a group specified by id.

  • Require Authentication: true

  • Request

    • Method: POST
    • URL: /groups/:groupId/join
    • Headers:
      • Content-Type: application/json
    • Body: none
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "groupId": 1,
        "memberId": 2,
        "status": "pending"
      }
  • Error response: Couldn't find a Group with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Group couldn't be found",
        "statusCode": 404
      }
  • Error response: Current User already has a pending membership for the group

    • Status Code: 400

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Membership has already been requested",
        "statusCode": 400
      }
  • Error response: Current User is already an accepted member of the group

    • Status Code: 400

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "User is already a member of the group",
        "statusCode": 400
      }

Change the status of a membership for a group specified by id

Change the status of a membership for a group specified by id.

  • Require Authentication: true

  • Require proper authorization: Current User must already be the organizer or have a membership to the group with the status of "co-host"

  • Request

    • Method: PATCH

    • URL: /groups/:groupId/members

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "memberId": 2,
        "status": "member"
      }
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "id": 1,
        "groupId": 1,
        "memberId": 2,
        "status": "member"
      }
  • Error response: Couldn't find a Group with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Group couldn't be found",
        "statusCode": 404
      }
  • Error response: If changing the status to "co-host" and Current User is not the organizer.

    • Status Code: 403

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Current User must be the organizer to add a co-host",
        "statusCode": 403
      }
  • Error response: If changing the status to "member" and Current User is not the organizer of the group or a member of the group with a status of "co-host".

    • Status Code: 400

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Current User must be the organizer or a co-host to make someone a member",
        "statusCode": 400
      }
  • Error response: If changing the membership status to "pending".

    • Status Code: 400

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Cannot change a membership status to pending",
        "statusCode": 400
      }
  • Error response: If membership does not exist

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Membership between the user and the group does not exits",
        "statusCode": 404
      }

Delete membership to a group specified by id

Delete a membership to a group specified by id.

  • Require Authentication: true

  • Require proper authorization: Current User must be the host of the group, or the user whose membership is being deleted

  • Request

    • Method: DELETE
    • URL: /groups/:groupId/members/:memberId
    • Headers:
      • Content-Type: application/json
    • Body: none
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Successfully deleted membership from group"
      }
  • Error response: Couldn't find a Group with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Group couldn't be found",
        "statusCode": 404
      }

Get all Events

Returns all the events.

  • Require Authentication: false

  • Request

    • Method: GET
    • URL: /events
    • Body: none
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "Events": [
          {
            "id": 1,
            "groupId": 1,
            "venueId": null,
            "name": "Tennis Group First Meet and Greet",
            "type": "Online",
            "startDate": "2021-11-19 20:00:00",
            "numAttending": 8,
            "previewImage": "image url",
            "Group": {
              "id": 1,
              "name": "Evening Tennis on the Water",
              "city": "New York",
              "state": "NY"
            },
            "Venue": null
          },
          {
            "id": 1,
            "groupId": 1,
            "venueId": 1,
            "name": "Tennis Singles",
            "type": "In Person",
            "startDate": "2021-11-20 20:00:00",
            "numAttending": 4,
            "previewImage": "image url",
            "Group": {
              "id": 1,
              "name": "Evening Tennis on the Water",
              "city": "New York",
              "state": "NY"
            },
            "Venue": {
              "id": 1,
              "city": "New York",
              "state": "NY"
            }
          }
        ]
      }

Get all Events of a Group specified by its id

Returns all the events of a group specified by its id

  • Require Authentication: false

  • Request

    • Method: GET
    • URL: /groups/:groupId/events
    • Body: none
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "Events": [
          {
            "id": 1,
            "groupId": 1,
            "venueId": null,
            "name": "Tennis Group First Meet and Greet",
            "type": "Online",
            "startDate": "2021-11-19 20:00:00",
            "numAttending": 8,
            "previewImage": "image url",
            "Group": {
              "id": 1,
              "name": "Evening Tennis on the Water",
              "city": "New York",
              "state": "NY"
            },
            "Venue": null
          },
          {
            "id": 1,
            "groupId": 1,
            "venueId": 1,
            "name": "Tennis Singles",
            "type": "In Person",
            "startDate": "2021-11-20 20:00:00",
            "numAttending": 4,
            "previewImage": "image url",
            "Group": {
              "id": 1,
              "name": "Evening Tennis on the Water",
              "city": "New York",
              "state": "NY"
            },
            "Venue": {
              "id": 1,
              "city": "New York",
              "state": "NY"
            }
          }
        ]
      }
  • Error response: Couldn't find a Group with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Group couldn't be found",
        "statusCode": 404
      }

Get details of an Event specified by its id

Returns the details of an event specified by its id.

  • Require Authentication: false

  • Request

    • Method: GET
    • URL: /events/:eventId
    • Body: none
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "id": 1,
        "groupId": 1,
        "venueId": 1,
        "name": "Tennis Group First Meet and Greet",
        "description": "First meet and greet event for the evening tennis on the water group! Join us online for happy times!",
        "type": "Online",
        "capacity": 10,
        "price": 18.5,
        "startDate": "2021-11-19 20:00:00",
        "endDate": "2021-11-19 21:00:00",
        "numAttending": 8,
        "Group": {
          "id": 1,
          "name": "Evening Tennis on the Water",
          "private": true,
          "city": "New York",
          "state": "NY"
        },
        "Venue": {
          "id": 1,
          "address": "123 Disney Lane",
          "city": "New York",
          "state": "NY",
          "lat": 37.7645358,
          "lng": -122.4730327
        },
        "images": ["image url"]
      }
  • Error response: Couldn't find a Event with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Event couldn't be found",
        "statusCode": 404
      }

Create a new Venue for a Group specified by its id

Creates and returns a new venue for a group specified by its id

  • Require Authentication: true

  • Require Authentication: Current User must be the organizer of the group or a member of the group with a status of "co-host"

  • Request

    • Method: POST
    • URL: /groups/:groupId/venues
    • Headers:
      • Content-Type: application/json
    • Body:
    {
      "address": "123 Disney Lane",
      "city": "New York",
      "state": "NY",
      "lat": 37.7645358,
      "lng": -122.4730327
    }
  • Successful Response

    • Status Code: 200
    • Headers:
      • Content-Type: application/json
    • Body:
    {
      "id": 1,
      "groupId": 1,
      "address": "123 Disney Lane",
      "city": "New York",
      "state": "NY",
      "lat": 37.7645358,
      "lng": -122.4730327
    }
  • Error response: Couldn't find a Group with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Group couldn't be found",
        "statusCode": 404
      }
  • Error Response: Body validation errors

    • Status Code: 400

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Validation error",
        "statusCode": 400,
        "errors": {
          "address": "Street address is required",
          "city": "City is required",
          "state": "State is required",
          "lat": "Latitude is not valid",
          "lng": "Longitude is not valid"
        }
      }

Edit a Venue specified by its id

Edit a new venue specified by its id

  • Require Authentication: true

  • Require Authentication: Current User must be the organizer of the group or a member of the group with a status of "co-host"

  • Request

    • Method: PATCH
    • URL: /venues/:venueId
    • Headers:
      • Content-Type: application/json
    • Body:
    {
      "address": "123 Disney Lane",
      "city": "New York",
      "state": "NY",
      "lat": 37.7645358,
      "lng": -122.4730327
    }
  • Successful Response

    • Status Code: 200
    • Headers:
      • Content-Type: application/json
    • Body:
    {
      "id": 1,
      "groupId": 1,
      "address": "123 Disney Lane",
      "city": "New York",
      "state": "NY",
      "lat": 37.7645358,
      "lng": -122.4730327
    }
  • Error response: Couldn't find a Venue with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Venue couldn't be found",
        "statusCode": 404
      }
  • Error Response: Body validation errors

    • Status Code: 400

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Validation error",
        "statusCode": 400,
        "errors": {
          "address": "Street address is required",
          "city": "City is required",
          "state": "State is required",
          "lat": "Latitude is not valid",
          "lng": "Longitude is not valid"
        }
      }

Create an Event for a Group specified by its id

Creates and returns a new event for a group specified by its id

  • Require Authentication: true

  • Require Authorization: Current User must be the organizer of the group or a member of the group with a status of "co-host"

  • Request

    • Method: POST

    • URL: /groups/:groupId/events

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "venueId": 1,
        "name": "Tennis Group First Meet and Greet",
        "description": "Our first meet and greet for tennis group",
        "type": "Online",
        "capacity": 10,
        "price": 18.5,
        "startDate": "2021-11-19 20:00:00",
        "endDate": "2021-11-19 21:00:00"
      }
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "id": 1,
        "groupId": 1,
        "venueId": 1,
        "name": "Tennis Group First Meet and Greet",
        "description": "Our first meet and greet for tennis group",
        "type": "Online",
        "capacity": 10,
        "price": 18.5,
        "startDate": "2021-11-19 20:00:00",
        "endDate": "2021-11-19 21:00:00"
      }
  • Error Response: Body validation errors

    • Status Code: 400

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Validation error",
        "statusCode": 400,
        "errors": {
          "venueId": "Venue does not exist",
          "name": "Name must be at least 5 characters",
          "type": "Type must be Online or In person",
          "capacity": "Capacity must be an integer",
          "price": "Price is invalid",
          "description": "Description is required",
          "endDate": "End date is less than start date"
        }
      }

Edit an Event specified by its id

Edit and returns an event specified by its id

  • Require Authentication: true

  • Require Authorization: Current User must be the organizer of the group or a member of the group with a status of "co-host"

  • Request

    • Method: PATCH

    • URL: /events/:eventId

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "venueId": 1,
        "name": "Tennis Group First Meet and Greet",
        "description": "Our first meet and greet for tennis group",
        "type": "Online",
        "capacity": 10,
        "price": 18.5,
        "startDate": "2021-11-19 20:00:00",
        "endDate": "2021-11-19 21:00:00"
      }
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "id": 1,
        "groupId": 1,
        "venueId": 1,
        "name": "Tennis Group First Meet and Greet",
        "description": "Our first meet and greet for tennis group",
        "type": "Online",
        "capacity": 10,
        "price": 18.5,
        "startDate": "2021-11-19 20:00:00",
        "endDate": "2021-11-19 21:00:00"
      }
  • Error Response: Body validation errors

    • Status Code: 400

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Validation error",
        "statusCode": 400,
        "errors": {
          "venueId": "Venue does not exist",
          "name": "Name must be at least 5 characters",
          "type": "Type must be Online or In person",
          "capacity": "Capacity must be an integer",
          "price": "Price is invalid",
          "description": "Description is required",
          "endDate": "End date is less than start date"
        }
      }

Delete an Event specified by its id

Delete an event specified by its id

  • Require Authentication: true

  • Require Authorization: Current User must be the organizer of the group or a member of the group with a status of "co-host"

  • Request

    • Method: DELETE
    • URL: /events/:eventId
    • Body: none
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Successfully deleted"
      }

Get all Attendees of an Event specified by its id

Returns the attendees of an event specified by its id.

  • Require Authentication: false

  • Request

    • Method: GET
    • URL: /events/:eventId/attendees
    • Body: none
  • Successful Response: If you ARE the organizer of the group or a member of the group with a status of "co-host". Shows all attendees, regardless of their status, and their status.

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "Attendees": [
          {
            "id": 2,
            "firstName": "Clark",
            "lastName": "Adams",
            "Attendance": {
              "status": "member"
            }
          },
          {
            "id": 3,
            "firstName": "John",
            "lastName": "Smith",
            "Attendance": {
              "status": "waitlist"
            }
          },
          {
            "id": 4,
            "firstName": "Jane",
            "lastName": "Doe",
            "Attendance": {
              "status": "pending"
            }
          }
        ]
      }
  • Successful Response: If you ARE the organizer of the group or a member of the group with a status of "co-host". Shows all members that don't have a status of "pending".

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "Attendees": [
          {
            "id": 2,
            "firstName": "Clark",
            "lastName": "Adams",
            "Attendance": {
              "status": "member"
            }
          },
          {
            "id": 3,
            "firstName": "John",
            "lastName": "Smith",
            "Attendance": {
              "status": "waitlist"
            }
          }
        ]
      }
  • Error response: Couldn't find an Event with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Event couldn't be found",
        "statusCode": 404
      }

Request to Attend an Event based on the Event's id

Request attendance for an event specified by id.

  • Require Authentication: true

  • Require Authorization: Current User must be a member of the group

  • Request

    • Method: POST
    • URL: /events/:eventId/attendees
    • Headers:
      • Content-Type: application/json
    • Body: none
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "eventId": 1,
        "userId": 2,
        "status": "pending"
      }
  • Error response: Couldn't find an Event with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Event couldn't be found",
        "statusCode": 404
      }
  • Error response: Current User already has a pending attendance for the event

    • Status Code: 400

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Attendance has already been requested",
        "statusCode": 400
      }
  • Error response: Current User is already an accepted attendee of the event

    • Status Code: 400

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "User is already an attendee of the event",
        "statusCode": 400
      }

Change the status of an attendance for an event specified by id

Change the status of an attendance for an event specified by id.

  • Require Authentication: true

  • Require proper authorization: Current User must already be the organizer or have a membership to the group with the status of "co-host"

  • Request

    • Method: PATCH

    • URL: /events/:eventId/attendees

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "userId": 2,
        "status": "member"
      }
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "id": 1,
        "eventId": 1,
        "userId": 2,
        "status": "member"
      }
  • Error response: Couldn't find an Event with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Event couldn't be found",
        "statusCode": 404
      }
  • Error response: If changing the attendance status to "pending".

    • Status Code: 400

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Cannot change an attendance status to pending",
        "statusCode": 400
      }
  • Error response: If attendance does not exist

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Attendance between the user and the event does not exist",
        "statusCode": 404
      }

Delete attendance to an event specified by id

Delete a attendance to a event specified by id.

  • Require Authentication: true

  • Require proper authorization: Current User must be the host of the group, or the user whose attendance is being deleted

  • Request

    • Method: DELETE
    • URL: /events/:eventId/attendees/:attendeeId
    • Headers:
      • Content-Type: application/json
    • Body: none
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Successfully deleted attendance from event"
      }
  • Error response: Couldn't find an Event with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Event couldn't be found",
        "statusCode": 404
      }

Add an Image to a Group based on the Group's id

Create and return a new image for a group specified by id.

  • Require Authentication: true

  • Require proper authorization: Current User must be the organizer for the group

  • Request

    • Method: POST

    • URL: /groups/:groupId/images

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "url": "image url"
      }
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "id": 1,
        "itemId": 1,
        "itemType": "Group",
        "url": "image url"
      }
  • Error response: Couldn't find a Group with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Group couldn't be found",
        "statusCode": 404
      }

Add an Image to a Event based on the Event's id

Create and return a new image for an event specified by id.

  • Require Authentication: true

  • Require proper authorization: Current User must be an attendee of the event

  • Request

    • Method: POST

    • URL: /events/:eventId/images

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "url": "image url"
      }
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "id": 1,
        "itemId": 1,
        "itemType": "Event",
        "url": "image url"
      }
  • Error response: Couldn't find an Event with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Event couldn't be found",
        "statusCode": 404
      }

Delete an Image

Delete an existing image.

  • Require Authentication: true

  • Require proper authorization: Image must belong to the current user through the image's item

  • Request

    • Method: DELETE
    • URL: /images/:imageId
    • Body: none
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Successfully deleted",
        "statusCode": 200
      }
  • Error response: Couldn't find an Image with the specified id

    • Status Code: 404

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Image couldn't be found",
        "statusCode": 404
      }

Add Query Filters to Get All Events

Return events filtered by query parameters.

  • Require Authentication: false

  • Request

    • Method: GET
    • URL: /events
    • Query Parameters
      • page: integer, minimum: 0, maximum: 10, default: 0
      • size: integer, minimum: 0, maximum: 20, default: 20
      • name: string, optional
      • type: string, optional
      • startDate: string, optional
    • Body: none
  • Successful Response

    • Status Code: 200

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "Events": [
          {
            "id": 1,
            "groupId": 1,
            "venueId": null,
            "name": "Tennis Group First Meet and Greet",
            "type": "Online",
            "startDate": "2021-11-19 20:00:00",
            "numAttending": 8,
            "previewImage": "image url",
            "Group": {
              "id": 1,
              "name": "Evening Tennis on the Water",
              "city": "New York",
              "state": "NY"
            },
            "Venue": null
          },
          {
            "id": 1,
            "groupId": 1,
            "venueId": 1,
            "name": "Tennis Singles",
            "type": "In Person",
            "startDate": "2021-11-20 20:00:00",
            "numAttending": 4,
            "previewImage": "image url",
            "Group": {
              "id": 1,
              "name": "Evening Tennis on the Water",
              "city": "New York",
              "state": "NY"
            },
            "Venue": {
              "id": 1,
              "city": "New York",
              "state": "NY"
            }
          }
        ]
      }
  • Error Response: Query parameter validation errors

    • Status Code: 400

    • Headers:

      • Content-Type: application/json
    • Body:

      {
        "message": "Validation Error",
        "statusCode": 400,
        "errors": {
          "page": "Page must be greater than or equal to 0",
          "size": "Size must be greater than or equal to 0",
          "name": "Name must be a string",
          "type": "Type must be 'Online' or 'In Person'",
          "startDate": "Start date must be a valid datetime"
        }
      }

meetup-clone-project's People

Contributors

fxuls avatar

Watchers

 avatar

meetup-clone-project's Issues

Deleting an event

  • As an authenticated user who is also the organizer of the group, I want to be able to delete an event by clicking a button.
    • When I'm on the details page for an event:
      • I can click a button that allows me to remove the current event.
      • I would prefer if there was a confirmation before the event was actually deleted.

Viewing groups

  • As a user, I want to be able to see a list of all the groups.
    • When I'm on /groups/:
      • If I am authenticated, I can see a list of all the groups I am a member of.
        • If I am not a member of any groups I want to see a message saying so.
      • I can see a list of all the groups.
        • I would like some options to change the sorting or search.

Demo User

  • As an unregistered and unauthorized user, I would like an easy to find and clear button on both the /signup and /login pages to allow me to visit the site as a guest without signing up or logging in.
    • When I'm on either the /signup or /login pages:
      • I can click on a Demo User button to log me in and allow me access as a normal user.
        • So that I can test the site's features and functionality without needing to stop and enter credentials.

Log Out

  • As a logged in user, I want to log out via an easy to find log out button on the navigation bar.
    • While on any page of the site:
      • I can log out of my account and be redirected to a the homepage.
        • So that I can easily log out to keep my information secure.

Updating a group

  • As an authenticated user who is also the organizer of the group, I want to be able to update the details of my group from the group details page.
    • When I'm on /groups/:groupId:
      • I can click an "Update group" button which will redirect me to a form located at /groups/:groupId/edit.
    • When I'm on /groups/:groupId/edit:
      • I can fill out the same form as the create group with the current group details prefilled.

Group detail page

  • As a user who is not a member or organizer of the group, I want to be able to request to join the group using a button on the group detail page.

    • When I am on /groups/:groupId:
      • I can click a button that requests to join the current group.
    • When I am not authenticated and I click the button:
      • I would like to be redirected to the login page.
  • As a user who is a member of the group, I want to be able to use a "Leave group" button to leave the group.

    • When I'm on /groups/:groupId:
      • I can click a button that removes my membership from the group.
  • As a user, I want to be able to see the past and upcoming events for a group.

    • When I'm on /groups/:groupId/events:
      • I can see all the events for the group. I want to see upcoming events when the page loads, but I want a button that I can click to show all the past events instead.
  • As a user, I want to be able to see the members of this group.

    • When I'm on /groups:groupId/members:
      • I can see a list of the members of the group and the month and year of when they became a member.

Navigation

As a user, I want a navigation bar to appear at the top of the screen that is consistent across pages.

  • When I am unauthenticated, I should see a login and sign up button.
  • When I am authenticated, I should see my profile picture which links to my profile.

404 Page

  • As a user, when I try to visit a page that does not exist I want to be redirected to a 404 page

Events details page

  • As a user who is not attending the event, I want to be able to request to attend the event using a button.

    • When I am on /groups/:groupId/events/:eventId:
      • I can click a button that requests to attend the current event.
    • When I am not authenticated and I click the button I want to be redirected to the login page.
  • As a user who is attending the event, I want to be able to delete my attendance to the event using a button.

    • When I am on /groups/:groupId/events/:eventId:
      • I can click a button that removes my attendance from the event.
  • As a user I want to be able to see all the details pertaining to the event.

    • When I am on /groups/:groupId/events/:eventId:
      • I can see the event host, description, venue, and attendees.
  • As an authenticated user who is organizer or co-host, I want to be able to see all users who are both attending and requested attendance and approve, deny, and remove their attendance via buttons.

    • When I am on /groups/:groupId/events/:eventId:
      • I can see all users who are both attending and requesting attendance
      • I can approve or deny people who have requested to join
      • I can change someone's status to waitlisted or attending

Sign Up

  • As an unregistered and unauthorized user, I want to be able to sign up for the website via a sign-up form.
    • When I'm on the /signup page:
      • I would like to be able to enter my email, name, and preferred password on a clearly laid out form.
      • I would like the website to log me in upon successful completion of the sign-up form.
        • So that I can seamlessly access the site's functionality
    • When I enter invalid data on the sign-up form:
      • I would like the website to inform me of the validations I failed to pass, and repopulate the form with my valid entries (except my password).
        • So that I can try again without needing to refill forms I entered valid data into.

Viewing events

  • As a user, I want to see a list of all upcoming events.
    • When I'm on /events:
      • If I am authenticated, I can see a list of all the events belonging to groups I am a member of.
        • If there are no upcoming events in my groups I want to see a message saying so.
      • I can see a list of all the upcoming events.
        • I would like some options to change the sorting or search.

Creating events

  • As an authenticated user who is organizer or co-host, I want to be able to create events for my group.
    • When I'm on /groups/:groupId/events:
      • I can click a "New event" button which will redirect me to a form located at /groups/:groupId/events/new.
    • When I'm on /groups/:groupId/events/new:
      • I can enter the information for my new event and submit it.
      • I would like the website to redirect me to the event detail page upon successful creation.
        • So that I can review the event details as it currently exists.
    • When I enter invalid data on the form:
      • I would like to be informed of the validations I failed to pass, and repopulate the form with my valid entries.
        • So that I can attempt the form again without reentering all the information.

Log In

  • As a registered and unauthorized user, I want to be able to log in to the website via a log-in form.
    • When I'm on the /login page:
      • I would like to be able to enter my email and password on a clearly laid out form.
      • I would like the website to log me in upon successful completion of the lob-up form.
        • So that I can seamlessly access the site's functionality
    • When I enter invalid data on the log-up form:
      • I would like the website to inform me of the validations I failed to pass, and repopulate the form with my valid entries (except my password).
        • So that I can try again without needing to refill forms I entered valid data into.

Creating a group

  • As an authenticated user, I want to be able to create my own group.
    • When I'm on /groups/new:
      • I can enter the group details on a well labeled form.
      • I would like the website to redirect me to the details page of the new group upon success.
        • So that I can view what the group details looks like currently
    • When I enter invalid data on the form:
      • I would like the website to inform me of the validations I failed to pass, and repopulate the form with my valid entries (except my password).
        • So that I can attempt the form again without reentering all the information.

Readme Feedback

  • Wherever you use :id, instead use a more descriptive variable name such as :userId or :groupId (this is only in a few places in your documentation!)
  • "Get all Groups joined or organized by the Current User" and similar routes do not need "/users" in front of url
  • Wherever the :id is in the body of the request it is not also necessary in the URL
  • "Edit a Venue specified by its id" - does not need /groups/:groupsId. The venue has already been created and associated with the group. We no longer need the group to identify the venue, only the :venueId
  • Add Project Name
  • Add DB Schema

Updating an event

  • As an authenticated user who is also the organizer of the group, I want to be able to update the details of the event.
    • When I'm on the event details page:
      • I can click an "Update event" button which will redirect me to a form located at /groups/:groupId/edit.
    • When I'm on /groups/:groupId/events/:eventId/edit:
      • I can fill out the same form as the create event with the current event details prefilled.

Deleting a group

  • As an authenticated user who is also the organizer of the group, I want to be able to delete a group by clicking a delete button on the group details page.
    • When I'm on /groups/:groupId:
      • I can click "Delete group" to delete the current group.
      • I would like a confirmation box to appear to confirm the deletion.

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.