Skip to content

YsraelBaruk/Stock-Analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stock Tracker API

About

REST API for real-time stock data, integrated with the Alpha Vantage API. Allows fetching quotes, company overviews, price history, and managing a list of favorite stocks.

Endpoints

Method Route Description Status
GET /api/v1/stocks/{symbol} Returns the current quote for a stock
GET /api/v1/stocks/{symbol}/overview Returns general information about the company
GET /api/v1/stocks/{symbol}/history?days=30 Returns price history (default: 30 days)
POST /api/v1/stocks/favorites Adds a stock to the favorites list
GET /api/v1/stocks/favorites Lists all favorite stocks

Technologies

  • Spring Boot 4.0.3
  • Java 25
  • MySQL — primary database
  • Alpha Vantage API — market data source

Libraries

Library Purpose
Spring Web MVC REST endpoints
Spring WebFlux Reactive HTTP client (WebClient)
Spring Data JPA Data persistence
Lombok Boilerplate reduction
MySQL Driver MySQL connector
H2 Database In-memory database for development

Getting Started

Prerequisites

  • Java 25+
  • Maven 3.9+
  • MySQL running locally (or use H2 for development)
  • Alpha Vantage API key (free)

Configuration

  1. Copy the example file and create your application.properties:

    cp src/main/resources/application.example src/main/resources/application.properties
  2. Fill in the variables in application.properties:

    alpha.vantage.api.key=YOUR_API_KEY_HERE
    
    # For MySQL
    spring.datasource.url=jdbc:mysql://localhost:3306/stock_tracer_db
    spring.datasource.username=your_username
    spring.datasource.password=your_password

Running

./mvnw spring-boot:run

The application will be available at http://localhost:8080.

Usage Examples

# Current quote
GET /api/v1/stocks/AAPL

# Company overview
GET /api/v1/stocks/AAPL/overview

# Price history for the last 7 days
GET /api/v1/stocks/AAPL/history?days=7

# Add to favorites
POST /api/v1/stocks/favorites
Content-Type: application/json
{ "symbol": "AAPL" }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors