http://localhost:5000
POST /auth/signup
Content-Type: application/jsonRequest Body:
{
"name": "John",
"email": "john@gmail.com",
"password": "testpassword"
}Response:
{
"id": 1,
"name": "John",
"email": "john@gmail.com",
"message": "User created successfully"
}POST /auth/login
Content-Type: application/jsonRequest Body:
{
"email": "john@gmail.com",
"password": "testpassword"
}Response:
{
"message": "Login successful",
"user_id": 1,
"name": "John"
}POST /auth/logoutResponse:
{
"message": "Logout successful"
}GET /profile/{user_id}Response:
{
"id": 1,
"name": "John",
"email": "john@gmail.com",
"bio": "I love teaching and learning new skills!",
"location": "San Francisco, CA",
"skills_to_offer": ["Python", "JavaScript", "Cooking"],
"skills_to_learn": ["Guitar", "Spanish"],
"image_url": "/upload/uploads/profile_images/profile_1_20241201_143022_abc12345.jpg",
"average_rating": 4.5,
"created_at": "2024-01-15T10:30:00Z"
}PUT /profile/{user_id}
Content-Type: application/jsonRequest Body:
{
"bio": "Updated bio text",
"location": "New York, NY",
"skills_to_offer": ["Python", "JavaScript", "Cooking", "Photography"],
"skills_to_learn": ["Guitar", "Spanish", "Yoga"]
}Response:
{
"message": "Profile updated successfully"
}POST /upload/profile-image/{user_id}
Content-Type: multipart/form-dataForm Data:
image: File (PNG, JPG, JPEG, max 5MB)
Response:
{
"message": "Profile image uploaded successfully",
"image_url": "/upload/uploads/profile_images/profile_1_20241201_143022_abc12345.jpg",
"filename": "profile_1_20241201_143022_abc12345.jpg"
}DELETE /upload/profile-image/{user_id}Response:
{
"message": "Profile image deleted successfully"
}GET /upload/uploads/{filename}Response: Returns the actual file content (images, etc.)
GET /matches/{user_id}Response:
{
"matches": [
{
"id": 2,
"name": "Jane",
"email": "jane@gmail.com",
"bio": "Passionate about music and languages",
"location": "San Francisco, CA",
"skills_to_offer": ["Guitar", "Spanish"],
"skills_to_learn": ["Python", "Cooking"],
"image_url": "/upload/uploads/profile_images/profile_2_20241201_143055_def67890.jpg",
"average_rating": 4.8,
"offer_matches": ["Python matches Python", "Cooking matches Cooking"],
"learn_matches": ["Guitar matches Guitar", "Spanish matches Spanish"]
}
],
"count": 1,
"ai_enabled": true
}Notes:
offer_matches: Skills the user can teach to the candidatelearn_matches: Skills the user can learn from the candidateai_enabled: Whether AI matching is available- Matches only include users where both can teach and learn from each other
AI Matching: For detailed information about AI-powered skill matching, see the AI Setup Guide.
GET /chats/{user_id}Response:
{
"chats": [
{
"id": 1,
"user1_id": 1,
"user2_id": 2,
"created_at": "2024-01-15T10:00:00Z"
}
]
}POST /chats
Content-Type: application/jsonRequest Body:
{
"user1_id": 1,
"user2_id": 2
}Response:
{
"message": "Chat created successfully",
"chat_id": 1
}GET /chats/{chat_id}/messagesResponse:
{
"messages": [
{
"id": 1,
"content": "Hi! I saw we matched for Python and Guitar lessons",
"sender_id": 1,
"timestamp": "2024-01-15T10:05:00Z",
"is_read": true
},
{
"id": 2,
"content": "Yes! I'd love to learn Python from you",
"sender_id": 2,
"timestamp": "2024-01-15T10:10:00Z",
"is_read": true
}
]
}POST /chats/{chat_id}/messages
Content-Type: application/jsonRequest Body:
{
"content": "Great! When would you like to meet?",
"sender_id": 1
}Response:
{
"message": "Message sent successfully",
"message_id": 6
}DELETE /chats/{chat_id}Response:
{
"message": "Chat deleted successfully"
}PUT /chats/{chat_id}/messages/read
Content-Type: application/jsonRequest Body:
{
"user_id": 1
}Response:
{
"message": "Messages marked as read"
}GET /ratings/{user_id}Response:
{
"ratings": [
{
"id": 1,
"rater_id": 2,
"rated_id": 1,
"rating": 5,
"comment": "Excellent Python teacher! Very patient and clear explanations.",
"skill": "Python",
"created_at": "2024-01-15T16:00:00Z"
}
],
"average_rating": 4.8,
"total_ratings": 5
}POST /ratings
Content-Type: application/jsonRequest Body:
{
"rater_id": 2,
"rated_id": 1,
"rating": 5,
"comment": "Excellent Python teacher! Very patient and clear explanations.",
"skill": "Python"
}Response:
{
"message": "Rating created successfully",
"rating_id": 1
}{
"error": "Invalid request data",
"details": "Specific error message"
}{
"error": "Authentication required"
}{
"error": "Access denied"
}{
"error": "Resource not found"
}{
"error": "Internal server error"
}The API supports CORS for cross-origin requests from the frontend application.
- Maximum file size: 5MB
- Supported formats: PNG, JPG, JPEG
- Files are stored in the
/uploads/profile_images/directory - Images are automatically resized to max 800x800 pixels
- Old profile images are automatically cleaned up (keeps only the most recent)
- AI Setup Guide - Google Gemini API setup and AI matching details
- Database Documentation - Database schema and operations