Skip to content

Commit f5beadc

Browse files
committed
feat: add hover effect on nav button
1 parent 4e7cc48 commit f5beadc

File tree

4 files changed

+34
-14
lines changed

4 files changed

+34
-14
lines changed

backend/app/db.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,27 @@
22
from sqlalchemy.orm import sessionmaker, declarative_base
33
import os
44

5+
# Ensure .env is loaded if present
6+
try:
7+
from dotenv import load_dotenv
8+
load_dotenv()
9+
except Exception:
10+
pass
11+
512
DATABASE_URL = os.getenv("DATABASE_URL")
13+
14+
# Provide a safe local fallback to allow dev server to boot
615
if not DATABASE_URL:
7-
raise RuntimeError("DATABASE_URL is required and must point to a PostgreSQL database, e.g. postgresql://user:password@localhost:5432/stockvision")
16+
# SQLite file inside backend directory to avoid permission issues
17+
DATABASE_URL = "sqlite:///./stockvision_dev.db"
18+
19+
# Create engine based on the scheme
20+
connect_args = {}
21+
if DATABASE_URL.startswith("sqlite"):
22+
# SQLite needs special connect args for check_same_thread in some contexts
23+
connect_args = {"check_same_thread": False}
824

9-
engine = create_engine(DATABASE_URL, pool_pre_ping=True, echo=False)
25+
engine = create_engine(DATABASE_URL, pool_pre_ping=True, echo=False, connect_args=connect_args)
1026
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
1127
Base = declarative_base()
1228

backend/stockvision_dev.db

20 KB
Binary file not shown.

frontend/app/components/Landing.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ export default function Landing() {
242242
<div className={`fixed left-2 top-32 z-30 transition-all duration-300 ${sidebarOpen ? 'opacity-0 pointer-events-none scale-95' : 'opacity-100 scale-100'}`}>
243243
<button
244244
onClick={() => setSidebarOpen(true)}
245+
onMouseEnter={() => setSidebarOpen(true)}
245246
className="w-12 h-12 rounded-lg bg-blue-100 hover:bg-blue-200 dark:bg-slate-900 dark:hover:bg-slate-800 border border-blue-200/50 dark:border-blue-600/30 shadow-lg hover:shadow-xl transition-all duration-200 flex items-center justify-center group"
246247
aria-label="Open side menu"
247248
>

frontend/app/components/sidebar.tsx

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
'use client';
22

3-
import { Button } from "@/components/ui/button";
4-
import { cn } from "@/lib/utils";
5-
import { useRouter } from "next/navigation";
63
import { useIsMobile } from "@/hooks/use-mobile";
7-
import { useEffect, useState } from "react";
4+
import { cn } from "@/lib/utils";
85
import {
9-
BarChart2,
10-
Home,
11-
LineChart,
12-
Settings,
13-
Wallet,
14-
BriefcaseBusiness,
15-
CircleDollarSign,
16-
TrendingUp
6+
BarChart2,
7+
BriefcaseBusiness,
8+
Home,
9+
LineChart,
10+
Settings,
11+
TrendingUp,
12+
Wallet
1713
} from "lucide-react";
14+
import { useRouter } from "next/navigation";
15+
import { useEffect, useState } from "react";
1816

1917
interface SidebarProps {
2018
isOpen: boolean;
@@ -67,6 +65,11 @@ export function Sidebar({ isOpen, onClose, activeSection, onSectionChange }: Sid
6765
"fixed top-1/2 left-0 -translate-y-1/2 z-20 w-16 rounded-r-xl bg-blue/10 backdrop-blur-md border-r border-white/10 shadow-lg transition-transform duration-300",
6866
isOpen ? "translate-x-0" : "-translate-x-full"
6967
)}
68+
onMouseLeave={() => {
69+
if (!isMobile) {
70+
onClose();
71+
}
72+
}}
7073
>
7174
<nav className="flex flex-col items-center justify-center py-4 space-y-4">
7275
<button

0 commit comments

Comments
 (0)