2.2 KiB
2.2 KiB
Profile Linker API
This is a FastAPI backend for the Profile Linker application. It provides API endpoints for managing a list of people's profiles.
Project Structure
The project follows a modular structure:
backend/
├── app/
│ ├── api/ # API endpoints
│ │ ├── endpoints/ # API endpoint modules
│ │ └── api.py # API router
│ ├── core/ # Core application components
│ │ └── config.py # Application settings
│ ├── crud/ # CRUD operations
│ │ └── person.py # Person CRUD operations
│ ├── db/ # Database components
│ │ ├── base.py # Database base
│ │ ├── base_class.py # Base class for database models
│ │ └── session.py # Database session
│ ├── models/ # Database models
│ │ └── person.py # Person model
│ ├── schemas/ # Pydantic schemas
│ │ └── person.py # Person schemas
│ └── main.py # FastAPI application
├── main.py # Entry point
└── requirements.txt # Python dependencies
API Endpoints
The API provides the following endpoints:
GET /api/people: Get all peoplePOST /api/people: Create a new person
Development
Prerequisites
- Python 3.11+
- Docker and Docker Compose
Running the Application
Using Docker Compose
- Build and start the containers:
docker-compose up --build
- Access the API at http://localhost:8080/api
- Access the API documentation at http://localhost:8080/docs
Running Locally
- Install dependencies:
cd backend
pip install -r requirements.txt
- Run the application:
cd backend
python main.py
- Access the API at http://localhost:8080/api
- Access the API documentation at http://localhost:8080/docs
Frontend Integration
The backend serves the frontend as static assets. The frontend should be built and placed in the dist directory. The Docker setup handles this automatically.