Skip to content

TSiu88/ParkAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

Week 13 Friday Independent Assignment for Epicodus, Created: 04.03.2020

Updated with Azure deployment and modified for React on 5.12.2020

By Tiffany Siu

Project Status: Inactive – The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows. LastCommit Languages MIT license


Table of Contents

  1. Description
  2. Setup/Installation Requirements
  3. Notable Features
  4. Specifications
  5. Screenshots
  6. Known Bugs
  7. Support and Contact Details
  8. License

Description

This application is the Week 13 Friday independent assignment for Epicodus' full time Intro to Programming and C#/React course. This is an application made to show building a custom API with full functionality and include a more advanced function. It is deployed to Azure and is used with the front end application Parks-redux-api.

For this API, a user can add information and locations of parks found in the US. The parks can be stored with a name, type (national or state), description, location/city, and state. The database can be searched for these properties with the correct route structure. States can also be stored in another table in the database and also holds the number of parks that are within that state. The number of parks updates when parks are added, deleted, or modified.

Setup/Installation Requirements

This program requires .NET Core SDK to run. Here is a free tutorial for installing .NET on Mac or Windows 10 from the official website.

This program also makes use of SQL databases. We recommend using MySQL Workbench to build your databases. Here is a free tutorial for installing MySQL WorkBench and MySQL Community Server on Mac (using links Mac1 and Mac2) or Windows 10.

Requirements to Run

  • .NET Core
  • ASP.NET Core MVC
  • MySQL Workbench
  • MySQL Community Server
  • Swagger Swashbuckle
  • Entity Framework
  • Command Prompt
  • Web Browser

Instructions

This application may be viewed by:

  1. Download and install .NET Core from the official website
  2. Download and install MySQL Workbench and Community Server for Mac or Windows by following the instructions here.
  3. Click clone the repository from my GitHub page to copy the repository link
  4. Use a command line interface to type git clone (repository-link-here) to copy the project into the current folder and then move into the repository's directory that was just created with cd (project-name-here)
  5. Start up a local server by opening MySQL Workbench and adding a MySQL Connections using the default IP address and Port (IP 127.0.0.1, Port 3306), username (root), and password from setup.
  6. Run dotnet restore and dotnet build in command line interface of the repository's main project directory
  7. Run dotnet run to start up the program in the command line interface
  8. Type the URL listed under "Now listening on:" into a web browser to view the API using built in SwaggerUI or use a program like Postman to call the API and view the information returned with manual route input

Other Technologies Used

  • C#
  • HTML
  • CSS
  • Azure
  • MSTest
  • Razor
  • Markdown

Notable Features

This API updates a running count of number of parks in a state as parks are added, deleted, and modified to switch states. This README also contains multiple expandable sections and a gif file.

Specifications

Expand to view Specifications
Specification Input Output
The api displays a home screen with Swagger Application start Welcome screen displayed with all possible API calls
The api is able to show all parks when GET method is used GET http://localhost:5000/api/parks Displays all parks with info
The api is able to show all states when GET method is used GET http://localhost:5000/api/states Displays all states with info
The api is able to show all national or state parks (or other properties) when GET method is used with parameters GET http://localhost:5000/api/parks?type={national/state} Displays all national or state parks with info
The api is able to show all national or state parks (or other properties) when GET method is used with a general search GET http://localhost:5000/api/parks/search Displays all national or state parks with info matching search
The api is able to show 3 random parks when GET method GET http://localhost:5000/api/parks/random Displays 3 random parks with info
The api is able to show all parks for a state when GET method is used with multiple parameters GET http://localhost:5000/api/parks?state={stateName}&type={national/state} Displays all state parks for that state with info
The api is able to add parks with POST methods POST http://localhost:5000/api/parks Adds new park with provided info and increase count of parks for that state
The api is able to edit/update existing parks with PUT method PUT http://localhost:5000/api/{id} Update existing park with provided info and correct counts of parks for that state
The api is able to delete existing parks with DELETE method DELETE http://localhost:5000/api/{id} Delete park from database and decrease count of parks for that state

Assignment Objectives

Expand to view Assignment Objectives

At the very least, your API should include the following:

  • Full CRUD functionality.
  • Further exploration of one of the following objectives: authentication, versioning, pagination, Swagger documentation, or CORS.
  • Complete documentation of API endpoints and the further exploration you did.

Objectives:

[x] Application includes CRUD functionality and successfully returns responses to API calls.

[x] Application includes at least one of the further exploration objectives: authentication, versioning, pagination, Swagger documentation, or CORS.

[x] Application is well-documented, including specific documentation on further exploration.

[x] Commit history clearly shows eight hours of work.

Further Exploration:

Once you complete the requirements for the code review, consider adding other functionality from Monday’s Further Exploration. Get creative and add other custom routes, scopes and functionality as well. Here are a few other possibilities to consider:

  • Add a RANDOM endpoint that randomly returns a park/business/animal.
  • Add a second custom endpoint that accepts parameters. Example: a SEARCH route that allows users to search by specific park names.

User Stories

Expand to view User Stories
  • As a user of the API, I want to be able to view all parks in the system so I can have a reference to all existing parks.
  • As a user of the API, I want to be able to view all parks by state or national status so I can distinguish which ones are the larger national parks or smaller state parks with more amenities.
  • As a user of the API, I want to be able to view all parks in a state so I can distinguish which ones are nearby in the same state.
  • As a maintainer of the API database, I want to be able to add, edit, or delete parks so I can keep the database up to date with correct information.

Screenshots

Here is a snippet of what the Swagger UI looks like:

Snippet of Swagger UI

Here is a preview of what the park entries look like:

Snippet of park entries

Here is a preview of what the states entries look like:

Snippet of state entries

Expand to view More Screenshots

Here is a preview of using multiple parameters in GET method:

Snippet of GET method parameters

Known Bugs

There are currently no known bugs in this program

Support and contact details

If there are any question or concerns please contact me at my email. Thank you.

License

This software is licensed under the MIT license

Copyright (c) 2020 Tiffany Siu

About

Week 13 Friday Assignment for Epicodus, build own API, deployed and used with React project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages