/TravelRating.Solution

An API that allows users to GET and POST reviews about various travel destinations around the world

Primary LanguageC#

Travel Rating API

By Benjamin Thom, Steph Podolak, Matt Taylor, & K. Wicz

Description

An ASP.NET API that allows users to read and write reviews about travel destinations around the world, categorized by city and country.

Setup/Installation Requirements

1. Install .NET Core

on macOS:

  • Click here to download a .NET Core SDK from Microsoft Corp.

on Windows:

  • Click here to download the 64-bit .NET Core SDK from Microsoft Corp.

Install dotnet script

Enter the command dotnet tool install -g dotnet-script in Terminal (macOS) or PowerShell (Windows).

2. Clone this repository

Enter the following commands in Terminal (macOS) or PowerShell (Windows):

cd desktop
git clone https://github.com/kwicz/TravelRating.Solution
cd TravelRating.Solution

3. Install all necessary packages and make sure the project will build

In your terminal, type the following commands to make sure all necessary packages are included in the project and to launch in your browser:

cd TravelRating
dotnet restore
dotnet build

4. Update the database and tables

Enter the following to update your database and tables for the program:

dotnet ef database update

5. Launch the project in your browser

In your terminal, type:

dotnet watch run

Hold command while clicking the link in your local terminal to your local address, which should be:

http://127.0.0.1:5000

API Endpoints

Once you have installed this program, you can use these endpoints on your local host in your browser.

Base URL: https://localhost:5000

Users

See all users and get user authentication.

HTTP Requests

GET /users/
POST /users/authenticate

No additonal parameters for this route!

Locations

Interact with the data for travel destinations around the world.

HTTP Requests

GET /api/locations
POST /api/locations
GET /api/locations/{id}
PUT /api/locations/{id}
DELETE /api/locations/{id}

Path Parameters

Parameter Type Default Description
name string none Returns matches by destination name.
city string none Returns all destinations in specified city.
country string none Returns all destinations in specified country.

Example Query

https://localhost:5000/api/locations/?name=ha+long+bay&city=hanoi&country=vietnam

Experiences

Interact with the data for reviews that users left for different locations.

HTTP Requests

GET /api/experiences
POST /api/experiences
GET /api/experiences/{id}
PUT /api/experiences/{id}
DELETE /api/experiences/{id}

Path Parameters

Parameter Type Default Description
Author string none Returns all experiences made by review author.
Review string none Returns experience by exact review given.
Rating int none Returns all experiences with a specific rating value between 1 and 5

Example Query

https://localhost:5000/api/experiences/?author=ben&review=hanoi+is+quite+a+beaut!&rating=5

Known Bugs

No known bugs at this time.

Support and contact details

Have a bug or an issue with this application? Open a new issue here on GitHub.

Technologies Used

  • C#
  • .NET Core 2.2
  • ASP.NET Core MVC
  • MySQL 2.2.0
  • EF Core 2.2.0
  • ASP.NET Core Identity
  • Razor 2.2.0
  • ASP.NET Core JSON Web Token Authentication & Authorization
  • NSwag 13.3.0
  • Postman

License

MIT

Copyright (c) 2020 K Wicz, Benjamin Thom, Matt Taylor, Steph Podolak