Skip to content

Ac31415/financial_service_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Financial Service App

A full-stack MERN (MongoDB, Express, React, Node.js) application that simulates a stock trading platform. Users can manage a portfolio, trade stocks in real-time using Yahoo Finance data, track their performance, and manage a watchlist.

Features

🔐 Authentication & User Management

  • Secure Access: User registration and login using JSON Web Tokens (JWT) and bcrypt encryption.
  • Role-Based Access: Distinct interfaces for standard Users and Administrators.
  • Developer Portal: Dedicated admin dashboard to view all users, search/filter user base, and inspect individual user portfolios and transaction histories. When first setting up the app locally, the first user would be prompted to become the admin of the app.

Developer Portal Screenshot

Dev Portal User Data Screenshot

user login page

user registration page

📈 Dashboard & Portfolio

  • Portfolio Overview: Real-time view of Total Equity, Buying Power, and Cash Balance.
  • Visual Analytics:
    • Allocation Chart: Pie chart visualizing portfolio distribution across different assets.
    • Performance Chart: Line chart tracking portfolio value history over time.
  • Holdings Management: Sortable list of current stock holdings (by Symbol, Value, Quantity, etc.).
  • Fund Management: Easy-to-use mock interface for Depositing and Withdrawing funds (for testing purposes, user can just type any integer value when depositing and withdrawing cash).

Portfolio Dashboard Screenshot

💹 Stock Trading & Market Data

  • Real-Time Data: Live stock prices and company information fetched via Yahoo Finance API.
  • Interactive Charts: Dynamic stock price charts with multiple timeframes (1D, 1W, 1M, 3M, YTD, 1Y).
  • Flexible Trading:
    • Buy and Sell stocks.
    • Toggle between investing by Shares or Dollar Amount.
  • Market Hours Implementation:
    • Orders placed outside of market hours (9:30 AM - 4:00 PM ET) are automatically QUEUED.
    • Automated cron job processes queued orders when the market opens.
  • Watchlist: Personalized watchlist to track favorite stocks with real-time daily change indicators.

📜 Transaction History

  • Comprehensive Logs: Detailed record of all activities including Buys, Sells, Deposits, and Withdrawals.
  • Status Tracking: Monitor the status of orders (COMPLETED, QUEUED, FAILED).

Portfolio Dashboard Screenshot

⚙️ Technical Features

  • Docker Integration: Simplified MongoDB setup using Docker containers.
  • Automated Order Processing: Backend cron jobs handle queued orders to simulate realistic market execution.
  • Dynamic Configuration: Environment variable support for custom ports, database URIs, and secrets.

Prerequisites

Before you begin, ensure you have the following installed on your machine:

  • Node.js (v14 or higher)
  • npm (usually comes with Node.js)
  • MongoDB (Local installation or MongoDB Atlas account)

Installation & Setup

1. Clone or Download the Repository

If you haven't already, download/git clone the source code to your local machine.

2. Database Setup (Docker Option)

If you prefer using Docker instead of a local MongoDB installation, make sure to first download Docker appropriate to your platform then start up a container quickly:

docker run -d -p 27017:27017 --name financial-mongo mongo:latest

This will start a MongoDB instance accessible at mongodb://localhost:27017.

3. Server Setup

Navigate to the server directory and install dependencies:

cd server
npm install

Create a .env file in the server directory with the following variables:

PORT=5001
MONGO_URI=mongodb://localhost:27017/financial-app
JWT_SECRET=your_jwt_secret_key
  • Note: If you used the Docker command above, the MONGO_URI is already set correctly in the example.
  • Replace your_jwt_secret_key with a secure random string.

4. Client Setup

Open a new terminal, navigate to the client directory, and install dependencies:

cd client
npm install

Running the Application

You need to run both the backend server and the frontend client.

Start the Backend Server

In the server directory:

npm run dev

The server will start on http://localhost:5001.

Start the Frontend Client

In the client directory:

npm start

The application will open in your browser at http://localhost:3000.

Technologies Used

  • Frontend: React, Recharts, Context API, React Router
  • Backend: Node.js, Express, Mongoose
  • External API: yahoo-finance2
  • Authentication: JSON Web Token (JWT), Bcryptjs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published