Git Product home page Git Product logo

imagerepositoryw22's Introduction

Image Repository REST API

For the Winter 2022 Shopify Developer Intern Challenge, I built a REST API with ASP.NET Core.

Follow the instructions in the How to run section below to get started with the application.

Link to the challenge: https://docs.google.com/document/d/1eg3sJTOwtyFhDopKedRD6142CFkDfWp1QvRKXNTPIOc

alt text

Features

  • User accounts with public/private images.
  • Create, read, update, and delete images.
  • Bulk create and delete endpoints.
  • Swagger/Open API documentation.
  • JWT authentication.
  • Argon2 password hashing.
  • Postman tests.

Technologies

  • C#/ASP.NET Core
  • Entity Framework Core
  • Swagger/Open API
  • SQLite

How to run

Here is how you can get my application running on your local machine.

Prebuilt binaries

  1. Download the latest release for your OS architecture.
  2. Extract the downloaded zip file and run the ImageRepositoryW22 executable. There are no dependencies that need to be installed. You may need to set this file as executable depending on your platform. Bypass any Windows smartscreen warnings.
  3. The application is now running. To view the endpoint documentation, navigate to https://localhost:5001/swagger. (swagger may not display properly in Firefox, try Chrome)

Tests

The tests are in the form of a Postman collection and can be downloaded on the releases page.

Running the tests

  1. Install Postman and download the latest test collection on the releases page. Download the images from the Images folder in the repository root, and place them in your Postman working directory. You can find your Postman working directory in the settings menu. (On Windows, my working directory is C:\Users\jacob\Postman\files)
  2. Start Postman and import the test collection with the import button.
  3. Ensure the Image Repository application is running.
  4. Examine the tests to understand what they are testing, then when ready, click either of the three flows then click the run button to run all the tests within that flow. The requests under the "Requests" folder are not meant to be run in the manner, rather they are sample requests for each endpoint. The tests clean up after themselves, so feel free to run them more than once. If you find you've messed up the state of the database, you can get back to a clean slate by closing the application, and deleting the app.db file, and starting the app again.

Swagger

To view the API endpoint documentation, with the app running, navigate to https://localhost:5001/swagger.

Here you will find each endpoint along with it's http method and brief description of it's function. You can click any endpoint to reveal more information about it, such as it's input and what it returns.

You can also use swagger to send http requests to the API, although it is a little clunkier than using a tool like Postman. You can call any endpoint by clicking on it, then clicking the "try it out" button, filling in any parameters or request body, then clicking execute. If an endpoint requires authorization, you can input a JWT to be passed with each request by clicking the "Authorize" button at the top right of the page, pasting your JWT, and clicking Authorize.

imagerepositoryw22's People

Contributors

jacobmichels avatar

Watchers

 avatar

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.