The StockScraper application is designed to scrape financial information from Yahoo! Finance for a list of stock tickers on a given date. The application follows Domain-Driven Design (DDD) principles to ensure a clean and maintainable architecture.
-
Full Company Name: The complete name of the company.
-
Market Cap: The market capitalization of the company.
-
Year Founded: The year the company was founded.
-
Number of Employees: The total number of employees working at the company.
-
**Headquarters: The city and state, country where the company's headquarters is located.
-
Date and Time: The specific date and time for which the data is being scraped and retrieved.
-
Previous Close Price: The closing price of the stock on the provided date.
-
Open Price: The opening price of the stock on the given date.
This data is then stored in a database (MSSQL) for further use.
Domain-Driven Design is a software development approach that focuses on modeling the core business domain and its logic. It emphasizes collaboration between technical and domain experts to create a shared understanding of the problem space. Key concepts in DDD include:
-
Entities: Objects that have a distinct identity and lifecycle (e.g.,
StockInfo). -
Value Objects: Objects that are defined by their attributes and have no conceptual identity (e.g.,
MarketCap). -
Repositories: Mechanisms for retrieving and storing aggregates.
-
Services: Stateless operations that fulfill domain tasks.
The application is structured into several projects, each with a specific responsibility:
-
StockScraper.API: The entry point of the application, handling HTTP requests and responses.
-
StockScraper.Application: Contains the application logic, including commands and queries.
-
StockScraper.Contracts: Defines the interfaces and contracts used across the application.
-
StockScraper.Domain: Encapsulates the core business logic and domain models.
-
StockScraper.Infrastructure: Manages data access, external services, and configurations.
-
StockScraper.Presentation: Handles the user interface and presentation logic.
-
Docker
-
Docker Compose
-
Clone the repository to your local machine.
-
Navigate to the root folder of the project.
-
Run the following command to build and start the application using Docker:
docker-compose up --buildThis command will build the Docker images and start the containers for the application and the database.
-
The application will be accessible at
http://localhost:5001andhttp://localhost:5000. -
Use the provided API endpoints to scrape and retrieve stock information.
-
The scraped data will be stored in the database for future reference.
-
History Tab will show all previous scrapings.
src StockScraper.API StockScraper.Application StockScraper.Contracts StockScraper.Domain StockScraper.Infrastructure StockScraper.Presentation tests
The StockScraper application is a robust solution for scraping and storing financial data from Yahoo! Finance. By adhering to DDD principles and clean arhitecture, the application ensures a clear separation of concerns and maintainability. Follow the instructions above to get started with the application.