Skip to content

gitpod-samples/private-market-hub

Repository files navigation

PrivateMarketHub

A comprehensive private market transactions management platform demonstrating modern microservices architecture.

Architecture

  • Frontend: React 18 + TypeScript + Vite
  • Backend: .NET Core 8.0 Web API
  • Analytics Service: Python FastAPI with ML-based risk analysis
  • Database: PostgreSQL 16

Features

  • Portfolio management
  • Transaction tracking (buy/sell)
  • Real-time risk assessment using ML algorithms
  • Portfolio analytics and valuation
  • RESTful API with Swagger documentation
  • Comprehensive unit test coverage
  • Docker containerization
  • Kubernetes deployment with Helm charts

Quick Start

Using Docker Compose

# Start all services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop all services
docker-compose down

Access the application:

Using k3d (Kubernetes)

# First time setup
./k8s/k3d-setup.sh

# Start cluster
./k8s/k3d-start.sh

# Stop cluster
./k8s/k3d-stop.sh

Access the application:

Note: Docker Compose and k3d use different ports, so both can run simultaneously without conflicts.

Manual Setup

Prerequisites

  • .NET SDK 8.0
  • Python 3.11+
  • Node.js 20+
  • PostgreSQL 16

Database Setup

# Start PostgreSQL
docker run -d \
  --name privatemarkets-db \
  -e POSTGRES_DB=privatemarkets \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  -p 5432:5432 \
  postgres:16-alpine

# Initialize schema
psql -h localhost -U postgres -d privatemarkets -f database/init/01-schema.sql
psql -h localhost -U postgres -d privatemarkets -f database/init/02-seed-data.sql

Backend (.NET)

cd backend/PrivateMarketHub.API
dotnet restore
dotnet run

Analytics Service (Python)

cd analytics
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 8000

Frontend (React)

cd frontend
npm install
npm run dev

Testing

Backend Tests

cd backend/PrivateMarketHub.Tests
dotnet test

Analytics Tests

cd analytics
pytest

Frontend Tests

cd frontend
npm test

Kubernetes Deployment

See k8s/README.md for Kubernetes deployment instructions.

# Install with Helm
helm install privatemarkets ./k8s/helm/privatemarkets

Project Structure

.
├── backend/                    # .NET Core API
│   ├── PrivateMarketHub.API/  # Main API project
│   └── PrivateMarketHub.Tests/# Unit tests
├── analytics/                  # Python analytics service
│   ├── app/                   # Application code
│   └── tests/                 # Unit tests
├── frontend/                   # React frontend
│   ├── src/                   # Source code
│   └── public/                # Static assets
├── database/                   # Database scripts
│   └── init/                  # Initialization SQL
├── k8s/                       # Kubernetes manifests
│   └── helm/                  # Helm charts
├── docker-compose.yml         # Docker Compose config
└── .devcontainer/             # Dev Container config

API Documentation

Once the backend is running, visit:

Development

This project includes a DevContainer configuration for consistent development environments.

Using DevContainer

  1. Open in VS Code
  2. Install "Dev Containers" extension
  3. Click "Reopen in Container"
  4. Run docker-compose up inside the container

License

MIT License - see LICENSE file for details

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •