File size: 3,095 Bytes
4979c72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st
from typing import Dict, List
from datetime import datetime


class BrainstormManager:
    def __init__(self):
        if 'products' not in st.session_state:
            st.session_state.products = {}
        
    def generate_product_form(self) -> tuple:
        with st.form("product_form"):
            basic_info = {
                "name": st.text_input("Product Name"),
                "category": st.selectbox("Category", ["Digital", "Physical", "Service"]),
                "description": st.text_area("Description"),
                "target_audience": st.multiselect("Target Audience", 
                    ["Students", "Professionals", "Businesses", "Seniors", "Youth"]),
                "price_range": st.slider("Price Range ($)", 0, 1000, (50, 200)),
                "launch_date": st.date_input("Expected Launch Date")
            }
            
            st.subheader("Market Analysis")
            market_analysis = {
                "competitors": st.text_area("Main Competitors (one per line)"),
                "unique_features": st.text_area("Unique Selling Points"),
                "market_size": st.selectbox("Market Size", 
                    ["Small", "Medium", "Large", "Enterprise"]),
                "growth_potential": st.slider("Growth Potential", 1, 10)
            }
            
            submitted = st.form_submit_button("Save Product")
            return basic_info, market_analysis, submitted

    def analyze_product(self, product_data: Dict) -> Dict:
        insights = {
            "market_opportunity": self._calculate_opportunity_score(product_data),
            "suggested_price": self._suggest_price(product_data),
            "risk_factors": self._identify_risks(product_data),
            "next_steps": self._generate_next_steps(product_data)
        }
        return insights

    def _calculate_opportunity_score(self, data: Dict) -> int:
        score = 0
        if data.get("market_size") == "Large":
            score += 3
        if len(data.get("target_audience", [])) >= 2:
            score += 2
        if data.get("growth_potential", 0) > 7:
            score += 2
        return min(score, 10)

    def _suggest_price(self, data: Dict) -> float:
        base_price = sum(data.get("price_range", (0, 0))) / 2
        if data.get("market_size") == "Enterprise":
            base_price *= 1.5
        return round(base_price, 2)

    def _identify_risks(self, data: Dict) -> List[str]:
        risks = []
        if data.get("competitors"):
            risks.append("Competitive market - differentiation crucial")
        if len(data.get("target_audience", [])) < 2:
            risks.append("Narrow target audience - consider expansion")
        return risks

    def _generate_next_steps(self, data: Dict) -> List[str]:
        steps = [
            "Create detailed product specification",
            "Develop MVP timeline",
            "Plan marketing strategy"
        ]
        if data.get("market_size") == "Enterprise":
            steps.append("Prepare enterprise sales strategy")
        return steps