A private, self-hosted portfolio tracking application built with Next.js that allows you to monitor your investments, track performance, and analyze your portfolio using real-time market data.
- 📈 Real-time stock price tracking
- 💼 Portfolio management and performance tracking
- 📊 Investment analytics and visualization
- 🔐 Private and secure - self-hosted solution
- 🚀 Built with modern technologies (Next.js, Prisma, PostgreSQL)
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- Docker and Docker Compose
- npm or yarn package manager
This application requires API keys from the following services:
-
Alpha Vantage API
- Sign up at Alpha Vantage
- Get your API key
-
Financial Modeling Prep (FMP)
- Sign up at Financial Modeling Prep
- Get your API key
Create a .env file in the root directory with the following variables:
DATABASE_URL="postgresql://stonks:stonks123@localhost:8832/stonks"
ALPHA_VANTAGE_API_KEY="your_alpha_vantage_api_key"
FMP_API_KEY="your_fmp_api_key"- Clone the repository:
git clone <repository-url>
cd stonks- Install dependencies:
npm install
# or
yarn install- Start the PostgreSQL database using Docker:
docker-compose up -d- Run database migrations:
npx prisma generate
npx prisma migrate dev- Start the development server:
npm run dev
# or
yarn dev- Open http://localhost:3000 in your browser
- Build the application:
npm run build
# or
yarn build- Start the production server:
npm run start
# or
yarn startCommon Prisma commands you might need:
# Generate Prisma Client
npx prisma generate
# Run migrations
npx prisma migrate dev
# Reset database
npx prisma migrate reset
# Open Prisma Studio (database GUI)
npx prisma studio# Start the database
docker-compose up -d
# Stop the database
docker-compose down
# View database logs
docker-compose logs -f postgres
# Reset database volume
docker-compose down -vCreate a .env file with the following variables:
DATABASE_URL="postgresql://stonks:stonks123@localhost:8832/stonks"
ALPHA_VANTAGE_API_KEY="your_alpha_vantage_api_key"
FMP_API_KEY="your_fmp_api_key"-
If the database connection fails:
- Ensure Docker is running
- Check if the database container is up with
docker ps - Verify the DATABASE_URL in your
.envfile
-
If API calls fail:
- Verify your API keys are correctly set in the
.envfile - Check API rate limits
- Ensure you have an active internet connection
- Verify your API keys are correctly set in the
This is a private application. All rights reserved.