Time Trek is an interactive web application that connects people with historical events from their birth month. By combining historical data with AI-powered insights, users can discover fascinating facts about what was happening in the world when they were born.
- Birth date input interface
- Historical facts fetching for the specified month
- AI-enhanced explanations of historical events using ChatGPT
- Simple and intuitive API endpoint
- Backend:
- Python 3.8+
- FastAPI
- Uvicorn
- API Integration:
- Historical Events API
- OpenAI's ChatGPT API
The main endpoint will return historical facts and AI-enhanced explanations:
GET /api/historical-facts?date=YYYY-MM-DD
Example Response:
{
"date": "1990-03-15",
"historicalFacts": [
{
"fact": "Historical event description",
"aiEnhancedExplanation": "Detailed context provided by ChatGPT"
}
// ... more facts
]
}
- Python 3.8 or higher
- pip (Python package manager)
- API keys for:
- Historical Events API
- OpenAI API
- Clone the repository
git clone https://github.com/josiasdev/time-trek
.git
cd time-trek
- Create and activate a virtual environment
python -m venv venv
# On Windows
.\venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate
- Install dependencies
pip install -r requirements.txt
- Set up environment variables
# Create a .env file with your API keys
OPENAI_API_KEY=your_openai_api_key
HISTORICAL_API_KEY=your_historical_api_key
- Start the application
uvicorn app.main:app --reload
The API will be available at http://localhost:9000
Make sure to set up the following environment variables:
OPENAI_API_KEY
: Your OpenAI API keyHISTORICAL_API_KEY
: Your Historical Events API key
- [Your Name]
This project is part of the Object-Oriented Programming course at Universidade Federal de Sergipe.