Skip to content

rtananthan/portfoliosync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PortfolioSync

A comprehensive full-stack investment tracking platform for modern investors. Sync all your investments in one intelligent dashboard.

πŸ“Έ Screenshots

Dashboard Overview

PortfolioSync Dashboard Clean, modern dashboard showing portfolio overview with real-time values and performance metrics

Stock Tracking

Stock Portfolio Management Advanced stock tracking with smart price caching, P&L calculations, and manual refresh controls

Features

  • Portfolio Management: Create and manage multiple investment portfolios
  • Multi-Asset Support: Track stocks, ETFs, and real estate properties
  • Real-time Price Updates: Automatic price updates for financial instruments
  • Performance Analytics: Detailed charts and performance metrics
  • Responsive Design: Modern UI that works on desktop and mobile

Architecture

Frontend (Next.js on S3 + CloudFront)

  • Static React application hosted on S3
  • CloudFront CDN for global distribution
  • TypeScript for type safety
  • Tailwind CSS for styling
  • Recharts for data visualization
  • React Query for state management

Backend (AWS Lambda + API Gateway)

  • Serverless functions via AWS Lambda
  • API Gateway for HTTP endpoints
  • DynamoDB for data storage
  • Scheduled price updates via EventBridge
  • RESTful API design

Project Structure

investment-tracker/
β”œβ”€β”€ README.md
β”œβ”€β”€ .env.example
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ frontend/                 # Next.js frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/       # React components
β”‚   β”‚   β”‚   β”œβ”€β”€ dashboard/    # Dashboard components
β”‚   β”‚   β”‚   β”œβ”€β”€ charts/       # Chart components
β”‚   β”‚   β”‚   β”œβ”€β”€ tables/       # Table components
β”‚   β”‚   β”‚   └── ui/           # UI components
β”‚   β”‚   β”œβ”€β”€ pages/            # Next.js pages
β”‚   β”‚   β”œβ”€β”€ hooks/            # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ services/         # API services
β”‚   β”‚   β”œβ”€β”€ utils/            # Utility functions
β”‚   β”‚   └── types/            # TypeScript types
β”‚   β”œβ”€β”€ public/               # Static assets
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ next.config.js
β”‚   └── .env.example
β”œβ”€β”€ backend/                  # AWS Lambda backend
β”‚   β”œβ”€β”€ functions/            # Lambda functions
β”‚   β”‚   β”œβ”€β”€ portfolio/        # Portfolio CRUD operations
β”‚   β”‚   β”œβ”€β”€ properties/       # Property management
β”‚   β”‚   β”œβ”€β”€ stocks/           # Stock management
β”‚   β”‚   β”œβ”€β”€ etfs/             # ETF management
β”‚   β”‚   └── prices/           # Price update functions
β”‚   β”œβ”€β”€ shared/               # Shared utilities
β”‚   β”‚   β”œβ”€β”€ database/         # Database connections
β”‚   β”‚   β”œβ”€β”€ services/         # Business logic
β”‚   β”‚   └── utils/            # Helper functions
β”‚   β”œβ”€β”€ serverless.yml        # Serverless configuration
β”‚   β”œβ”€β”€ package.json
β”‚   └── .env.example
└── scripts/                  # Setup and deployment scripts
    β”œβ”€β”€ setup.sh
    └── deploy.sh

Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn
  • AWS CLI configured with appropriate permissions
  • Serverless Framework

Installation

  1. Clone and setup the project:

    git clone <repository-url>
    cd investment-tracker
    ./scripts/setup.sh
  2. Configure AWS credentials:

    aws configure
  3. Get API keys:

  4. Deploy to AWS:

    ./scripts/deploy.sh
  5. For local development:

    # Terminal 1 - Backend
    cd backend
    npm run offline
    
    # Terminal 2 - Frontend  
    cd frontend
    npm run dev

Access the Application

Deployment

The application uses a fully serverless AWS architecture:

  • S3: Static website hosting for the frontend
  • CloudFront: CDN for global content delivery
  • API Gateway: HTTP API endpoints
  • Lambda: Serverless compute for business logic
  • DynamoDB: NoSQL database for data storage
  • EventBridge: Scheduled price updates

Automatic Deployment

# Deploy everything at once
./scripts/deploy.sh

This script will:

  1. Deploy backend infrastructure (Lambda, API Gateway, DynamoDB)
  2. Create S3 bucket and CloudFront distribution
  3. Build and deploy the frontend
  4. Configure all necessary permissions and policies

Manual Deployment

# Backend only
cd backend
serverless deploy

# Frontend only (after backend is deployed)
cd frontend
npm run build
npm run deploy

API Endpoints

Portfolios

  • GET /portfolios - List all portfolios
  • GET /portfolios/{id} - Get portfolio details
  • POST /portfolios - Create new portfolio
  • PUT /portfolios/{id} - Update portfolio
  • DELETE /portfolios/{id} - Delete portfolio

Stocks

  • GET /portfolios/{portfolioId}/stocks - List stocks in portfolio
  • POST /portfolios/{portfolioId}/stocks - Add stock to portfolio
  • PUT /stocks/{id} - Update stock
  • DELETE /stocks/{id} - Remove stock

ETFs

  • GET /portfolios/{portfolioId}/etfs - List ETFs in portfolio
  • POST /portfolios/{portfolioId}/etfs - Add ETF to portfolio
  • PUT /etfs/{id} - Update ETF
  • DELETE /etfs/{id} - Remove ETF

Properties

  • GET /portfolios/{portfolioId}/properties - List properties in portfolio
  • POST /portfolios/{portfolioId}/properties - Add property to portfolio
  • PUT /properties/{id} - Update property
  • DELETE /properties/{id} - Remove property

Prices

  • GET /prices/{symbol}/history - Get price history for symbol

Development

Frontend Development

cd frontend
npm run dev          # Start development server
npm run build        # Build for production
npm run lint         # Run ESLint
npm run type-check   # TypeScript type checking

Backend Development

cd backend
npm run offline      # Start serverless offline
npm run deploy       # Deploy to AWS
npm run remove       # Remove from AWS
npm test            # Run tests
npm run lint        # Run ESLint

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“‹ Documentation

🎯 Project Management

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •