A comprehensive, self-hosted portfolio management application designed to track your investments across multiple accounts and currencies.
- Multi-Currency Support: Track investments in their native currency and view your portfolio value in your preferred base currency (e.g., USD, CAD, INR).
- Advanced FIRE Analysis:
- "Solve for X" Simulations: Calculate the safe withdrawal rate for a specific duration or find out how long a specific rate will last.
- Inflation Adjustment: Projections account for inflation to ensure real purchasing power is maintained.
- Lifestyle Analysis: Determine the minimum monthly income required to maintain your current standard of living in retirement.
- Detailed Projections: Year-by-year breakdown of principal, gains, withdrawals, and balances.
- Deep Allocation Analysis:
- Investment Type Breakdown: Aggregate view across all asset classes with accurate currency conversion.
- Dividend Analysis: Automatic yield calculation with fallback deduction for missing data.
- Realized Gains: Tracking for sold assets and historical performance.
- Performance Tracking:
- XIRR Calculation: Accurate return on investment considering cash flows.
- Portfolio Evolution: Visualize Portfolio growth vs. average contributions over time. Visualize dividend history over time.
- Portfolio Intelligence (AI):
- Natural Language Analysis: Chat with your portfolio using advanced LLMs (Google Gemini, OpenAI, Claude).
- Deep Insights: Get personalized answers about asset allocation, risk exposure, and diversification.
- Context-Aware: The AI understands your current holdings, currency exposure, and sector breakdowns for accurate advice.
- Privacy Focused: Self-hosted solution ensures you own your financial data. AI keys are stored locally.
- Dark Mode: Sleek, eye-friendly interface.
The fastest way to get started using the official pre-built image (supports amd64 and arm64).
Prerequisites:
Steps:
-
Create a directory for the project and enter it:
mkdir portfolio-app && cd portfolio-app
-
Configure Environment: Create a
.envfile with the following content (or copy fromenv.exampleif you have the source):# Database POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres POSTGRES_DB=portfolio_db # Next Auth NEXTAUTH_URL="http://localhost:3000" NEXTAUTH_SECRET="your_secure_random_secret_here" # Generate with: openssl rand -base64 32 AUTH_TRUST_HOST=true # Seeding ADMIN_PASSWORD="admin123"
-
Create
docker-compose.yml: Create a file nameddocker-compose.ymlwith the following content:services: app: image: rajatpatel7/portfolio-app:latest container_name: portfolio-app restart: always ports: - "3000:3000" environment: - DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB} - NEXTAUTH_URL=${NEXTAUTH_URL} - NEXTAUTH_SECRET=${NEXTAUTH_SECRET} - AUTH_TRUST_HOST=true - ADMIN_PASSWORD=${ADMIN_PASSWORD} depends_on: - db networks: - portfolio-network db: image: postgres:15-alpine container_name: portfolio-db restart: always environment: - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - POSTGRES_DB=${POSTGRES_DB} volumes: - postgres_data:/var/lib/postgresql/data networks: - portfolio-network networks: portfolio-network: driver: bridge volumes: postgres_data:
-
Start the Application:
docker-compose up -d
-
Access the Dashboard: Open http://localhost:3000.
- Default Admin Credentials:
admin/admin123(or as configured in.env)
- Default Admin Credentials:
If you want to modify the code or build the image yourself.
-
Clone the repository:
git clone <your-repo-url> cd portfolio-app
-
Configure Environment:
cp env.example .env
Update
.envwith your preferred credentials if needed. -
Run with Docker Compose:
docker-compose up -d --build
For development or running without Docker.
Prerequisites:
- Node.js (v18 or higher)
- PostgreSQL database
Steps:
-
Clone and Install Dependencies:
git clone <your-repo-url> cd portfolio-app npm install
-
Configure Environment:
cp env.example .env
Update
.envwith your local PostgreSQL credentials. -
Setup Database:
npx prisma migrate dev npx prisma db seed
-
Start the Development Server:
npm run dev
- Framework: Next.js (App Router)
- Database: PostgreSQL with Prisma ORM
- Styling: CSS Modules
- Charts: Recharts & Chart.js
- Authentication: NextAuth.js
- AI Integration: Google Gemini, OpenAI, Anthropic Claude
This project makes use of the following open-source libraries:
- Next.js - The React Framework for the Web
- React - The library for web and native user interfaces
- Prisma - Next-generation Node.js and TypeScript ORM
- NextAuth.js - Authentication for Next.js
- Chart.js - Simple yet flexible JavaScript charting for designers & developers
- Recharts - Redefined chart library built with React and D3
- Framer Motion - A production-ready motion library for React
- Lucide React - Beautiful & consistent icon toolkit made by the community
- date-fns - Modern JavaScript date utility library
- yahoo-finance2 - Yahoo Finance API wrapper
- react-icons - Include popular icons in your React projects easily
MIT License
Copyright (c) 2025 rajatpatel92
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

