Getting Started
This guide explains how to set up and run UC ORB Showcase locally.
Prerequisites
- Docker & Docker Compose (recommended setup)
- Git for cloning the repository
- PostgreSQL database (if not using Docker)
- Node.js 18+ and Python 3.9+ (for manual setup)
Docker Setup (Recommended)
-
Clone the repository:
git clone https://github.com/UC-OSPO-Network/orb-showcase.git
cd orb-showcase -
Create environment files:
Backend environment (
backend/.env
):POSTGRES_DB_URL=postgresql://postgres:orb@orb-db:5432/sample
Frontend environment (
frontend/.env
):NEXT_PUBLIC_API_URL=http://localhost:8000
-
Start the application:
docker-compose up --build
For subsequent runs (without code changes):
docker-compose up
-
Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
Manual Setup (Without Docker)
Database Setup
- Install and start PostgreSQL
- Create a database for the application
- Note your database connection details for the environment file
Backend Setup
-
Navigate to backend directory:
cd backend
-
Create virtual environment:
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate -
Install Python dependencies:
pip install -r requirements.txt
-
Create environment file (
backend/.env
):POSTGRES_DB_URL=postgresql://username:password@localhost:5432/database_name
-
Start the backend server:
uvicorn main:app --reload --host 0.0.0.0 --port 8000
Frontend Setup
-
Open new terminal, navigate to frontend:
cd frontend
-
Install Node.js dependencies:
npm install
-
Create environment file (
frontend/.env.local
):NEXT_PUBLIC_API_URL=http://localhost:8000
-
Start the frontend development server:
npm run dev
Verifying the Setup
- Check backend: Visit http://localhost:8000/docs to see the API documentation
- Check frontend: Visit http://localhost:3000 to see the application
- Test API connection: The frontend should load repository data from the backend
Common Issues
Docker network error:
- Make sure Docker is running
- Try
docker-compose down && docker-compose up --build
Database connection error:
- Verify your PostgreSQL credentials in the
.env
file - Ensure the database exists
- Check that PostgreSQL is running
Frontend not connecting to backend:
- Verify
NEXT_PUBLIC_API_URL
in frontend.env
- Check that backend is running on port 8000
- Look for CORS errors in browser console
Port already in use:
- Stop any services running on ports 3000 or 8000
- Or modify the ports in
docker-compose.yml
Development Workflow
- Backend changes: The FastAPI server auto-reloads on file changes
- Frontend changes: Next.js hot-reloads automatically
- Database changes: Modify
models.py
and restart the backend - Environment changes: Restart both services after updating
.env
files
Next: Read Architecture to understand how the system works.