diff --git a/backend/__pycache__/gemini.cpython-313.pyc b/backend/__pycache__/gemini.cpython-313.pyc index 79f2109..b91edcb 100644 Binary files a/backend/__pycache__/gemini.cpython-313.pyc and b/backend/__pycache__/gemini.cpython-313.pyc differ diff --git a/backend/app.py b/backend/app.py index 2e922fd..0854aa0 100644 --- a/backend/app.py +++ b/backend/app.py @@ -7,6 +7,8 @@ from pymongo import MongoClient from pydantic import BaseModel from typing import List, Dict, Optional +import json +import os # Import external modules (assume these are available in your project) from policy_scraper import fetch_main_page, extract_prop_blocks, fetch_prop_details @@ -14,7 +16,6 @@ simplify_description, simplify_paragraph, people_affected, - personalize_proposition, ) app = FastAPI() @@ -302,10 +303,9 @@ class Proposition(BaseModel): simplified_description: Optional[str] = None simplified_paragraph: Optional[str] = None affected_people: Optional[str] = None - personalization_summary: Optional[str] = None -@app.get("/scrape-propositions", response_model=List[Proposition]) +@app.get("/scrape-propositions", response_model=List[Proposition]) # main scraping function def get_scraped_propositions(): try: soup = fetch_main_page() # Scraper function @@ -319,8 +319,10 @@ def get_scraped_propositions(): raise HTTPException(status_code=500, detail=f"Error scraping propositions: {str(e)}") -@app.get("/simplify-propositions", response_model=List[Proposition]) +@app.get("/simplify-propositions", response_model=List[Proposition]) # helps simplify the def get_simplified_propositions(): + global propositions_cache + propositions_cache = propositions_cache if not propositions_cache: raise HTTPException( status_code=404, @@ -341,60 +343,20 @@ def get_simplified_propositions(): prop["simplified_paragraph"] = simple_para prop["affected_people"] = people_aff simplified_props.append(prop) + save_propositions_to_file(simplified_props) return simplified_props - -@app.get("/personalized-feed", response_model=List[Proposition]) -def get_personalized_feed(): - # Hardcoded user profile for personalization (simulate signup data) - user_profile = { - "first_name": "Alex", - "last_name": "Doe", - "date_of_birth": "1990-01-15", - "email": "alex@example.com", - "gender": "Non-Binary", - "county": "Los Angeles", - "income_bracket": "50k-75k", - "education_level": "Bachelor's Degree", - "occupation": "Software Developer", - "family_size": 10, - "race_ethnicity": "Hispanic", - "policy_preferences": { - "Climate change": "Right", - "Universal healthcare": "Right", - "Prison reform": "Right", - "Abortion": "Right", - "Education": "Right", - "Immigration": "Right", - "Military spending": "Right" - } - } - if not propositions_cache: - raise HTTPException( - status_code=404, - detail="No propositions available. Please scrape them first.", - ) - personalized_props = [] - for prop in propositions_cache: - details = prop.get("details", "") - if not details: - continue - personalization = personalize_proposition(user_profile, details) - # Skip propositions that are "Not aligned" - if "Not aligned" in personalization: - continue - prop["personalization_summary"] = personalization - personalized_props.append(prop) - return personalized_props - +def save_propositions_to_file(data, filename="propositions_data.json"): + filepath = os.path.join(os.getcwd(), filename) + with open(filepath, "w", encoding="utf-8") as f: + json.dump(data, f, ensure_ascii=False, indent=4) + @app.get("/prop-api-root") def prop_api_root(): return {"message": "Welcome to the Proposition API!"} -# ----------- Main Section ----------- - if __name__ == "__main__": import uvicorn uvicorn.run(app, host="0.0.0.0", port=8000) diff --git a/backend/gemini.py b/backend/gemini.py index b1c0224..5abd681 100644 --- a/backend/gemini.py +++ b/backend/gemini.py @@ -45,112 +45,4 @@ def people_affected(text: str) -> str: f"{text}" ) resp = model.generate_content(prompt) - return resp.text.strip() - -def get_top_propositions(user_profile: dict, propositions: list) -> list: - """ - Get the top 3 propositions that resonate most with the user based on their profile. - - Args: - user_profile (dict): The user's profile data. - propositions (list): A list of propositions, each as a dictionary with keys like 'number' and 'details'. - - Returns: - list: A list of the top 3 propositions with their alignment, reason, and impact. - """ - results = [] - - for proposition in propositions: - # Use the personalize_proposition function to evaluate alignment - proposition_text = proposition.get("details", "") - result = personalize_proposition(user_profile, proposition_text) - result["proposition_number"] = proposition.get("number", "Unknown") - result["proposition_title"] = proposition.get("title", "Untitled") - results.append(result) - - # Sort the results by alignment priority (Highly aligned > Moderately aligned > Not aligned) - alignment_priority = {"Highly aligned": 3, "Moderately aligned": 2, "Not aligned": 1} - results.sort(key=lambda x: alignment_priority.get(x["alignment"], 0), reverse=True) - - # Return the top 3 propositions - return results[:3] - -# Personalization summary (AI-based alignment) -# Enhanced personalization function in gemini.py -def personalize_proposition(user_profile: dict, proposition_text: str) -> dict: - user_info_parts = [] - for key, value in user_profile.items(): - if key == "policy_preferences": - prefs = " | ".join([f"{k}: {v}" for k, v in value.items()]) - user_info_parts.append(f"Policy Preferences: {prefs}") - else: - user_info_parts.append(f"{key}: {value}") - user_info_str = " ; ".join(user_info_parts) - - prompt = ( - "Using the user profile and proposition below, create a personalized response with the following format:\n" - "1. Alignment: One of 'Highly aligned', 'Moderately aligned', or 'Not aligned'\n" - "2. Reason: A short sentence (≈15 words) explaining the alignment reasoning\n" - "3. Impact: One sentence on how this would directly impact this specific user\n" - "4. Format as a JSON with these fields. No markdown or additional text.\n\n" - f"User Profile: {user_info_str}\n\n" - f"Proposition Text: {proposition_text}" - ) - - resp = model.generate_content(prompt) - response_text = resp.text.strip() - - # Parse the JSON response (with error handling) - try: - import json - return json.loads(response_text) - except: - # Fallback if JSON parsing fails - return { - "alignment": "Unknown", - "reason": "Could not determine alignment", - "impact": "Impact analysis unavailable" - } - -if __name__ == "__main__": - # Load propositions from props.json - props_file_path = "/Users/avnigandhi/Documents/VoteSmartWeb/backend/props.json" - with open(props_file_path, "r") as file: - propositions = json.load(file) - - # Example user profile (hardcoded for now) - sample_user_profile = { - "first_name": "Alex", - "last_name": "Doe", - "date_of_birth": "1990-01-15", - "email": "alex@example.com", - "gender": "Non-Binary", - "county": "Los Angeles", - "income_bracket": "50k-75k", - "education_level": "Bachelor's Degree", - "occupation": "Software Developer", - "family_size": 1, - "race_ethnicity": "Hispanic", - "policy_preferences": { - "Climate change": "Left", - "Universal healthcare": "Left", - "Prison reform": "Neutral", - "Abortion": "Right", - "Education": "Left", - "Immigration": "Left", - "Military spending": "Right" - } - } - - # Get the top 3 propositions - top_propositions = get_top_propositions(sample_user_profile, propositions) - - # Print the results (for debugging purposes) - print("\nTop 3 Propositions:") - for prop in top_propositions: - print(f"Proposition {prop['proposition_number']} - {prop['proposition_title']}") - - # Output the top 3 propositions for the frontend - output_file_path = "/Users/avnigandhi/Documents/VoteSmartWeb/backend/top_propositions.json" - with open(output_file_path, "w") as output_file: - json.dump(top_propositions, output_file, indent=4) \ No newline at end of file + return resp.text.strip() \ No newline at end of file diff --git a/backend/personalized_props.py b/backend/personalized_props.py index f25a3b4..fbd07f3 100644 --- a/backend/personalized_props.py +++ b/backend/personalized_props.py @@ -1,107 +1,77 @@ -# main.py (or wherever you put your “run” logic) import os import json -import google.generativeai as genai +import re from dotenv import load_dotenv +import google.generativeai as genai load_dotenv() + api_key = os.getenv("GEMINI_API_KEY") if not api_key: - raise ValueError("GEMINI_API_KEY not found") + raise ValueError("GEMINI_API_KEY not found in environment variables.") genai.configure(api_key=api_key) +model = genai.GenerativeModel(model_name="gemini-1.5-pro-latest") -# 1. Proposition data from your config.json -with open("config.json", "r", encoding="utf-8") as f: - PROPOSITIONS = json.load(f) - -# 2. Sample user profile -user_profile = { - "first_name": "Alex", - "last_name": "Doe", - "date_of_birth": "1990-01-15", - "email": "alex@example.com", - "gender": "Non-Binary", - "county": "Los Angeles", - "income_bracket": "50k-75k", - "education_level": "Bachelor's Degree", - "occupation": "Software Developer", - "family_size": 10, - "race_ethnicity": "Hispanic", - "policy_preferences": { - "Climate change": "Right", - "Universal healthcare": "Right", - "Prison reform": "Right", - "Abortion": "Right", - "Education": "Right", - "Immigration": "Right", - "Military spending": "Right" - } -} +def load_json(filepath:str): + with open(filepath, 'r', encoding='utf-8') as f: + return json.load(f) -def extract_user_interests(user_profile: dict) -> list[str]: - """ - Extract a list of policy topics from user_profile['policy_preferences'], - ignoring 'Neutral' stances. - """ - prefs = user_profile.get("policy_preferences", {}) - # Just get the keys if stance != 'Neutral' - user_interests = [topic for topic, stance in prefs.items() if stance.lower() != "neutral"] - return user_interests +def clean_json(raw_text): + cleaned = re.sub(r"```(?:json)?", "", raw_text) + cleaned = cleaned.replace("```", "").strip() + return cleaned -def pick_top_3_propositions(user_interests: list[str]) -> list[dict]: - """ - Example GPT prompt that ranks propositions by how well they match the user_interests. - Returns a list of 3 dicts: [{number, title, summary, score}, ...]. - """ - # Create a minimal version of your proposition data for the prompt - mini_proposals = [ - { - "number": prop["number"], - "title": prop["title"], - "summary": prop["simplified_description"], - "paragraph": prop["simplified_paragraph"], - "affected people": prop["affected_people"] - } - for prop in PROPOSITIONS - ] +def rank_props(user_profile:dict, props_data:dict, top_n: int = 3) -> list: + ranked = [] + for prop in props_data: + prompt = ( + "You are an AI that evaluates how relevant a political proposition is for a specific user.\n" + "Given the user's profile and one proposition, analyze the alignment and impact.\n\n" + "Return only a single JSON object with the following fields:\n" + "- proposition_title\n" + "- alignment (one of: 'Highly aligned', 'Moderately aligned', 'Not aligned')\n" + "- reason (a short sentence explaining the alignment in ~15 words)\n" + "- impact (one sentence on how this proposition might affect this user)\n" + "- relevance_score (a float between 0 and 1, with two decimal places for precision)\n\n" + "Return a valid JSON object only. Do NOT use triple backticks, markdown formatting, or any extra text.\n\n" + f"User Profile:\n{json.dumps(user_profile, indent=2)}\n\n" + f"Proposition:\n" + f"Title: {prop.get('title')}\n" + f"Details: {prop.get('details')}\n" + f"Affected People: {prop.get('affected_people')}\n" + ) + try: + response = model.generate_content(prompt) + raw_output = response.text.strip() + cleaned_output = clean_json(raw_output) + parsed = json.loads(cleaned_output) + ranked.append(parsed) + except Exception as e: + print(f"Error processing proposition '{prop.get('title')}': {e}") - # Build a prompt that asks GPT to rank them - prompt_text = ( - f"The user cares most about: {', '.join(user_interests)}.\n\n" - "Here are some ballot propositions:\n" - f"{json.dumps(mini_proposals, indent=2)}\n\n" - "Please assign an alignment score (1=low, 5=high). " - "Then return the TOP 3 in JSON, sorted by score descending, in this format:\n" - "[\n" - " { \"number\": \"...\", \"title\": \"...\", \"summary\": \"...\", \"score\": 5 },\n" - " ...\n" - "]" - ) + # now sort once, and take top_n + ranked.sort(key=lambda x: x.get("relevance_score", 0), reverse=True) + return ranked[:top_n] - resp = genai.generate_text( - model="gemini-1.5-pro-latest", # or whichever you have - prompt=prompt_text, - temperature=0.0, - max_output_tokens=512 - ) - - raw_output = resp.candidates[0].output - try: - top3 = json.loads(raw_output) - except: - top3 = [] - return top3 +if __name__ == '__main__': + USER_JSON_PATH = 'test_user_profile.json' + PROPS_JSON_PATH = 'propositions_data.json' + OUTPUT_PATH = 'top3_props.json' -def main(): - # 1) Convert user profile to a list of interests - interests_list = extract_user_interests(user_profile) + user_profile = load_json(USER_JSON_PATH) + props_data = load_json(PROPS_JSON_PATH) - # 2) Get the top 3 propositions - top_3 = pick_top_3_propositions(interests_list) + top3_props = rank_props(user_profile, props_data, top_n=3) - # 3) Print or return them - print(json.dumps(top_3, indent=2)) + # Print to console + print("Top 3 Personalized Propositions:\n") + for i, prop in enumerate(top3_props, 1): + print(f"#{i}:") + print(json.dumps(prop, indent=2)) + print("\n" + "-"*40 + "\n") -if __name__ == "__main__": - main() + # **Write to JSON file** + with open(OUTPUT_PATH, 'w', encoding='utf-8') as f: + json.dump(top3_props, f, ensure_ascii=False, indent=2) + print(f"Saved top 3 propositions to {OUTPUT_PATH}") diff --git a/backend/propositions_data.json b/backend/propositions_data.json new file mode 100644 index 0000000..e162c4e --- /dev/null +++ b/backend/propositions_data.json @@ -0,0 +1,92 @@ +[ + { + "number": "Prop 2", + "title": "Borrow $10 billion to build schools, colleges", + "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-2-school-bond/", + "details": "Proposition 2would provide $8.5 billion to K-12 schools and $1.5 billion to community colleges to renovate, fix and construct facilities. The money would be distributed through matching grants, with the state paying a greater share of costs for less affluent districts and those with higher numbers of English learners and foster youth. Some of the money would be set aside for removing lead from water, creating transitional kindergarten classrooms and building career and technical education facilities.\n\n\n\nThousands of California school buildings are in poor shape, with leaky roofs, broken air conditioning, peeling paint and other health and safety hazards. According to thePublic Policy Institute of California, 38% of students attend schools that don’t meet the state’s minimum safety standards. Research has shown that students who attend school in sub-standard facilities tend to have lower attendance rates, lower morale and lower achievement.\n\nUnlike many other states, California does not pay for school repairs through a permanent funding stream. Money comes entirely from state and local bonds. The state’s last school facilities bond, a $15 billion proposal in 2020, failed, leaving the state’s school repair account nearly empty.\n\nAffluent school districts can raise more money for repairs through local bonds because local property values are higher, thereby generating more money through local property taxes. Smaller and lower-income districts struggle to raise enough bond money to pay for school repairs, and often can’t pass local bonds at all. As a result, they rely entirely on state bond money.", + "simplified_description": "This measure would give schools and community colleges $10 billion for building repairs and upgrades. Poorer districts would get more state help to pay for these projects.", + "simplified_paragraph": "Proposition 2 would give $8.5 billion to K-12 schools and $1.5 billion to community colleges for building and repairs. Poorer districts and those with more English learners and foster kids would get more state funding. Some of the money would also go toward removing lead from water, kindergarten classrooms, and career training facilities. Many California schools are in bad shape, and this measure aims to help fix them.", + "affected_people": "Positively Affected\n- K-12 students, especially those in less affluent districts, those with high numbers of English learners, and those with high numbers of foster youth\n- Community college students\n- School staff and faculty\n- Construction workers and related industries\n- Local economies in areas where schools are renovated or built\n\nNegatively Affected\n- Taxpayers, due to increased taxes needed to fund the bonds\n- Potentially affluent school districts, if the matching grant formula significantly favors less affluent districts" + }, + { + "number": "Prop 3", + "title": "Reaffirm the right of same-sex couples to marry", + "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-3-same-sex-marriage/", + "details": "Proposition 3would enshrine the right to same-sex marriage into the California constitution, repealing Proposition 8 — a measure approved by voters in 2008 that defined marriage as between a man and a woman. In practice, the ballot measure would not change who can marry.\n\n\n\nCalifornia, the state with the nation’slargest LGBTQ population, was thrust into national spotlight in 2004, when then-San Francisco Mayor Gavin Newsom began issuing marriage licenses to same-sex couples, defying a federal ban on gay marriage. The California Supreme Court quickly shut it down, and Californians voted in 2008 to ban same-sex marriage in the state.\n\nThat language — while still on the books — is effectively void after the U.S. Supreme Court in 2013allowed same-sex marriageto resume in California, and the high courtlegalized same-sex marriage nationwidein a historic 2015 decision. In 2020, Nevada became the first state toenshrine the right to same-sex marriagein its constitution.\n\nCalifornia state Sen.Scott Wienerand AssemblymemberEvan Low, both Democrats in the Legislative LGBTQ Caucus, introduced the constitutional amendment as a preemptive protection after the U.S. Supreme Court overturned federal abortion protections in 2022. Justice Clarence Thomas, a conservative, said that the court should also reconsider theconstitutionality of same-sex marriage, but other conservatives on the bench disagreed.", + "simplified_description": "This proposition protects same-sex marriage in the California constitution. It won't change anything, as same-sex marriage is already legal.", + "simplified_paragraph": "Proposition 3 makes same-sex marriage a constitutional right in California, getting rid of an older law that only allowed marriage between a man and a woman. This change won't really affect who can get married now, since same-sex marriage is already legal. It's mainly a precaution to protect same-sex marriage if the Supreme Court were to ever change its mind.", + "affected_people": "Positively Affected\n- Same-sex couples in California who would have stronger legal protections for their marriages.\n- LGBTQ+ advocacy groups and individuals who see this as a victory for equality.\n- Individuals who support the codification of same-sex marriage rights.\n\nNegatively Affected\n- Individuals and groups who oppose same-sex marriage on religious or moral grounds. \n- Potentially no one materially, as same-sex marriage is already legal and practiced in California." + }, + { + "number": "Prop 4", + "title": "Borrow $10 billion to respond to climate change", + "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-4-climate-bond/", + "details": "ApprovingProposition 4would authorize $10 billion in debt to spend on environmental and climate projects, with the biggest chunk, $1.9 billion, for drinking water improvements. The bond prioritizes lower-income communities, and those most vulnerable to climate change, and requires annual audits.\n\nRepaying the money could cost $400 million a year over 40 years,a legislative analysis said, meaning taxpayers could spend $16 billion.\n\n\n\nEnvironmental groups and renewable energy advocates have been clamoring for increased spending on climate change and the environment in recent years, particularly after Gov. Gavin Newsom and the Legislature approved a $54.3 billion spending package called the “California Climate Commitment” in 2022, only to scale it back to $44.6 billion this budget-plagued year.\n\nAbout $3.8 billion would be spent on water projects — half to improve water quality, the remainder on protecting the state from floods and droughts, and other activities, including restoring rivers and lakes. The rest of the money would be spent on: wildfire and extreme heat projects, $1.95 billion; natural lands, parks and wildlife projects, $1.9 billion; coastal lands, bays and ocean protection, $1.2 billion; clean energy projects, $850 million; agricultural projects, $300 million.", + "simplified_description": "Proposition 4 wants to borrow $10 billion for environmental projects, mostly for cleaner drinking water. Paying it back could cost taxpayers $16 billion over forty years.", + "simplified_paragraph": "Proposition 4 asks voters to borrow $10 billion for environmental and climate work, like cleaner drinking water. Poorer communities and those facing climate dangers will be first in line for help. Paying back the loan could cost taxpayers $16 billion over 40 years. The money would also fund projects related to water, wildfires, parks, the coast, clean energy, and farms.", + "affected_people": "Positively Affected\n- Low-income communities\n- Communities vulnerable to climate change\n- Environmental groups\n- Renewable energy advocates\n- Companies involved in water projects, wildfire and extreme heat projects, natural lands projects, coastal protection, clean energy projects, and agricultural projects\n\nNegatively Affected\n- Taxpayers" + }, + { + "number": "Prop 5", + "title": "Lower voter approval requirements for local housing and infrastructure", + "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-5-vote-threshold/", + "details": "California makes it difficult for local governments to borrow money. Not only do most city and county bonds require voter approval, they need the support of at least two-thirds of those voting to pass.\n\nProposition 5would amend the California constitution by lowering the required threshold to 55% for any borrowing to fund affordable housing construction, down payment assistance programs and a host of “public infrastructure” projects, including those for water management, local hospitals and police stations, broadband networks and parks.\n\nIf it passes, the new cut-off would apply not just to future bonds, but any that are on the ballot this November.\n\n\n\nAssemblymemberCecilia Aguiar-Curry, a Democrat from Winters, has been trying and failing to get some version of this on the ballot since 2017. After a helpful promotion to Assembly majority leader, she finally got her way this year.\n\nThe Legislature voted to put Prop. 5 on the ballot last fall. But after a bit of political wrangling this spring, lawmakers passed asecond measureto make a few last-minute changes. Though an earlier version applied to certain tax hikes, theproposition now only covers bonds. It also now includes a ban on local governments using the money to buy up existing ​​single-family homes to convert them into affordable units. That change was required topersuade the powerful California Association of Realtorsnot to oppose the measure (though it gave money to the opposition campaign before then).", + "simplified_description": "California cities and counties need supermajorities to borrow money. Proposition 5 would make it easier for them to borrow for things like housing and parks.", + "simplified_paragraph": "California cities and counties need voters' okay to borrow money, and two-thirds of voters must agree. A new proposal, Proposition 5, would lower that requirement to 55% for borrowing related to affordable housing, infrastructure like water systems and hospitals, and other projects. If passed in November, this lower threshold would apply to current and future borrowing proposals. The real estate industry initially opposed the proposal but dropped their opposition after it was changed to prevent local governments from using the borrowed money to buy existing homes for affordable housing.", + "affected_people": "Positively Affected\n- Local governments seeking to fund affordable housing, infrastructure projects, and down payment assistance programs.\n- Residents who would benefit from improved infrastructure and increased access to affordable housing.\n- Construction companies and related industries involved in infrastructure development.\n- Developers of affordable housing projects.\n- First-time homebuyers utilizing down payment assistance programs.\n\nNegatively Affected\n- Taxpayers who may face increased property taxes or other local taxes to repay the bonds.\n- Residents who oppose specific projects funded by the bonds.\n- The California Association of Realtors (potentially, if the ban on using funds to purchase existing single-family homes is perceived as limiting their business opportunities)." + }, + { + "number": "Prop 6", + "title": "Limit forced labor in state prisons", + "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-6-involuntary-servitude/", + "details": "Proposition 6would amend the California Constitution to prohibit the state from punishing inmates with involuntary work assignments and from disciplining those who refuse to work. Instead, state prisons could set up a volunteer work assignment program to take time off sentences in the form of credits. It would let county or city ordinances set up a pay scale for inmates in local jails.\n\nThe measure’s potential costs remain unknown and a point of contention, though arelated law sayscompensation would be set by the state corrections department.\n\n\n\nCalifornia wasn’t a slave state, but it does have a history of forced labor. Lawmakers created a reparations task force and directed it to address historical inequities that harmed Black residents. Thetask force recommendedchanging the state constitution to prohibit any form of enslavement as one of 14 key priorities this session.\n\nLegislators considered a similar measure in 2022, but support tanked after the California Department of Finance estimated that it would cost about $1.5 billion annually to pay minimum wage to prisoners. This year’s amendment has the voluntary work program as a way to get around that issue.\n\nOf about 90,000 inmates, the state’s prison system employs nearly 40,000 who complete a variety of tasks such as construction, yard work, cooking, cleaning and firefighting. Most of them earn less than 74 cents an hour, although inmate firefighters can earn as much as $10 a day.California’s minimum wageis $16 an hour, and state law permits the corrections department to pay up to half of that rate.", + "simplified_description": "This proposal would end forced prison labor in California and let inmates volunteer for jobs to shorten their sentences. It also might let cities and counties pay inmates for work.", + "simplified_paragraph": "Proposition 6 would stop California from making prisoners work and punishing those who refuse. Instead, prisons could offer voluntary work programs where inmates could earn time off their sentences. Local jails could also decide how much to pay inmates for work. It's unclear how much this will cost the state, but it could be expensive.", + "affected_people": "Positively Affected\n- Inmates, who would gain more control over their labor and potential for earning.\n- Proponents of prison reform, who view involuntary work as exploitative.\n\nNegatively Affected\n- Taxpayers, who may have to bear the costs of a volunteer program or increased inmate pay.\n- State budget, which could face increased costs depending on implementation.\n- Public agencies that rely on inmate labor, potentially impacting services like firefighting." + }, + { + "number": "Prop 32", + "title": "Raise the state minimum wage to $18", + "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-32-minimum-wage/", + "details": "Proposition 32would raise the minimum wage to $17 for the remainder of 2024, and $18 an hour starting in January 2025 — a bump from the current $16. Small businesses with 25 or fewer employees would be required to start paying at least $17 next year, and $18 in 2026. If voters say “yes,” California will have the nation’s highest state minimum wage.\n\nStarting in 2027, the wage would be adjusted based on inflation, as the state already does. The hike would apply statewide, but it would have a bigger effect in some areas than in others. Nearly 40 California cities have local minimum wages that are higher than the state’s, including six that already require at least $18 and several already are just a small inflationary adjustment away from it.\n\n\n\nIn 2022, California became the first state to reach a $15 minimum wage — a figure long fought for by unions and restaurant workers. But labor activists say the state’s sky-high cost of living has already made that standard barely livable. According to the MIT Living Wage Calculator, even in the cheapest California county (Modoc), a single adult with no children would need to make at least $20.32 an hour to comfortably afford the basics. The statewide average? $27.32.\n\nWealthy startup-investor-turned-anti-poverty-advocate Joe Sanberg first pushed an $18 minimum wage three years ago, and poured $10 million into a signature-gathering effort to qualify the measure for the 2022 ballot. The measure included more gradual wage hikes starting in 2023. But the campaignmissed a key deadline, pushing it to this year’s ballot. That means a quicker hike to $18 in January if voters approve the measure in November.", + "simplified_description": "This proposition raises California's minimum wage to $18 by 2025. It also ties future increases to inflation.", + "simplified_paragraph": "Proposition 32 would increase California's minimum wage to $17 per hour in 2024 and $18 in 2025. Small businesses with 25 or fewer employees would reach $18 in 2026. After 2027, the minimum wage would go up each year based on inflation. If passed, this would make California's minimum wage the highest in the US.", + "affected_people": "Positively Affected\n- Minimum wage workers in California, especially those in areas without higher local minimum wages\n- Labor unions and worker advocacy groups\n\nNegatively Affected\n- Small businesses with 25 or fewer employees, who will have to pay higher wages sooner than larger businesses\n- Businesses in areas with lower costs of living, where the impact of the wage increase will be proportionally larger" + }, + { + "number": "Prop 33", + "title": "Allow local governments to impose rent controls", + "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-33-rent-control/", + "details": "Many cities, including San Francisco and Los Angeles, limit the amount a landlord can raise the rent each year — a policy known as rent control. But for nearly 30 years, California has imposed limits on those limits, via a law known as Costa-Hawkins. Cities cannot set rent control on single-family homes or apartments built after 1995. And landlords are free to set their own rental rates when new tenants move in.\n\nIfProposition 33passes, that would change. Cities would be allowed to control rents on any type of housing – including single-family homes and new apartments, and for new tenants.\n\n\n\nNearly 30% of California renters spend more than half their income on rent — higher than in any other state except Florida and Louisiana, according to thePublic Policy Institute of California.\n\nTo change that, tenant advocates have been fighting Costa-Hawkins for years, but so far, without success. They tried to overturn it with ballot measures in2018and2020. Lawmakers also tried with legislation. While those efforts failed, Gov.Gavin Newsomin 2019 signed a law limiting annual rent increases statewide to 5% plus inflation.\n\nSupporters of Prop. 33 say that doesn’t go far enough. They hope this finally is the year to upend the decades-old rules controlling rent control. But landlord groups opposing the idea tend to have deep pockets, and have been willing to spend a small fortune to convince voters that rent control is not the answer to the state’s housing crisis.", + "simplified_description": "California law currently restricts how cities control rent increases. Proposition 33 would give cities more power to set rent limits on all housing types.", + "simplified_paragraph": "California law currently restricts how much cities can control rents. Landlords can charge new tenants whatever they want, and newer apartments and houses aren't covered by rent control. Proposition 33 would let cities control rent on all housing, including for new tenants. Rent control supporters have tried to make these changes before, but landlords have spent a lot of money to defeat those efforts.", + "affected_people": "Positively Affected\n- Renters in California, especially long-term renters and those in single-family homes or newer apartments\n- Tenant advocacy groups\n\nNegatively Affected\n- Landlords in California\n- Developers and investors in new housing construction\n- Prospective renters (due to potentially decreased housing availability)" + }, + { + "number": "Prop 34", + "title": "Require certain providers to use prescription drug revenue for patients", + "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-34-patient-spending/", + "details": "Since 1992, federal law has given health care providers a deal: Serve low-income and at-risk patients and get a discount on pharmaceuticals. Providers that make use of this program can turn around and sell those drugs at retail rates. Their profits can then be used to expand their healthcare services to disadvantaged groups.\n\nProposition 34would require some California providers to spend at least 98% of that net drug sale revenue on “direct patient care.” Providers that don’t risk having their state license and tax-exempt status revoked and losing out on government contracts.\n\nBut the proposition doesn’t apply to all providers — only those that spend at least $100 million on expenses other than direct care, that also own and operate apartment buildings and that have racked up at least 500 severe health and safety violations in the last decade.\n\nAs far as anyone can tell, that only applies to one organization: The AIDS Healthcare Foundation.The measure would also put into law a Newsom administration policy that requires all state agencies to negotiate forlower drug pricesas a single entity.\n\n\n\nThe short answer is that a lot of politicians and housing interest groups really don’t like Michael Weinstein.\n\nWeinstein is the longtime president of the Los Angeles-based AIDS Healthcare Foundation, which operates HIV/AIDS clinics in 15 states. Under his leadership, the foundation has also become a major player in state and local housing politics. It has poured tens of millions of dollars into two unsuccessful statewide rent control measures (Prop. 33on this year’s ballot is round three). It has aggressively lobbied and campaigned against legislation requiring local governments to permit denser housing, at one point likening a bill authored by San Francisco state Sen. Scott Wiener to “negro removal.” In 2017, the foundation backed apartial moratorium on development in Los Angeles and sued to halt construction on residential highrises. Along the way, the foundation has amassed a sizable portfolio of rental properties in LA’s Skid Row that have beensaddled with habitability and health complaints.\n\nThough Weinstein has plenty of political foes, a familiar one is funding this initiative: The California Apartment Association, the state’s premier landlord lobby and a major opponent of rent control.", + "simplified_description": "A California proposition targets a single healthcare provider, the AIDS Healthcare Foundation, by restricting its drug profits. This seems motivated by the foundation's president's unpopular housing stances and clashes with landlord groups.", + "simplified_paragraph": "A California law change (Proposition 34) targets a single healthcare provider, the AIDS Healthcare Foundation, by forcing it to spend almost all its drug sale profits on patient care. This group gets discounted drugs for helping low-income patients but can sell them at full price. The foundation's leader has fought against housing laws, irritating powerful apartment groups who are now funding this law change. The proposition would also let California negotiate lower drug prices statewide.", + "affected_people": "Positively Affected\n- Low-income and at-risk patients served by the AIDS Healthcare Foundation (if the proposition forces the foundation to reinvest more in direct patient care).\n- California taxpayers (if the single-entity drug price negotiation policy results in lower drug costs for state agencies).\n\nNegatively Affected\n- AIDS Healthcare Foundation (due to restrictions on use of drug sale revenue, potential loss of licenses and contracts, and targeting by the proposition).\n- Michael Weinstein (president of AHF, facing political attacks and potential damage to his organization)." + }, + { + "number": "Prop 35", + "title": "Make permanent a tax on managed health care plans", + "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-35-health-care-tax/", + "details": "Proposition 35would require the state to spend the money from a tax on health care plans on Medi-Cal, the public insurance program for low-income Californians and people with disabilities. The revenue would go to primary and specialty care, emergency services, family planning, mental health and prescription drugs. It would also prevent legislators from using the tax revenue to replace existing state Medi-Cal spending. Over the next four years, it is projected to generate upwards of $35 billion.\n\nEarlier this year,Gov. Gavin Newsom proposed using the tax revenueto cover other Medi-Cal program expenses, walking back a deal to support new investments.\n\n\n\nLawmakers have dramatically expanded Medi-Cal in the past 10 years to include all low-income residents regardless of citizenship. Benefits have also been restored from Great Recession-era cuts to include dental insurance, hearing aids and doulas. Today, more than 14 million Californians — roughly a third of the state population — use Medi-Cal. Over the same time period, payments to doctors and other Medi-Cal providers have increased only incrementally if at all. According to theKaiser Family Foundation, California’s reimbursement rate falls in the bottom third nationally. As a result, many providerswon’t treat Medi-Cal patients.\n\nThe coalition of doctors, hospitals and clinics that gathered signatures to place this issue on the ballot want the tax revenue to go toward increased payments.", + "simplified_description": "This measure makes a healthcare tax pay for Medi-Cal, helping low-income Californians. It also makes sure the state uses this money to improve Medi-Cal, not replace existing funds.", + "simplified_paragraph": "A California ballot measure wants to use taxes from health plans to fund Medi-Cal, which covers low-income and disabled residents. This money would pay for things like doctor visits, emergency care, and mental health services. The measure also stops the state from using this tax money to replace existing Medi-Cal funds. Doctors and hospitals support the measure because they want to be paid more for treating Medi-Cal patients.", + "affected_people": "Positively Affected\n- Low-income Californians\n- People with disabilities\n- Medi-Cal providers (doctors, hospitals, clinics)\n- Medi-Cal patients seeking primary and specialty care, emergency services, family planning, mental health services, and prescription drugs\n\nNegatively Affected\n- Gov. Gavin Newsom (loss of flexibility in budget allocation)\n- Potentially other state programs that could have benefited from the tax revenue\n- Health care plans (payers of the tax)" + }, + { + "number": "Prop 36", + "title": "Increase penalties for theft and drug trafficking", + "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-36-crime-penalties/", + "details": "Proposition 36would reclassify some misdemeanor theft and drug crimes as felonies.\n\nThe measure would also create a new category of crime — a “treatment-mandated felony.” People who don’t contest the charges could complete drug treatment instead of going to prison, but if they don’t finish treatment, they still face up to three years in prison.\n\n\n\nTen years ago, voters approved Proposition 47, which sought to reduce California’s prison overcrowding by making some theft and drug crimes into misdemeanors. Since then, prosecutors, police and big box retailershave blamed the lawfor an increase in property crimes and homelessness. Prop. 36 is their attempt to unwind Prop. 47.\n\nDuring the pandemic, the rate of shoplifting and commercial burglaries skyrocketed, especially in Los Angeles, Alameda, San Mateo and Sacramento counties. Statewide, the Public Policy Institute of California found that reported shoplifting of merchandise worth up to $950soared 28% over the past five years.That’s the highest observed level since 2000.\n\nCombining shoplifting with commercial burglaries, the institute’s researchers found that total reported thefts were 18% higher than in 2019.", + "simplified_description": "This proposition makes some theft and drug charges more serious. It also offers drug treatment instead of jail, but failing treatment means prison time.", + "simplified_paragraph": "Proposition 36 wants to make some minor theft and drug offenses more serious crimes. It would also create a new type of felony where people can go to drug treatment instead of prison. However, they could still face prison time if they don't complete the treatment. This proposition tries to reverse an older law that made these crimes less serious due to prison overcrowding. Supporters of Proposition 36 say this older law led to more theft and homelessness.", + "affected_people": "Positively Affected\n- Big box retailers and other businesses experiencing theft\n- People who believe stronger penalties deter crime\n- Potentially, people struggling with addiction who successfully complete mandated treatment\n\nNegatively Affected\n- People accused of low-level theft and drug crimes\n- People who believe the proposition will lead to increased incarceration and racial disparities\n- People experiencing homelessness and poverty who may resort to theft out of desperation\n- Taxpayers who will bear the cost of increased incarceration" + } +] \ No newline at end of file diff --git a/backend/props.json b/backend/props.json deleted file mode 100644 index 5f9bd79..0000000 --- a/backend/props.json +++ /dev/null @@ -1,102 +0,0 @@ -[ - { - "number": "Prop 2", - "title": "Borrow $10 billion to build schools, colleges", - "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-2-school-bond/", - "details": "Proposition 2would provide $8.5 billion to K-12 schools and $1.5 billion to community colleges to renovate, fix and construct facilities. The money would be distributed through matching grants, with the state paying a greater share of costs for less affluent districts and those with higher numbers of English learners and foster youth. Some of the money would be set aside for removing lead from water, creating transitional kindergarten classrooms and building career and technical education facilities.\n\n\n\nThousands of California school buildings are in poor shape, with leaky roofs, broken air conditioning, peeling paint and other health and safety hazards. According to thePublic Policy Institute of California, 38% of students attend schools that don’t meet the state’s minimum safety standards. Research has shown that students who attend school in sub-standard facilities tend to have lower attendance rates, lower morale and lower achievement.\n\nUnlike many other states, California does not pay for school repairs through a permanent funding stream. Money comes entirely from state and local bonds. The state’s last school facilities bond, a $15 billion proposal in 2020, failed, leaving the state’s school repair account nearly empty.\n\nAffluent school districts can raise more money for repairs through local bonds because local property values are higher, thereby generating more money through local property taxes. Smaller and lower-income districts struggle to raise enough bond money to pay for school repairs, and often can’t pass local bonds at all. As a result, they rely entirely on state bond money.", - "simplified_description": "This proposition gives schools and community colleges billions for building repairs and upgrades. Poorer districts and those with more English learners and foster kids will get more state help.", - "simplified_paragraph": "Proposition 2 would give 8.5 billion dollars to K-12 schools and 1.5 billion to community colleges for building and repairs. Poorer districts and those with more English learners and foster kids would get more state funding. Some of the money would be used to get rid of lead in water, build pre-K classrooms, and improve career training facilities. Many California schools are in bad shape, and this measure would help fix them.", - "affected_people": "Positively Affected\n- Students in K-12 and community colleges, especially those in less affluent districts and those with higher numbers of English learners and foster youth\n- School staff and faculty\n- Construction workers and related industries\n- Local communities surrounding improved schools\n\nNegatively Affected\n- Taxpayers, due to increased taxes from the bond measure\n- Potentially, other state programs that may experience funding cuts to accommodate the bond repayments (though this is not explicitly stated in the text)", - "personalization_summary": null - }, - { - "number": "Prop 3", - "title": "Reaffirm the right of same-sex couples to marry", - "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-3-same-sex-marriage/", - "details": "Proposition 3would enshrine the right to same-sex marriage into the California constitution, repealing Proposition 8 — a measure approved by voters in 2008 that defined marriage as between a man and a woman. In practice, the ballot measure would not change who can marry.\n\n\n\nCalifornia, the state with the nation’slargest LGBTQ population, was thrust into national spotlight in 2004, when then-San Francisco Mayor Gavin Newsom began issuing marriage licenses to same-sex couples, defying a federal ban on gay marriage. The California Supreme Court quickly shut it down, and Californians voted in 2008 to ban same-sex marriage in the state.\n\nThat language — while still on the books — is effectively void after the U.S. Supreme Court in 2013allowed same-sex marriageto resume in California, and the high courtlegalized same-sex marriage nationwidein a historic 2015 decision. In 2020, Nevada became the first state toenshrine the right to same-sex marriagein its constitution.\n\nCalifornia state Sen.Scott Wienerand AssemblymemberEvan Low, both Democrats in the Legislative LGBTQ Caucus, introduced the constitutional amendment as a preemptive protection after the U.S. Supreme Court overturned federal abortion protections in 2022. Justice Clarence Thomas, a conservative, said that the court should also reconsider theconstitutionality of same-sex marriage, but other conservatives on the bench disagreed.", - "simplified_description": "This change would officially allow same-sex marriage in California's constitution. It wouldn't really change current marriage laws.", - "simplified_paragraph": "Proposition 3 would make same-sex marriage a constitutional right in California, getting rid of an older rule that limited marriage to a man and a woman. This change won't actually affect who can get married now, as same-sex marriage is already legal. This is mostly a precaution after the Supreme Court overturned Roe v Wade, with some worried they might revisit same-sex marriage rights as well.", - "affected_people": "Positively Affected\n- Same-sex couples in California who would have additional legal protections for their marriages.\n- LGBTQ+ advocacy groups and individuals who see this as a victory for equal rights.\n\nNegatively Affected\n- Individuals and groups who oppose same-sex marriage on religious or moral grounds. They may feel their beliefs are not being respected.\n- There may be no direct negative impacts, as the proposition mainly codifies existing practice.", - "personalization_summary": null - }, - { - "number": "Prop 4", - "title": "Borrow $10 billion to respond to climate change", - "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-4-climate-bond/", - "details": "ApprovingProposition 4would authorize $10 billion in debt to spend on environmental and climate projects, with the biggest chunk, $1.9 billion, for drinking water improvements. The bond prioritizes lower-income communities, and those most vulnerable to climate change, and requires annual audits.\n\nRepaying the money could cost $400 million a year over 40 years,a legislative analysis said, meaning taxpayers could spend $16 billion.\n\n\n\nEnvironmental groups and renewable energy advocates have been clamoring for increased spending on climate change and the environment in recent years, particularly after Gov. Gavin Newsom and the Legislature approved a $54.3 billion spending package called the “California Climate Commitment” in 2022, only to scale it back to $44.6 billion this budget-plagued year.\n\nAbout $3.8 billion would be spent on water projects — half to improve water quality, the remainder on protecting the state from floods and droughts, and other activities, including restoring rivers and lakes. The rest of the money would be spent on: wildfire and extreme heat projects, $1.95 billion; natural lands, parks and wildlife projects, $1.9 billion; coastal lands, bays and ocean protection, $1.2 billion; clean energy projects, $850 million; agricultural projects, $300 million.", - "simplified_description": "This proposition borrows $10 billion for environmental projects, like cleaner drinking water. Paying it back could cost taxpayers $16 billion over time.", - "simplified_paragraph": "Proposition 4 asks voters to approve borrowing $10 billion for environmental and climate work, like cleaner drinking water. Poorer communities and those facing the worst climate impacts will be prioritized. Paying back this loan could cost taxpayers $16 billion over 40 years. The money would also fund projects related to wildfires, droughts, parks, and clean energy.", - "affected_people": "Positively Affected\n- Low-income communities\n- Communities vulnerable to climate change\n- Environmental groups\n- Renewable energy advocates\n- Companies involved in water projects, wildfire and extreme heat projects, natural lands projects, coastal protection, clean energy projects, and agricultural projects\n\nNegatively Affected\n- Taxpayers", - "personalization_summary": null - }, - { - "number": "Prop 5", - "title": "Lower voter approval requirements for local housing and infrastructure", - "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-5-vote-threshold/", - "details": "California makes it difficult for local governments to borrow money. Not only do most city and county bonds require voter approval, they need the support of at least two-thirds of those voting to pass.\n\nProposition 5would amend the California constitution by lowering the required threshold to 55% for any borrowing to fund affordable housing construction, down payment assistance programs and a host of “public infrastructure” projects, including those for water management, local hospitals and police stations, broadband networks and parks.\n\nIf it passes, the new cut-off would apply not just to future bonds, but any that are on the ballot this November.\n\n\n\nAssemblymemberCecilia Aguiar-Curry, a Democrat from Winters, has been trying and failing to get some version of this on the ballot since 2017. After a helpful promotion to Assembly majority leader, she finally got her way this year.\n\nThe Legislature voted to put Prop. 5 on the ballot last fall. But after a bit of political wrangling this spring, lawmakers passed asecond measureto make a few last-minute changes. Though an earlier version applied to certain tax hikes, theproposition now only covers bonds. It also now includes a ban on local governments using the money to buy up existing ​​single-family homes to convert them into affordable units. That change was required topersuade the powerful California Association of Realtorsnot to oppose the measure (though it gave money to the opposition campaign before then).", - "simplified_description": "California cities and counties need supermajorities to borrow money. Proposition 5 would make it easier for them to borrow for things like housing and parks.", - "simplified_paragraph": "California cities and counties need voters' okay to borrow money, and two-thirds of voters must agree. A new proposal, Proposition 5, would make it easier to borrow for things like affordable housing, hospitals, and parks by lowering the required voter approval to 55%. This change would apply to current and future borrowing proposals. A lawmaker has been working on this for years and finally got it on the ballot after some political compromises, like dropping a tax increase part and adding a rule against using the money to buy existing homes.", - "affected_people": "Positively Affected\n- Local governments seeking to fund affordable housing, public infrastructure projects, and down payment assistance programs.\n- Residents in need of affordable housing.\n- Communities needing improved infrastructure (water management, hospitals, police stations, broadband, parks).\n- Construction companies and related industries involved in infrastructure projects.\n- First-time homebuyers who might benefit from down payment assistance.\n\nNegatively Affected\n- Taxpayers concerned about increased local debt and potential property tax increases.\n- Residents who oppose specific projects funded by the bonds.\n- The California Association of Realtors (potentially, though they ultimately did not oppose the measure).\n- Proponents of fiscal restraint in local government spending.", - "personalization_summary": null - }, - { - "number": "Prop 6", - "title": "Limit forced labor in state prisons", - "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-6-involuntary-servitude/", - "details": "Proposition 6would amend the California Constitution to prohibit the state from punishing inmates with involuntary work assignments and from disciplining those who refuse to work. Instead, state prisons could set up a volunteer work assignment program to take time off sentences in the form of credits. It would let county or city ordinances set up a pay scale for inmates in local jails.\n\nThe measure’s potential costs remain unknown and a point of contention, though arelated law sayscompensation would be set by the state corrections department.\n\n\n\nCalifornia wasn’t a slave state, but it does have a history of forced labor. Lawmakers created a reparations task force and directed it to address historical inequities that harmed Black residents. Thetask force recommendedchanging the state constitution to prohibit any form of enslavement as one of 14 key priorities this session.\n\nLegislators considered a similar measure in 2022, but support tanked after the California Department of Finance estimated that it would cost about $1.5 billion annually to pay minimum wage to prisoners. This year’s amendment has the voluntary work program as a way to get around that issue.\n\nOf about 90,000 inmates, the state’s prison system employs nearly 40,000 who complete a variety of tasks such as construction, yard work, cooking, cleaning and firefighting. Most of them earn less than 74 cents an hour, although inmate firefighters can earn as much as $10 a day.California’s minimum wageis $16 an hour, and state law permits the corrections department to pay up to half of that rate.", - "simplified_description": "This proposal would stop forced prison labor in California and let inmates volunteer for work to shorten their sentences. It also might let cities and counties pay inmates for work.", - "simplified_paragraph": "Proposition 6 would stop California from forcing inmates to work and punishing those who refuse. Instead, prisons could offer voluntary work programs where inmates could shorten their sentences. Local jails could also decide how much to pay inmates for work. The cost of this change is uncertain, but it's likely cheaper than a previous proposal because work isn't required.", - "affected_people": "Positively Affected\n- Inmates\n- Proponents of prison reform and rehabilitation\n\nNegatively Affected\n- Taxpayers (potentially due to unknown costs)\n- Victims of crime (potentially if sentences are shortened)\n- State budget (potentially)\n- Those who believe in the rehabilitative power of work", - "personalization_summary": null - }, - { - "number": "Prop 32", - "title": "Raise the state minimum wage to $18", - "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-32-minimum-wage/", - "details": "Proposition 32would raise the minimum wage to $17 for the remainder of 2024, and $18 an hour starting in January 2025 — a bump from the current $16. Small businesses with 25 or fewer employees would be required to start paying at least $17 next year, and $18 in 2026. If voters say “yes,” California will have the nation’s highest state minimum wage.\n\nStarting in 2027, the wage would be adjusted based on inflation, as the state already does. The hike would apply statewide, but it would have a bigger effect in some areas than in others. Nearly 40 California cities have local minimum wages that are higher than the state’s, including six that already require at least $18 and several already are just a small inflationary adjustment away from it.\n\n\n\nIn 2022, California became the first state to reach a $15 minimum wage — a figure long fought for by unions and restaurant workers. But labor activists say the state’s sky-high cost of living has already made that standard barely livable. According to the MIT Living Wage Calculator, even in the cheapest California county (Modoc), a single adult with no children would need to make at least $20.32 an hour to comfortably afford the basics. The statewide average? $27.32.\n\nWealthy startup-investor-turned-anti-poverty-advocate Joe Sanberg first pushed an $18 minimum wage three years ago, and poured $10 million into a signature-gathering effort to qualify the measure for the 2022 ballot. The measure included more gradual wage hikes starting in 2023. But the campaignmissed a key deadline, pushing it to this year’s ballot. That means a quicker hike to $18 in January if voters approve the measure in November.", - "simplified_description": "This measure would raise California's minimum wage to $18 by 2025. It would also adjust the minimum wage for inflation each year after that.", - "simplified_paragraph": "Proposition 32 would increase California's minimum wage to $17 per hour in 2024 and $18 in 2025. Small businesses would have an extra year to reach $18. This would make California's minimum wage the highest in the US. Future increases would be tied to inflation, like they are now.", - "affected_people": "Positively Affected\n- Minimum wage workers in California, especially those in areas without higher local minimum wages\n- Labor unions and worker advocacy groups\n\nNegatively Affected\n- Small businesses with 25 or fewer employees, who will have to pay higher wages sooner than larger businesses\n- Businesses in areas with lower costs of living, where the impact of the wage increase will be proportionally greater", - "personalization_summary": null - }, - { - "number": "Prop 33", - "title": "Allow local governments to impose rent controls", - "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-33-rent-control/", - "details": "Many cities, including San Francisco and Los Angeles, limit the amount a landlord can raise the rent each year — a policy known as rent control. But for nearly 30 years, California has imposed limits on those limits, via a law known as Costa-Hawkins. Cities cannot set rent control on single-family homes or apartments built after 1995. And landlords are free to set their own rental rates when new tenants move in.\n\nIfProposition 33passes, that would change. Cities would be allowed to control rents on any type of housing – including single-family homes and new apartments, and for new tenants.\n\n\n\nNearly 30% of California renters spend more than half their income on rent — higher than in any other state except Florida and Louisiana, according to thePublic Policy Institute of California.\n\nTo change that, tenant advocates have been fighting Costa-Hawkins for years, but so far, without success. They tried to overturn it with ballot measures in2018and2020. Lawmakers also tried with legislation. While those efforts failed, Gov.Gavin Newsomin 2019 signed a law limiting annual rent increases statewide to 5% plus inflation.\n\nSupporters of Prop. 33 say that doesn’t go far enough. They hope this finally is the year to upend the decades-old rules controlling rent control. But landlord groups opposing the idea tend to have deep pockets, and have been willing to spend a small fortune to convince voters that rent control is not the answer to the state’s housing crisis.", - "simplified_description": "California law currently restricts how much cities can limit rent increases. Proposition 33 would let cities have stronger rent control.", - "simplified_paragraph": "Some California cities limit how much landlords can raise rent each year. A state law, Costa-Hawkins, prevents these limits from applying to newer apartments, houses, and new tenants. Proposition 33 would let cities control rent on all housing. Landlords have successfully fought similar measures in the past, arguing rent control worsens the housing shortage.", - "affected_people": "Positively Affected\n- Renters in single-family homes and newer apartments\n- Renters moving into new units\n- Tenant advocates\n\nNegatively Affected\n- Landlords\n- Developers (potentially, due to decreased investment incentive)", - "personalization_summary": null - }, - { - "number": "Prop 34", - "title": "Require certain providers to use prescription drug revenue for patients", - "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-34-patient-spending/", - "details": "Since 1992, federal law has given health care providers a deal: Serve low-income and at-risk patients and get a discount on pharmaceuticals. Providers that make use of this program can turn around and sell those drugs at retail rates. Their profits can then be used to expand their healthcare services to disadvantaged groups.\n\nProposition 34would require some California providers to spend at least 98% of that net drug sale revenue on “direct patient care.” Providers that don’t risk having their state license and tax-exempt status revoked and losing out on government contracts.\n\nBut the proposition doesn’t apply to all providers — only those that spend at least $100 million on expenses other than direct care, that also own and operate apartment buildings and that have racked up at least 500 severe health and safety violations in the last decade.\n\nAs far as anyone can tell, that only applies to one organization: The AIDS Healthcare Foundation.The measure would also put into law a Newsom administration policy that requires all state agencies to negotiate forlower drug pricesas a single entity.\n\n\n\nThe short answer is that a lot of politicians and housing interest groups really don’t like Michael Weinstein.\n\nWeinstein is the longtime president of the Los Angeles-based AIDS Healthcare Foundation, which operates HIV/AIDS clinics in 15 states. Under his leadership, the foundation has also become a major player in state and local housing politics. It has poured tens of millions of dollars into two unsuccessful statewide rent control measures (Prop. 33on this year’s ballot is round three). It has aggressively lobbied and campaigned against legislation requiring local governments to permit denser housing, at one point likening a bill authored by San Francisco state Sen. Scott Wiener to “negro removal.” In 2017, the foundation backed apartial moratorium on development in Los Angeles and sued to halt construction on residential highrises. Along the way, the foundation has amassed a sizable portfolio of rental properties in LA’s Skid Row that have beensaddled with habitability and health complaints.\n\nThough Weinstein has plenty of political foes, a familiar one is funding this initiative: The California Apartment Association, the state’s premier landlord lobby and a major opponent of rent control.", - "simplified_description": "This proposition targets one specific group, the AIDS Healthcare Foundation, by forcing them to spend most of their drug sale profits on patient care. Powerful housing groups dislike the foundation's president and are funding this measure.", - "simplified_paragraph": "A law lets healthcare providers buy discounted drugs for low-income patients and resell them at full price, using the profits to help more people. A new California proposal would force certain providers to spend almost all of those profits directly on patient care. This proposal seems targeted at one specific group, the AIDS Healthcare Foundation, because it only applies to large providers who also own apartments and have many health violations. This is likely driven by political disagreements with the foundation's president, especially regarding housing policy.", - "affected_people": "Positively Affected\n- Low-income and at-risk patients served by AIDS Healthcare Foundation (potentially through increased direct patient care spending).\n- State agencies (potentially through lower drug prices negotiated as a single entity).\n- Supporters of denser housing (due to reduced political influence of AIDS Healthcare Foundation).\n\nNegatively Affected\n- AIDS Healthcare Foundation (due to restrictions on use of drug sale revenue, potential loss of license, tax-exempt status, and government contracts).\n- Michael Weinstein (due to reduced political influence).", - "personalization_summary": null - }, - { - "number": "Prop 35", - "title": "Make permanent a tax on managed health care plans", - "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-35-health-care-tax/", - "details": "Proposition 35would require the state to spend the money from a tax on health care plans on Medi-Cal, the public insurance program for low-income Californians and people with disabilities. The revenue would go to primary and specialty care, emergency services, family planning, mental health and prescription drugs. It would also prevent legislators from using the tax revenue to replace existing state Medi-Cal spending. Over the next four years, it is projected to generate upwards of $35 billion.\n\nEarlier this year,Gov. Gavin Newsom proposed using the tax revenueto cover other Medi-Cal program expenses, walking back a deal to support new investments.\n\n\n\nLawmakers have dramatically expanded Medi-Cal in the past 10 years to include all low-income residents regardless of citizenship. Benefits have also been restored from Great Recession-era cuts to include dental insurance, hearing aids and doulas. Today, more than 14 million Californians — roughly a third of the state population — use Medi-Cal. Over the same time period, payments to doctors and other Medi-Cal providers have increased only incrementally if at all. According to theKaiser Family Foundation, California’s reimbursement rate falls in the bottom third nationally. As a result, many providerswon’t treat Medi-Cal patients.\n\nThe coalition of doctors, hospitals and clinics that gathered signatures to place this issue on the ballot want the tax revenue to go toward increased payments.", - "simplified_description": "This proposition makes healthcare taxes go to Medi-Cal, helping low-income Californians. Doctors want this money to boost their pay for treating Medi-Cal patients.", - "simplified_paragraph": "A California ballot measure wants to use taxes from health plans to improve Medi-Cal, the state's health program for low-income and disabled people. The money would go to basic and specialized care, emergencies, family planning, mental health, and medications. The measure would also prevent the state from using the money for other things. Doctors, hospitals, and clinics support this measure because they want higher payments for treating Medi-Cal patients.", - "affected_people": "Positively Affected\n- Low-income Californians\n- People with disabilities\n- Medi-Cal patients\n- Doctors, hospitals, and clinics that treat Medi-Cal patients\n\nNegatively Affected\n- Gov. Gavin Newsom (loss of flexibility in budget)\n- Potentially other state programs that could have benefited from the tax revenue (if the governor's proposal had gone through)", - "personalization_summary": null - }, - { - "number": "Prop 36", - "title": "Increase penalties for theft and drug trafficking", - "url": "https://calmatters.org/california-voter-guide-2024/propositions/prop-36-crime-penalties/", - "details": "Proposition 36would reclassify some misdemeanor theft and drug crimes as felonies.\n\nThe measure would also create a new category of crime — a “treatment-mandated felony.” People who don’t contest the charges could complete drug treatment instead of going to prison, but if they don’t finish treatment, they still face up to three years in prison.\n\n\n\nTen years ago, voters approved Proposition 47, which sought to reduce California’s prison overcrowding by making some theft and drug crimes into misdemeanors. Since then, prosecutors, police and big box retailershave blamed the lawfor an increase in property crimes and homelessness. Prop. 36 is their attempt to unwind Prop. 47.\n\nDuring the pandemic, the rate of shoplifting and commercial burglaries skyrocketed, especially in Los Angeles, Alameda, San Mateo and Sacramento counties. Statewide, the Public Policy Institute of California found that reported shoplifting of merchandise worth up to $950soared 28% over the past five years.That’s the highest observed level since 2000.\n\nCombining shoplifting with commercial burglaries, the institute’s researchers found that total reported thefts were 18% higher than in 2019.", - "simplified_description": "This proposition makes some theft and drug crimes more serious. It also offers drug treatment instead of jail, but you could still go to prison if you fail treatment.", - "simplified_paragraph": "Proposition 36 wants to make some theft and drug crimes felonies again, instead of misdemeanors. It would also create a new type of felony where people can go to drug treatment instead of prison. But if they don't finish treatment, they could still get up to three years in prison. This proposition tries to reverse an older law that made these crimes less serious because people thought it led to more stealing and homelessness.", - "affected_people": "Positively Affected\n- Big box retailers and other businesses experiencing theft\n- Law enforcement and prosecutors who believe Prop 47 led to increased crime\n- Potentially, communities experiencing high rates of property crime, if the proposition leads to a decrease in such crimes\n- People struggling with addiction who successfully complete mandated treatment\n\nNegatively Affected\n- People accused of low-level theft and drug offenses who may now face felony charges\n- People struggling with addiction who are unable to complete mandated treatment\n- Public defenders and the court system, which may experience increased caseloads\n- Taxpayers who may bear the cost of increased incarceration if the proposition does not successfully reduce crime", - "personalization_summary": null - } -] diff --git a/backend/test_user_profile.json b/backend/test_user_profile.json new file mode 100644 index 0000000..0b02d0d --- /dev/null +++ b/backend/test_user_profile.json @@ -0,0 +1,23 @@ +{ + "first_name": "Jordan", + "last_name": "Lee", + "date_of_birth": "1988-03-14", + "email": "jordan.lee@example.com", + "gender": "Female", + "county": "San Francisco", + "income_bracket": "100k-150k", + "education_level": "Bachelor's Degree", + "occupation": "Software Engineer", + "family_size": 1, + "race_ethnicity": "White", + "policy_preferences": { + "Climate change": "Left", + "Universal healthcare": "Left", + "Prison reform": "Right", + "Abortion": "Left", + "Education": "Left", + "Immigration": "Left", + "Military spending": "Neutral" + } + } + \ No newline at end of file diff --git a/backend/top3_props.json b/backend/top3_props.json new file mode 100644 index 0000000..3811ffc --- /dev/null +++ b/backend/top3_props.json @@ -0,0 +1,23 @@ +[ + { + "proposition_title": "Reaffirm the right of same-sex couples to marry", + "alignment": "Highly aligned", + "reason": "Supports LGBTQ+ rights, aligning with user's left-leaning stance on social issues.", + "impact": "Reinforces existing marriage rights, offering symbolic legal protection and reassurance.", + "relevance_score": 0.95 + }, + { + "proposition_title": "Borrow $10 billion to build schools, colleges", + "alignment": "Highly aligned", + "reason": "Strong support for education aligns with the proposition's focus on school improvements.", + "impact": "Jordan Lee, as a taxpayer, will likely see a tax increase but will also benefit from improved educational facilities in her county.", + "relevance_score": 0.9 + }, + { + "proposition_title": "Borrow $10 billion to respond to climate change", + "alignment": "Highly aligned", + "reason": "Strong left leanings on climate change and support for environmental spending.", + "impact": "Could benefit from climate change mitigation efforts but also face slightly higher taxes.", + "relevance_score": 0.9 + } +] \ No newline at end of file diff --git a/backend/top_propositions.json b/backend/top_propositions.json deleted file mode 100644 index f8622c3..0000000 --- a/backend/top_propositions.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "alignment": "Unknown", - "reason": "Could not determine alignment", - "impact": "Impact analysis unavailable", - "proposition_number": "Prop 2", - "proposition_title": "Borrow $10 billion to build schools, colleges" - }, - { - "alignment": "Unknown", - "reason": "Could not determine alignment", - "impact": "Impact analysis unavailable", - "proposition_number": "Prop 3", - "proposition_title": "Reaffirm the right of same-sex couples to marry" - }, - { - "alignment": "Unknown", - "reason": "Could not determine alignment", - "impact": "Impact analysis unavailable", - "proposition_number": "Prop 4", - "proposition_title": "Borrow $10 billion to respond to climate change" - } -] \ No newline at end of file