Spaces:
Sleeping
Sleeping
File size: 4,145 Bytes
db020d5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# WikiFit Project Documentation
## Project Overview
WikiFit is a Streamlit-based web application that serves as a fitness and health resource repository. The application allows users to:
- Search for fitness topics using real Wikipedia API data
- View curated workout plans based on fitness goals
- Find evidence-based remedies for fitness-related issues
- Take a fitness quiz to test knowledge
- Generate personalized workout plans
- Access nutrition information and exercise comparisons
## Project Structure
```
lingo-wiki/
βββ app.py # Main Streamlit application file
βββ pages/ # Streamlit page modules
β βββ __init__.py # Package initialization file
β βββ home.py # Home page with featured content
β βββ search.py # Search functionality with multiple tabs
β βββ quiz.py # Interactive fitness quiz
β βββ workout_plans.py # Workout plan generator and API-based plans
β βββ remedies.py # Fitness remedies using Wikipedia API
βββ services/ # Service modules
β βββ __init__.py # Package initialization file
β βββ wiki_service.py # Wikipedia API service functions
β βββ ai_service.py # AI service functions
βββ test_api.py # Script to test API functions
βββ requirements.txt # Python dependencies
```
## API Services
The application uses real API calls to fetch fitness data from Wikipedia and other sources:
### wiki_service.py Functions
| Function Name | Description | Parameters | Return Value |
|---------------|-------------|------------|--------------|
| `search_wiki` | Searches Wikipedia for fitness-related information | `query`: string | Dictionary with search results |
| `get_article_details` | Gets detailed information about a Wikipedia article | `title`: string | Dictionary with article details |
| `get_featured_content` | Gets featured fitness content from Wikipedia | None | Dictionary with article and facts |
| `get_fitness_facts` | Gets random fitness facts | None | List of fact strings |
| `get_fitness_tips` | Gets daily fitness tips | None | List of tip strings |
| `search_fitness_exercise` | Searches for specific exercise information | `exercise_name`: string | Dictionary with exercise details |
| `get_nutrition_information` | Gets nutritional info for a food | `food_name`: string | Dictionary with nutrition data |
| `get_fitness_category_articles` | Gets articles from a fitness category | `category`: string, `limit`: int | Dictionary with category articles |
| `get_exercise_comparison` | Compares different exercise types | `exercise_type`: string | Dictionary with comparison data |
| `get_latest_fitness_research` | Gets latest fitness research articles | `topic`: string (optional) | Dictionary with research articles |
| `get_workout_plan_by_goal` | Gets workout plan based on fitness goal | `goal`: string | Dictionary with workout plan |
| `search_fitness_remedy` | Searches for remedies for common ailments | `ailment`: string | Dictionary with remedies and exercises |
## Page Functionality
### Home Page
- Displays featured fitness content from Wikipedia
- Shows daily fitness tip
- Presents "Did you know" fitness facts
- Links to other app sections
### Search Page
The search page has multiple tabs:
1. **General Search**: Search Wikipedia for fitness information
2. **Nutrition Info**: Search for nutritional information about specific foods
3. **Workout Plans**: Get plans based on fitness goals
4. **Fitness Remedies**: Find remedies for common ailments
### Workout Plans Page
- Generate personalized workout plans based on fitness goals
- Browse featured API-based workout plans
- Compare different exercise types
- View latest fitness research
### Remedies Page
- Browse remedies by category
- Search for specific remedies
- Get exercise recommendations for common ailments
- View API-based information on muscle soreness, joint pain, and more
### Quiz Page
- Test fitness knowledge through an interactive quiz
- Receive score and feedback
- Learn new fitness facts
|