Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

114 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stock Ticker API

TypeScript Node.js Azure Functions Jest

Build Status Code Coverage

This project is the powerhouse behind the StockQuotes.React application, providing real-time financial data through a robust and scalable API. If you're looking for a modern, well-structured, and easy-to-contribute-to financial data API, you've come to the right place!

🚀 Project Overview

This API serves as a dedicated backend for the StockQuotes.React frontend, delivering up-to-date stock prices and exchange rates. It's built with TypeScript and Azure Functions, ensuring a scalable and maintainable codebase.

✨ Features

  • Real-time Stock Data: Fetches stock quotes from Yahoo Finance.
  • Exchange Rates: Retrieves daily euro exchange rates from the European Central Bank.
  • Rate Limiting: Protects the API from abuse with a custom in-memory rate limiter.
  • Clean Architecture: Follows a service-oriented architecture, making it easy to understand and extend.
  • Fully Tested: Comes with a comprehensive test suite using Jest.
  • Modern Tooling: Uses ESLint and Prettier for consistent code quality.
  • Automated Docker Builds: Docker images are automatically built and published to Docker Hub.
  • Vulnerability Scanning: Published Docker containers are scanned for security vulnerabilities.

🛠️ Getting Started

Prerequisites

Installation

  1. Clone this repository:
    git clone https://github.com/LionelSCHIEPERS/StockQuotes.API.git
  2. Navigate to the project directory:
    cd StockQuotes.API
  3. Install the dependencies:
    pnpm install

Running Locally

  1. Build the project:
    pnpm run build
  2. Start the Azure Functions host:
    pnpm start

The API will then be available at the following endpoints:

  • Yahoo Finance: http://localhost:7071/api/yahoo-finance
  • ECB Exchange Rates: http://localhost:7071/api/exchange-rate-ecb

🧪 Testing

This project uses Jest for both unit and integration tests.

  • Run all tests:
    pnpm test
  • Run tests in watch mode:
    pnpm test -- --watch

💻 Development

We follow a set of development conventions to ensure a high-quality codebase.

  • TypeScript: The entire project is written in TypeScript.
  • Service-Oriented Architecture: Business logic is encapsulated in services.
  • Dependency Injection: We use a simple DI container to manage service instances.
  • Linting and Formatting: We use ESLint and Prettier to maintain a consistent code style.
    • pnpm run lint
    • pnpm run format

🙌 Contributing

We welcome contributions of all kinds! Whether you're a seasoned developer or just starting, your help is valuable. Check out our contributing guidelines to get started.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages