A full-stack web application that displays and manages data from the Star Wars API (SWAPI). The application is built using React (frontend) and FastAPI (backend) with Docker containerization.
- Docker and Docker Compose installed on your machine
- Port 6969 and 8000 available on your system
- Clone the repository:
git clone <repository-url>
cd mercedes-test
- Run the application using Docker Compose:
docker-compose up --build
- Access the application:
- Frontend: http://localhost:6969
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
SWAPI_BASE_URL
: Base URL for Star Wars API (default: https://swapi.info/api)LOG_LEVEL
: Logging level (default: INFO)CORS_ORIGINS
: Allowed CORS origins (default: ["http://localhost:6969"])
VITE_API_BASE_URL
: Backend API URL (default: http://localhost:8000/api/v1)
GET /api/v1/people
: Get paginated list of Star Wars characters- Query params:
page
,search
,sort_by
,order
- Query params:
GET /api/v1/planets
: Get paginated list of Star Wars planets- Query params:
page
,search
,sort_by
,order
- Query params:
GET /api/v1/simulate-ai-insight
: Get AI-generated insights- Query params:
name
,type
(person/planet/auto)
- Query params:
GET /health
: API health status
cd backend
pip install -r requirements.txt
fastapi dev app/main.py
cd frontend
npm install
npm run dev
To run the integration tests:
cd backend
pytest