Skip to content

klejvi-ajdini/stock-api-iterator

Repository files navigation

Stock API Iterator

Description

This Laravel application demonstrates how to use the Iterator pattern to fetch and process paginated stock market data from a simulated API (JSON files in this case). It's designed to handle scenarios where data is retrieved in chunks, and provides an efficient way to iterate over potentially large datasets.

Setup

  1. Clone the repository:

    git clone <repository-url>
    cd stock-api-iterator
  2. Install composer dependencies

    composer install
  3. Copy .env.example to .env and add your APP_URL:

    cp .env.example .env
    

    Set the APP_URL to http://localhost in your .env file.

  4. Install Sail:

    composer require laravel/sail --dev
    php artisan sail:install
  • Select 0 pgsql
  • Select ENTER to finish installation
  1. Start Sail:

    ./vendor/bin/sail up -d
  2. Generate an app key:

    ./vendor/bin/sail artisan key:generate
  3. Run Migrations

    ./vendor/bin/sail artisan migrate
  4. Install Node Packages

    npm install
  5. Run the development server for the front-end:

    npm run dev
  6. Access your Application via http://localhost

Usage

Access Stock Data

Visit /stocks/{symbol} to see stock data for the specified ticker symbol. Example: /stocks/IBM.

Access Quote Data

Visit /quote/{symbol} to see quote data for the specified ticker symbol. Example: /quote/IBM.

About

Laravel application implementing the Iterator pattern to efficiently manage and process stock data fetched from local JSON files, demonstrating API interaction and data rendering.

Topics

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors