Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🦈 FinShark - Fullstack Finance App

.NET 8 React TypeScript SQL Server TailwindCSS

A comprehensive fullstack web application that allows users to search for stock data, analyze detailed financial statements, manage personal stock portfolios, and leave insights via comments.

This project demonstrates a robust, scalable backend using the Controller -> Service -> Repository design pattern, paired with a fast, responsive frontend.

✨ Features

  • Secure Authentication: User registration and login powered by ASP.NET Core Identity and JWT Authentication.
  • In-Depth Financial Data: Integration with the Financial Modeling Prep API to display:
    • Company Profiles
    • Income Statements
    • Balance Sheets
    • Cashflow Statements
  • Portfolio Management: Authenticated users can easily add or remove specific stocks from their personal tracking portfolio.
  • Community Comments: Users can leave and read comments on individual stock pages.

πŸ› οΈ Tech Stack

Frontend (/frontend)

  • React (Vite)
  • TypeScript
  • Tailwind CSS

Backend (/Api)

  • ASP.NET Core Web API (.NET 8)
  • Entity Framework Core 8
  • MS Identity & JWT
  • Newtonsoft.Json

Database & External Services

  • Microsoft SQL Server
  • Financial Modeling Prep (FMP) API

πŸ—οΈ Architecture & Folder Structure

The application is split into two main directories. The backend utilizes a strict Controller -> Service -> Repository pattern to ensure a clean separation of concerns, making the codebase highly maintainable and testable.

Click to expand the Folder Structure
πŸ“¦ FinShark
 ┣ πŸ“‚ Api                # .NET 8 Web API Backend
 ┃ ┣ πŸ“‚ Controllers      # API Endpoints (Routing & HTTP handling)
 ┃ ┣ πŸ“‚ Data             # EF Core DbContext 
 ┃ ┣ πŸ“‚ DTOs             # Data Transfer Objects
 ┃ ┣ πŸ“‚ Extensions       # Extensions for getting ClaimPrincipal
 ┃ ┣ πŸ“‚ Helpers          # Helper classes for Query objects
 ┃ ┣ πŸ“‚ Interfaces       # Contracts for Services and Repositories
 ┃ ┣ πŸ“‚ Mappers          # Manual Mapper
 ┃ ┣ πŸ“‚ Models           # Domain Entities
 ┃ ┣ πŸ“‚ Repositories     # Direct Database Access Logic
 ┃ β”— πŸ“‚ Services         # Core Business Logic
 ┃
 β”— πŸ“‚ frontend           # React Vite Frontend
   ┣ πŸ“‚ src
   ┃ ┣ πŸ“‚ api            # Axios/Fetch calls to backend and external APIs
   ┃ ┣ πŸ“‚ components     # Reusable UI components
   ┃ ┣ πŸ“‚ Context        # Custom hooks for Registration and Login functions
   ┃ ┣ πŸ“‚ Helpers        # Number formatter and error handling
   ┃ ┣ πŸ“‚ models         # TypeScript interfaces/types
   ┃ ┣ πŸ“‚ pages          # Main routing views
   ┃ ┣ πŸ“‚ Routes         # Routers and Protected Routes
   ┃ β”— πŸ“‚ Services       # Business logic and fetching data from API

πŸš€ Getting Started

Prerequisites :

.NET 8 SDK

Node.js

SQL Server (Local or hosted)

Financial Modeling Prep API Key

Backend Setup (/Api)

  1. Navigate to the backend directory:
cd Api
  1. Update the appsettings.json file with your SQL Server connection string and API keys:
{
  "ConnectionStrings": {
    "DefaultConnection": "Server=YOUR_SERVER;Database=FinanceAppDb;Trusted_Connection=True;TrustServerCertificate=True"
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*",
  "JWT": {
    "Issuer": "https://localhost:5001",
    "Audience": "https://localhost:5001",
    "SecretKey": "YOUR_SUPER_SECRET_KEY_HERE"
  },
  "FMPKey": "YOUR_FMP_API_KEY_HERE"
}
  1. Apply Entity Framework migrations to build the database:
dotnet ef database update
  1. Run the API:
dotnet run

Frontend Setup (/frontend)

  1. Open a new terminal and navigate to the frontend directory:
cd frontend
  1. Install the necessary dependencies:
npm install
  1. Start the Vite development server:
npm run dev

πŸ—„οΈ Database Schema & Relationships

The application uses Entity Framework Core 8 to manage the database schema. Below are the core entities and how they relate to one another:

Core Entities AppUser: Inherits from ASP.NET Core IdentityUser to handle robust authentication, authorization, and user data.

Stock: Represents a financial asset tracking properties like Symbol, CompanyName, Purchase price, MarketCap, and Industry.

Comment: User-generated commentary attached to specific stocks, tracking Title, Content, and CreatedAt timestamps.

Portfolio: A join entity that explicitly manages the many-to-many relationship between Users and the Stocks they are tracking.

Relationships :

User ↔️ Portfolio ↔️ Stock (Many-to-Many): An AppUser can track many Stocks, and a Stock can be tracked by many AppUsers. The Portfolio table acts as the bridge.

User ➑️ Comment (One-to-Many): An AppUser can author multiple Comments.

Stock ➑️ Comment (One-to-Many): A Stock can have multiple Comments associated with it.

Entity-Relationship Diagram

erDiagram
    AppUser ||--o{ Portfolio : tracks
    AppUser ||--o{ Comment : writes
    Stock ||--o{ Portfolio : included_in
    Stock ||--o{ Comment : has

    AppUser {
        string Id PK
        string UserName
        string Email
    }
    Stock {
        int Id PK
        string Symbol
        string CompanyName
        decimal Purchase
        decimal LastDiv
        string Industry
        decimal MarketCap
    }
    Portfolio {
        string AppUserId FK
        int StockId FK
    }
    Comment {
        int Id PK
        string Title
        string Content
        DateTime CreatedAt
        int StockId FK
        string AppUserId FK
    }
Loading

πŸ“‘ API Endpoints

This application exposes a RESTful API built with ASP.NET Core. Below are the primary endpoints available:

πŸ” Authentication (/api/account)

Method Endpoint Description Auth Required
POST /api/account/register Registers a new user and returns a JWT No
POST /api/account/login Authenticates a user and returns a JWT No

πŸ“ˆ Portfolio (/api/portfolio)

Method Endpoint Description Auth Required
GET /api/portfolio Gets the current user's tracked stocks Yes
POST /api/portfolio?symbol={symbol} Adds a stock to the user's portfolio Yes
DELETE /api/portfolio?symbol={symbol} Removes a stock from the portfolio Yes

πŸ’¬ Comments (/api/comment)

Method Endpoint Description Auth Required
GET /api/comment?symbol={symbol} Retrieves all comments for a specific stock No
POST /api/comment/{symbol} Creates a new comment for a stock Yes
PUT /api/comment/{id} Updates an existing comment Yes
DELETE /api/comment/{id} Deletes a comment Yes

🏒 Stocks (/api/stock)

Method Endpoint Description Auth Required
GET /api/stocks Retrieves paginated list of stocks from DB Yes
GET /api/stocks/{symbol} Retrieves details for a specific stock Yes
POST /api/stocks Creates a new stock Yes

About

🦈 A high-performance Fullstack Finance Platform built with .NET 8 (Web API) and React. Features JWT Auth, EF Core, and real-time financial data integration via FMP API.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages