GithubHelp home page GithubHelp logo

richardtjokroutomo / stockapi Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3.96 MB

an API that keeps all the information about your stock investments

C# 97.06% Dockerfile 2.94%
api-rest asp-net dependency-injection mvc-architecture

stockapi's Introduction

Stock API

stock API allows users to store their stock portfolio in MongoAtlas. It is designed for any client who needs data on their stock portfolio to be displayed on the front-end side (but you still need to host it somewhere)

Description

The purpose of this project is for me to learn and practice:

  • ASP.NET webAPI (version 7.0.102)
  • MVC Architectural pattern
  • Dependency injection design patterns
  • Designing RESTFUL APIs, along with proper HTTP responses for each requests.
  • C#

Here are the commands available to the user:

API Commands

A sample output from HTTP GET /:

[
    {
        "mongoId": "63c7e977af3626a9af2cb412",
        "id": 1,
        "tickerCode": "MSFT",
        "price": 690,
        "quantity": 6900
    },
    {
        "mongoId": "63c8d317e9d4734edc9f471f",
        "id": 2,
        "tickerCode": "TSLA",
        "price": 200,
        "quantity": 2500
    }
]

for POST and PUT request, the user is required to put a JSON file in the HTTP body. The format is as follows:

{
    "tickerCode": STOCK_TICKER_CODE,
    "price": PRICE_OF_THE_STOCK,
    "quantity": QUANTITY
}
  • STOCK_TICKER_CODE is string
  • PRICE_OF_THE_STOCK is double
  • QUANTITY is double

Demo

Due to my inability to find a site to host the API for free (I am not eligible for Azure student account and their free trial for some reason), Here is a link for the video demo

update: I deployed it on AWS Elastic Beanstalk, but it won't work after a year since my free trial will run out api root url

Setup

to run this code yourself locally:

  1. make sure you have ASP.NET version 7.0.102 installed
  2. clone this repository
  3. in the appsettings.json, change the "ConnectionURI" to your mongoAtlas URL link
  4. in your command prompt, cd into the file directory and use the command dotnet run

stockapi's People

Contributors

richardtjokroutomo 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.