# Project Structure - travelb2b-backend

This directory contains the complete B2B Flight Ticketing Platform project, including both backend and frontend components.

## Directory Structure

```
travelb2b-backend/
├── src/                          # Backend Java source code
│   ├── main/
│   │   ├── java/com/flightticket/
│   │   │   ├── controller/       # REST API controllers
│   │   │   ├── service/          # Business logic services
│   │   │   ├── repository/       # Data access layer
│   │   │   ├── model/            # Entity models
│   │   │   ├── dto/              # Data Transfer Objects
│   │   │   ├── exception/        # Custom exceptions
│   │   │   ├── config/           # Spring configuration
│   │   │   ├── security/         # Security & Keycloak integration
│   │   │   └── ...
│   │   └── resources/
│   │       ├── application.yml   # Application configuration
│   │       └── db/migration/     # Flyway database migrations
│   └── test/                     # Backend tests
│
├── frontend/                     # Angular frontend application
│   ├── src/
│   │   ├── app/
│   │   │   ├── features/         # Feature modules
│   │   │   ├── core/             # Core services & guards
│   │   │   ├── shared/           # Shared components
│   │   │   └── layout/           # Layout components
│   │   ├── assets/               # Static assets
│   │   └── environments/         # Environment configs
│   ├── package.json
│   └── angular.json
│
├── docs/                         # Documentation
│   ├── API_DOCUMENTATION.md
│   ├── DEPLOYMENT.md
│   └── ...
│
├── k8s/                          # Kubernetes deployment files
│   ├── app-deployment.yaml
│   ├── postgres-deployment.yaml
│   └── ...
│
├── keycloak/                     # Keycloak configuration
│   ├── realm-config.json
│   └── setup-keycloak.sh
│
├── scripts/                      # Utility scripts
│
├── pom.xml                       # Maven build configuration
├── docker-compose.yml            # Docker Compose setup
├── Dockerfile                    # Docker image definition
└── README.md                     # Project documentation

```

## Key Components

### Backend (Spring Boot)
- **Language**: Java 17
- **Framework**: Spring Boot 3.x
- **Database**: PostgreSQL
- **Authentication**: Keycloak OAuth2/OIDC
- **API Integration**: Amadeus Flight API
- **Build Tool**: Maven

### Frontend (Angular)
- **Framework**: Angular 16
- **Language**: TypeScript
- **UI Library**: Angular Material
- **Build Tool**: Angular CLI

### Infrastructure
- **Containerization**: Docker
- **Orchestration**: Kubernetes
- **Message Queue**: RabbitMQ
- **Caching**: Redis
- **Identity Management**: Keycloak

## Getting Started

### Backend
```bash
cd travelb2b-backend
mvn clean install
mvn spring-boot:run
```

### Frontend
```bash
cd travelb2b-backend/frontend
npm install
npm start
```

### Docker Compose (Full Stack)
```bash
cd travelb2b-backend
docker-compose up
```

## API Endpoints

The backend exposes REST APIs at:
- Base URL: `http://localhost:8080/api`
- Swagger UI: `http://localhost:8080/swagger-ui.html`

Key endpoints:
- `/api/modifications/*` - Booking modification operations
- `/api/bookings/*` - Booking management
- `/api/wallet/*` - Wallet operations
- `/api/agencies/*` - Agency management

## Environment Configuration

Copy `.env.example` to `.env` and configure:
- Database credentials
- Keycloak settings
- Amadeus API credentials
- Other service configurations

## Documentation

See the `docs/` directory for detailed documentation:
- `API_DOCUMENTATION.md` - Complete API reference
- `DEPLOYMENT.md` - Deployment guide
- `DEV-SETUP.md` - Development environment setup
- `AMADEUS_INTEGRATION_GUIDE.md` - Amadeus API integration

## Testing

### Backend Tests
```bash
mvn test
```

### Frontend Tests
```bash
cd frontend
npm test
```

## Project Status

This is a consolidated copy of the B2B Flight Ticketing Platform project. All backend and frontend code has been successfully copied to this directory.

**Date Copied**: February 2, 2026
**Source**: Root project directory

## Notes

- The backend compiles successfully with no errors
- All DTOs and service classes are in place
- Frontend structure is complete with all components
- Configuration files are ready for deployment
- Documentation is comprehensive and up-to-date
