Skip to content

Commit de5ce0e

Browse files
committed
new frontend added
1 parent 704f7b2 commit de5ce0e

13 files changed

Lines changed: 45 additions & 21 deletions

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Referral Tracking: Dedicated page to track and manage referrals between your con
6767

6868
Self-Hosted & Private: Complete control over your data with FastAPI backend and streamlined deployment
6969

70-
Modern Tech Stack: Built with Streamlit frontend, FastAPI backend, and Pydantic models for type-safe API communication
70+
Modern Tech Stack: Built with React frontend, FastAPI backend, and Pydantic models for type-safe API communication
7171

7272
## Use Cases
7373

@@ -81,7 +81,7 @@ Modern Tech Stack: Built with Streamlit frontend, FastAPI backend, and Pydantic
8181

8282
## Tech Stack
8383

84-
- Frontend: Streamlit with PyVis for interactive network graphs
84+
- Frontend: React (Docker image hosted on Docker Hub)
8585

8686
- Backend: FastAPI with SQLAlchemy ORM
8787

@@ -99,12 +99,14 @@ Modern Tech Stack: Built with Streamlit frontend, FastAPI backend, and Pydantic
9999
openssl rand -hex 64
100100
```
101101

102-
2. Build the database, backend and frontend using the command
102+
2. Build the database and backend, and pull the frontend image using the command
103103

104104
```
105105
docker compose up --build
106106
```
107107

108+
The frontend image is pulled automatically from Docker Hub — no local build required.
109+
108110
3. Accessing the application
109111
- **Frontend**: http://localhost:8501
110112
- **Backend API**: http://localhost:8000

apps/backend/api.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"""
55
from contextlib import asynccontextmanager
66
from fastapi import FastAPI, Depends, status , Request
7+
from fastapi.middleware.cors import CORSMiddleware
78
from fastapi.responses import JSONResponse
89
from sqlalchemy import create_engine
910
from services.connectionService import ConnectionService
@@ -63,6 +64,18 @@ async def lifespan(app: FastAPI):
6364
lifespan=lifespan
6465
)
6566

67+
# Configure CORS for frontend connectivity
68+
app.add_middleware(
69+
CORSMiddleware,
70+
allow_origins=[
71+
"http://localhost:3001", # Next.js dev server
72+
"http://localhost:8501", # Streamlit (if still needed)
73+
],
74+
allow_credentials=True,
75+
allow_methods=["*"],
76+
allow_headers=["*"],
77+
)
78+
6679
# Import routers after app is created to avoid circular imports
6780

6881

docker-compose.yml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,33 @@ services:
5050
restart: unless-stopped
5151

5252
frontend:
53-
build:
54-
context: .
55-
dockerfile: apps/frontend/Dockerfile
56-
container_name: sixpath_frontend
57-
environment:
58-
# Backend API URL
59-
API_BASE_URL: ${API_BASE_URL}
60-
# Streamlit configuration
61-
STREAMLIT_SERVER_PORT: ${STREAMLIT_SERVER_PORT}
62-
STREAMLIT_SERVER_ADDRESS: ${STREAMLIT_SERVER_ADDRESS}
53+
image: deepblue597/sixpath-frontend:latest
54+
container_name: sixpath-frontend
6355
ports:
64-
- "8501:8501"
65-
networks:
66-
- sixpath_network
67-
depends_on:
68-
- backend
56+
- "3001:3000"
57+
environment:
58+
- NEXT_PUBLIC_API_URL=${API_BASE_URL}
6959
restart: unless-stopped
7060

61+
# frontend:
62+
# build:
63+
# context: .
64+
# dockerfile: apps/frontend/Dockerfile
65+
# container_name: sixpath_frontend
66+
# environment:
67+
# # Backend API URL
68+
# API_BASE_URL: ${API_BASE_URL}
69+
# # Streamlit configuration
70+
# STREAMLIT_SERVER_PORT: ${STREAMLIT_SERVER_PORT}
71+
# STREAMLIT_SERVER_ADDRESS: ${STREAMLIT_SERVER_ADDRESS}
72+
# ports:
73+
# - "8501:8501"
74+
# networks:
75+
# - sixpath_network
76+
# depends_on:
77+
# - backend
78+
# restart: unless-stopped
79+
7180
volumes:
7281
postgres_data:
7382
driver: local

packages/models/input_models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from pydantic import BaseModel
2+
from datetime import date
23

34
# Base model with common user fields
45
class UserBase(BaseModel):
@@ -10,7 +11,7 @@ class UserBase(BaseModel):
1011
phone: str | None = None
1112
linkedin_url: str | None = None
1213
how_i_know_them: str | None = None
13-
when_i_met_them: str | None = None
14+
when_i_met_them: date | str | None = None
1415
notes: str | None = None
1516

1617
# Creation of the User of the app (the authenticated owner)
@@ -34,8 +35,7 @@ class UserUpdate(BaseModel):
3435
phone: str | None = None
3536
linkedin_url: str | None = None
3637
how_i_know_them: str | None = None
37-
#TODO: change to Date type
38-
when_i_met_them: str | None = None
38+
when_i_met_them: date | str | None = None
3939
notes: str | None = None
4040

4141

static/connections.png

43 KB
Loading

static/contacts.png

-28.3 KB
Loading

static/dashboard.png

17.4 KB
Loading

static/edit_profile.png

-17.9 KB
Loading

static/graph_1.png

517 KB
Loading

static/graph_by_sector.png

-953 Bytes
Loading

0 commit comments

Comments
 (0)