Build Status

Snowmigo BE

The back-end half of a Consultancy project during weeks four and five during Mod 3 of Turing. For front-end, please visit Snowmigo.

Table of Contents
  1. About The Project
  2. Getting Started
  3. Deployment
  4. Roadmap
  5. Contributing
  6. Contact

About The Project

The goal of this project is to create a successful web application from a student-led project idea. Our team created multiple endpoints that allowed for CRUD functionality, ranging from Users and Trips information.

(back to top)

Built With

Framework

Languages

Tools

Gems


Development Principles

(back to top)

Getting Started

Installation

  1. Clone the repo
    git clone git@github.com/hschmid516/snowmigo-api.git
  2. Run bundle
    bundle install
  3. Run migrations
    rails db:{create,migrate,seed}

(back to top)

Deployment

Visit Herkou

(back to top)

Roadmap

  • GET '/api/v1/users'

    {
      "data": [
        {
          "id": "1",
          "type": "user",
          "attributes": {
            "name": "Mace Windu",
            "email": "elenora@ondricka.org",
            "exp_level": "10",
            "ski_pass": "Epic",
            "address": "Apt. 459 922 Wehner Stravenue, Lake Hoyt, GA 40829",
            "ski_or_board": "3",
            "emergency_name": "Saruman the White",
            "emergency_number": "2813308004",
            "trips": [
              {
                "data": {
                  "id": "1",
                  "type": "trip",
                  "attributes": {
                    "name": "Cool Trip Name",
                    "resort_id": null,
                    "resort_name": null,
                    "start_date": "2021-11-02",
                    "end_date": "2021-11-08",
                    "vote_status": "open",
                    "riders": [
                      {
                        "data": {
                          "id": "1",
                          "type": "rider",
                          "attributes": {
                            "user_id": 1,
                            "trip_id": 1,
                            "host": false,
                            "driver": false,
                            "budget": 25,
                            "rider_name": "Mace Windu",
                            "vote": null
                          }
                        }
                      }
                    ],
                    "resort_options": [
                      {
                        "data": {
                          "id": "1",
                          "type": "resort_option",
                          "attributes": {
                            "trip_id": 1,
                            "resort_id": 3,
                            "resort_name": "Elwanda",
                            "vote_count": 0
                          }
                        }
                      },
                      {
                        "data": {
                          "id": "2",
                          "type": "resort_option",
                          "attributes": {
                            "trip_id": 1,
                            "resort_id": 58,
                            "resort_name": "Portia",
                            "vote_count": 0
                          }
                        }
                      }
                    ]
                  }
                }
              }
            ]
          }
        },
        ...
        ...
        ...,
        {
          "id": "12",
          "type": "user",
          "attributes": {
            "name": "Obi-Wan Kenobi",
            "email": "reyes@leuschke.biz",
            "exp_level": "6",
            "ski_pass": "Ikon",
            "address": "4183 Botsford Falls, Kieraberg, MN 74214-4567",
            "ski_or_board": "2",
            "emergency_name": "Shadowfax",
            "emergency_number": "2813308004",
            "trips": [
              {
                "data": {
                  "id": "201",
                  "type": "trip",
                  "attributes": {
                    "name": "trip",
                    "resort_id": 909002,
                    "resort_name": null,
                    "start_date": "2021-11-11",
                    "end_date": "2021-11-13",
                    "vote_status": "closed",
                    "riders": [
                      {
                        "data": {
                          "id": "191",
                          "type": "rider",
                          "attributes": {
                            "user_id": 8,
                            "trip_id": 201,
                            "host": true,
                            "driver": null,
                            "budget": null,
                            "rider_name": "Henry Schmid",
                            "vote": 909002
                          }
                        }
                      },
                    ],
                    "resort_options": []
                  }
                }
              }
            ],
            "friends": [
              {
                "data": {
                  "id": "2",
                  "type": "friendship",
                  "attributes": {
                    "user_id": 2,
                    "friend_id": 1,
                    "friend_name": "Mace Windu"
                  }
                }
              }
            ]
          }
        }
      ]
    }
  • GET '/api/v1/users/{:id}'

    {
      "data": {
        "id": "2",
        "type": "user",
        "attributes": {
          "name": "Obi-Wan Kenobi",
          "email": "reyes@leuschke.biz",
          "exp_level": "6",
          "ski_pass": "Ikon",
          "address": "4183 Botsford Falls, Kieraberg, MN 74214-4567",
          "ski_or_board": "2",
          "emergency_name": "Shadowfax",
          "emergency_number": "2813308004",
          "trips": [
            {
              "data": {
                "id": "201",
                "type": "trip",
                "attributes": {
                    "name": "trip",
                    "resort_id": 909002,
                    "resort_name": null,
                    "start_date": "2021-11-11",
                    "end_date": "2021-11-13",
                    "vote_status": "closed",
                    "riders": [
                      {
                        "data": {
                          "id": "191",
                          "type": "rider",
                          "attributes": {
                            "user_id": 8,
                            "trip_id": 201,
                            "host": true,
                            "driver": null,
                            "budget": null,
                            "rider_name": "Henry Schmid",
                            "vote": 909002
                          }
                        }
                      },
                      {
                        "data": {
                          "id": "196",
                          "type": "rider",
                          "attributes": {
                            "user_id": 6,
                            "trip_id": 201,
                            "host": false,
                            "driver": null,
                            "budget": null,
                            "rider_name": "Michael Osmonson",
                            "vote": null
                          }
                        }
                      },
                      {
                        "data": {
                          "id": "197",
                          "type": "rider",
                          "attributes": {
                            "user_id": 6,
                            "trip_id": 201,
                            "host": false,
                            "driver": null,
                            "budget": null,
                            "rider_name": "Michael Osmonson",
                            "vote": null
                          }
                        }
                      },
                      {
                        "data": {
                          "id": "198",
                          "type": "rider",
                          "attributes": {
                            "user_id": 1,
                            "trip_id": 201,
                            "host": false,
                            "driver": null,
                            "budget": null,
                            "rider_name": "Mace Windu",
                            "vote": null
                          }
                        }
                      },
                      {
                        "data": {
                          "id": "199",
                          "type": "rider",
                          "attributes": {
                            "user_id": 2,
                            "trip_id": 201,
                            "host": false,
                            "driver": null,
                            "budget": null,
                            "rider_name": "Obi-Wan Kenobi",
                            "vote": null
                          }
                        }
                      }
                    ],
                  "resort_options": []
                }
              }
            }
          ],
          "friends": [
            {
              "data": {
                "id": "2",
                "type": "friendship",
                "attributes": {
                  "user_id": 2,
                  "friend_id": 1,
                  "friend_name": "Mace Windu"
                }
              }
            }
          ]
        }
      }
    }
  • GET 'api/v1/trips'

    {
      "data": [
        {
          "id": "1",
          "type": "trip",
          "attributes": {
            "name": "Cool Trip Name",
            "resort_id": null,
            "resort_name": null,
            "start_date": "2021-11-02",
            "end_date": "2021-11-08",
            "vote_status": "open",
            "riders": [
              {
                "data": {
                  "id": "1",
                  "type": "rider",
                  "attributes": {
                    "user_id": 1,
                    "trip_id": 1,
                    "host": false,
                    "driver": false,
                    "budget": 25,
                    "rider_name": "Mace Windu",
                    "vote": null
                  }
                }
              },
              {
                "data": {
                  "id": "189",
                  "type": "rider",
                  "attributes": {
                    "user_id": 1,
                    "trip_id": 1,
                    "host": false,
                    "driver": null,
                    "budget": null,
                    "rider_name": "Mace Windu",
                    "vote": null
                  }
                }
              }
            ],
            "resort_options": [
              {
                "data": {
                  "id": "1",
                  "type": "resort_option",
                  "attributes": {
                    "trip_id": 1,
                    "resort_id": 3,
                    "resort_name": "Elwanda",
                    "vote_count": 0
                  }
                }
              },
              {
                "data": {
                  "id": "2",
                  "type": "resort_option",
                  "attributes": {
                    "trip_id": 1,
                    "resort_id": 58,
                    "resort_name": "Portia",
                    "vote_count": 0
                  }
                }
              }
            ]
          }
        },
        ...
        ...
        ...,
        {
          "id": "100",
          "type": "trip",
          "attributes": {
            "name": "Happy fun time",
            "resort_id": null,
            "resort_name": null,
            "start_date": "2021-11-08",
            "end_date": "2021-11-25",
            "vote_status": "open",
            "riders": [
              {
                "data": {
                  "id": "76",
                  "type": "rider",
                  "attributes": {
                    "user_id": 10,
                    "trip_id": 100,
                    "host": true,
                    "driver": null,
                    "budget": null,
                    "rider_name": "Freddie Mercury",
                    "vote": null
                  }
                }
              }
            ],
            "resort_options": [
              {
                "data": {
                  "id": "31",
                  "type": "resort_option",
                  "attributes": {
                    "trip_id": 100,
                    "resort_id": 303001,
                    "resort_name": "Arapahoe Basin",
                    "vote_count": 0
                  }
                }
              }
            ]
          }
        }
      ]
    }
  • GET '/api/v1/trips/{:id}'

    {
      "data": {
        "id": "41",
        "type": "trip",
        "attributes": {
          "name": "Happy fun time",
          "resort_id": null,
          "resort_name": null,
          "start_date": "2021-11-08",
          "end_date": "2021-11-25",
          "vote_status": "open",
          "riders": [],
          "resort_options": []
        }
      }
    }
  • POST '/api/v1/users'

    attributes = {
      name: STRING,
      email: STRING,
      exp_level: STRING,
      ski_pass: STRING,
      address: STRING,
      ski_or_board: STRING,
      emergency_name: STRING,
      emergency_number: STRING
    }
  • PATCH '/api/v1/users/{:id}'

    attributes = {
      name: STRING (OPTIONAL),
      email: STRING (OPTIONAL),
      exp_level: STRING (OPTIONAL),
      ski_pass: STRING (OPTIONAL),
      address: STRING (OPTIONAL),
      ski_or_board: STRING (OPTIONAL),
      emergency_name: STRING (OPTIONAL),
      emergency_number: STRING (OPTIONAL)
    }
  • DESTROY '/api/v1/users'


See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Contact

(back to top)