Authentication
Relevant source files
The following files were used as context for generating this wiki page:The Greenline application currently features a placeholder or UI-only implementation for user authentication. The codebase includes distinct user interface components and pages for unauthenticated (public-facing) and authenticated (portal) user states. However, it does not contain the underlying logic for user registration, session management, or credential verification.
The system is structured around two primary navigation bars: NavbarHome for visitors and Navbar for logged-in users. Navigation between these states is handled by direct links to the /portal page, rather than a programmatic authentication flow. Analysis of the project's dependencies confirms the absence of standard authentication libraries like next-auth or clerk.
Sources: client/package.json, client/src/components/NavbarHome/index.tsx, client/src/components/Navbar/index.tsx
UI Components for Authentication
The visual representation of authentication is handled by a few key React components.
| Component | File Path | Description |
|---|---|---|
NavbarHome | client/src/components/NavbarHome/index.tsx | The navigation bar for unauthenticated users, displayed on the main landing page. It contains non-functional "Log In" and "Sign Up" buttons. |
HeroSection | client/src/components/Hero/index.tsx | The main content of the landing page. It includes "Access Portal" and "Sign up" buttons that link directly to the /portal page. |
Navbar | client/src/components/Navbar/index.tsx | The navigation bar for authenticated users, displayed on the /portal and /quote/[ticker] pages. It features an "Account" link and a user Avatar. |
Avatar | client/src/components/ui/avatar.tsx | A UI component used in the authenticated Navbar to display a user's profile picture. It is currently hardcoded. |
Sources: client/src/components/NavbarHome/index.tsx, client/src/components/Hero/index.tsx, client/src/components/Navbar/index.tsx
Unauthenticated User Flow
The experience for a new or logged-out user begins at the root page (/), which renders the HeroSection and NavbarHome components.
Sources: client/src/app/page.tsx:15-18
Homepage Navigation (NavbarHome)
The NavbarHome component provides the primary navigation for the public-facing site. It includes "Log In" and "Sign Up" buttons. These are currently <span> elements within <div> containers and lack onClick handlers or href attributes, rendering them non-functional.
// client/src/components/NavbarHome/index.tsx:31-38
<div className="flex items-center space-x-4">
<div className='md:flex hidden items-center justify-center rounded-full outline-white cursor-pointer hover:outline-white/40 hover:text-white/60 text-white outline outline-[1px] p-3 w-28'>
<span>Log In</span>
</div>
<div className='flex items-center justify-center rounded-full cursor-pointer bg-neutral-300 hover:bg-neutral-400 outline outline-[1px] p-3 w-28'>
<span>Sign Up</span>
</div>
</div>
Call-to-Action Buttons
The HeroSection component contains two main calls to action that navigate the user to the authenticated area of the application. Both buttons are Next.js <Link> components that route the user directly to /portal.
- Access Portal: A primary button that encourages users to enter the main application.
- Sign up: A secondary button in the footer area, also linking to
/portal.
This diagram shows the navigation flow from the homepage to the portal.
Authenticated User View
The authenticated state is simulated by the user's presence on the /portal or /quote/[ticker] pages. These pages render the Navbar component, which is visually distinct from NavbarHome.
Sources: client/src/app/portal/page.tsx:117, client/src/app/quote/[ticker]/page.tsx:125
Portal Navigation (Navbar)
The Navbar component signifies an authenticated session. It replaces the "Log In" and "Sign Up" buttons with an "Account" link and a user avatar.
Key features include:
- A search bar for stock tickers.
- A link to the user's "Watchlist".
- An "Account" text link.
- An
Avatarcomponent to display the user's profile image.
The user avatar image is currently hardcoded to a static URL, reinforcing the placeholder nature of the authentication system.
// client/src/components/Navbar/index.tsx:146-153
<div className="hidden md:flex items-center space-x-4">
{/* ... */}
<div>
<span>Account</span>
</div>
</div>
<Avatar>
<AvatarImage src="https://github.com/shadcn.png%22 alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
The following sequence diagram illustrates how a user transitions from the unauthenticated homepage to the authenticated portal view.
Summary
The authentication system in Greenline is currently a front-end mock-up. It successfully establishes the UI and navigational structure for both unauthenticated and authenticated user experiences. However, it lacks the backend integration, state management, and security features of a functional authentication system. The "login" process is a simple navigation to a different part of the site, and the "authenticated" user identity is represented by static, hardcoded UI elements.