A full-stack application that identifies locations from uploaded images and provides detailed travel information. The application consists of a FastAPI backend and a React/TypeScript frontend.
backend/
├── main.py # Entry point, FastAPI app configuration
├── requirements.txt # Python dependencies
├── database/ # Database connection setup
├── middleware/ # Authentication middleware
├── models/ # Data models
└── routes/ # API endpoints
frontend/
├── src/
│ ├── App.tsx # Main application component
│ ├── components/ # Reusable UI components
│ ├── context/ # React context for state management
│ ├── Hooks/ # Custom React hooks
│ └── pages/ # Page components
- User signup with password strength validation
- Login/logout functionality with JWT authentication
- Secure cookie-based session management
- Image upload and location detection using AI
- Interactive maps display using Google Maps API
- AI-generated travel information for detected locations
- User-specific location data management
- Server-sent events (SSE) for streaming responses
- Integration with external AI services (Picarta for location detection, OpenAI for travel info)
- Supabase integration for authentication and data storage
- Python 3.9+
- Node.js and npm
- Supabase account
- API keys for: Picarta, OpenAI, Google Maps
-
Navigate to the backend directory:
cd backend -
Install dependencies:
pip install -r requirements.txt -
Create a
.envfile with the following variables:SUPABASE_URL=your_supabase_url SUPABASE_KEY=your_supabase_key SUPABASE_SERVICE=your_supabase_service_role_key SUPABASE_BUCKET=your_supabase_bucket_name SUPABASE_JWT_SECRET=your_supabase_jwt_secret PICARTA_API_KEY=your_picarta_api_key OPENAI_API_KEY=your_openai_api_key -
Run the server:
python main.py
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install -
Create a
.envfile with:VITE_MAPS_API_KEY=your_google_maps_api_key -
Start the development server:
npm run dev
POST /signup- Create new user accountPOST /login- Authenticate user and generate tokenGET /logout- Clear user sessionGET /verify- Verify user authentication
POST /addImage- Upload and analyze image for location dataGET /locations- List user's saved locationsGET /locationInfo- Get detailed travel information about a locationGET /location/{id}- Get specific location detailsDELETE /location/{id}- Delete a saved location
- FastAPI
- Supabase
- Picarta API
- OpenAI API
- Python
- React
- TypeScript
- Vite
- Tailwind CSS
- Axios
The application uses a microservices architecture with the backend and frontend separated. The backend serves as an API gateway that integrates external services and provides authentication, while the frontend focuses on the user interface and experience.