Dining Review API
Dining Review API is a basic RestAPI roughly based on the requirements given in a Milestone project in the Building REST APIs with Java and Spring Course on CodeCademy. The overall goal is to practice my skills working with the Springframework, Kotlin and Gradle.
Although I finished the course using Java as the programming language and Maven as a build tool I decided to build this project using Kotlin and since Gradle offers the possibility to write the build file in Kotlin I went with Gradle instead of Maven for the build tool.
This documentation should therefore primarily be a reference for my self - sometimes it is helpful to write stuff down - as well as a way to gain a quick overview of the project for anyone who's interested.
API Endpoints
This part will give a brief overview of the API endpoints implemented so far. By default the API will be available under Port 8080 on localhost. So the endpoint url gets added to http://localhost:8080
Public Endpoints
These Endpoints are available to everyone without creating a user account and performing a login to perform GET requests.
GET `.../api/v1/`
Returns a list of json object containing information on all the restaurants known to the API.
GET `.../api/v1/{id}`
Returns a json object containing information on the restaurant with the given ID.
GET `.../api/v1/reviews/{id}`
Returns a list of json object containing information all the approved reviews regarding the restaurant with the given ID.
POST `.../api/v1/signup`
Expects a json object as request body representing a new user. Checks if the username is available, hashes the password and creates the user account.
POST `.../api/v1/login`
Endpoints for registered users
These Endpoints are only available to users, that have a user account and can submit a valid token
Login and Authentication
Under this section I will try to explain how the Authentication for Users and Admins is handled once it is implemented.
Logging in and getting a token
...
Verifying actions with the token
...