Modano AI Project
References
- Project Introduction
- Service Workflow
- Features
- Phase 1: Project Architecture
- Backend Technical Details
- Security
- Request Management
- Monitoring & Logging
- Technologies Used
- Phase 1: Core Features
- Database Design
- AI System
- Future Enhancements
Project Introduction
Modano is a web application for managing clothing and style using artificial intelligence. In the first phase, the web app is developed using Django for the backend, integrating AI APIs to provide style recommendations to users. Users can log into their accounts, interact with AI, and save their search history for future reference.
Service Workflow
- User accesses the website.
- User inputs additional information (style details and wardrobe) (optional).
- User sends a prompt to the service.
- The request is processed.
- The prompt is stored in the conversation history.
- The prompt, along with metadata (weather, user style information, etc.), is sent to the AI service API.
- Similar cached responses are checked.
- After processing, the response is displayed to the user in text/image format or both.
- During a conversation, responses include a hidden label (e.g., Classic Style #1). Users can like responses, and liked responses are saved in their "My Styles" section.
Features
Chat Section:
- Stop text generation button.
- Message history.
- Style history.
User Account:
- Display basic profile information.
- Display user style information.
- Form for updating information and preferences.
Account Credit:
- Display account credit.
- Recharge account.
- View payment history and invoices.
Settings:
- Configure notifications.
- Option to automatically delete user data (data protection).
Phase 1: Project Architecture
Backend Technical Details
API
Caching: Redis
Throttle Rate: Django Rest Framework
REST_FRAMEWORK = {
'DEFAULT_THROTTLE_CLASSES': [
'rest_framework.throttling.AnonRateThrottle',
'rest_framework.throttling.UserRateThrottle',
],
'DEFAULT_THROTTLE_RATES': {
'anon': '10/minute', # Anonymous users: max 10 requests per minute
'user': '1000/day', # Authenticated users: max 1000 requests per day
}
}
Pagination
REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 10, # 10 items per page
}
Security
- JWT Authentication
- CSRF, SQL Injection, XSS Protection
Request Management for Better User Experience
- Queue System
- Preprocessing & Caching for similar responses
Monitoring & Logging
- Sentry for logging
- Grafana + Prometheus
Technologies Used
- Backend: Django (Python)
- Containerization: Docker
- Database: PostgreSQL (Future integration with Vector DB)
- Frontend: Vue.js
- Authentication: Django Allauth (Email login + Google OAuth)
- AI Integration: (Currently researching the best service)
- Server: Initial deployment on SahoWS cloud server
Phase 1: Core Features
User Authentication
- Login via email/username and password.
- Google OAuth integration.
- JWT-based session management.
User Interaction with AI
- Users submit style-related questions.
- AI processes the request and provides a response.
- Real-time response display using SSE.
- Users can share their sessions with invitees who can interact with the AI.
- Invitees can like AI responses (session owners cannot).
- Users can save AI responses and view them as saved responses (invitees in public sessions cannot save responses).
- Users cannot like responses unless they are invitees.
- Users can set a title for their sessions.
Interaction History Management
- Save user interactions with AI (questions and responses).
- Retrieve and display past sessions.
- Assign unique session IDs to users.
Database Design
User Model
- Email or username (unique ID)
- First and last name
- Profile picture
- Style information
- Style preferences (e.g., Casual, Formal, Streetwear)
- Body size info (height, weight, shoe size, chest size, waist size)
- Skin tone (for better style recommendations)
- Preferred colors (for clothing)
- AI interaction history (prompts and responses)
- Saved AI responses
AI Interaction History Model
- User (Foreign Key to User model)
- Question
- Response
- Timestamp
- Session ID
Prompt Session Model
- Users can have multiple sessions.
- Users can edit session titles.
- Users can share their sessions.
Prompt Model
- A prompt is linked to its session.
- Stores user prompt history.
AI Response Models
- AiResponse | AiTextResponse | AiImageResponse
- Responses can be text, image, or both.
- Invitees can like responses, storing them in their "Favorite Styles."
- Session owners can save responses.
Shared Chat Sessions
- When a user enables chat sharing, the
is_publicfield updates. - A token is generated and shared with the chat UUID.
- When an invitee accesses the link, they are added to the invitee list (many-to-many relationship).
- If sharing is disabled,
is_publicis updated accordingly.
AI System
The current plan is to use a text-based or multimodal AI API. The initial approach involves using the free Mistral Large model, with potential upgrades to OpenRouter-provided models in later phases. Free and premium user accounts may be assigned different AI models.
Future Enhancements
- Sentiment analysis for better personalization.
AI Execution Plan
- Chosen Models: Flash 2.0, GPT-4-o Mini, etc.
- Prompt Caching:
- OpenAI provides caching options.
- Dynamic prompt structures to optimize responses.
- Memory & Context Manager:
- Retains user interaction history.
- Enriches prompts with real-time data (weather, fashion news, events, etc.).