How achintxv/code-diary works
Code Diary is a project and issue-tracking dashboard. Users authenticate, create or select projects, then manage issues and view status metrics through the dashboard; protected API routes validate sessions and project ownership before accessing MongoDB. The graph preserves the documented auth, project, issue, and status-normalization stages. Some route and UI wiring is represented only by the README or source index, so edges without direct excerpt evidence are limited to documented relationships.
Main entry points: auth.js Session and tokens · db.js Database connection · ProjectView.jsx Project view · route.js Issue endpoints
Components 24
Dashboard UI
- Login page
src/app/login/page.jsx - Registration page
src/app/register/page.jsx - Dashboard entry
src/app/dashboard/page.jsx - Project workspace
src/components/dashboard/DashboardShell.jsx - Project view
src/components/dashboard/ProjectView.jsx - Issue editor
src/components/IssueModal.jsx - Issue list
src/components/IssueList.jsx - Status badge
src/components/StatusBadge.jsx - Status normalization
src/utils/status.js
API Routes
- Login endpoint
src/app/api/auth/login/route.js - Registration endpoint
src/app/api/auth/register/route.js - Session endpoint
src/app/api/auth/me/route.js - Logout endpoint
src/app/api/auth/logout/route.js - Project endpoints
src/app/api/project/route.js - Project detail endpoints
src/app/api/project/[id]/route.js - Issue endpoints
src/app/api/issue/route.js - Issue detail endpoints
src/app/api/issue/[id]/route.js
Identity
- Session and tokens
src/lib/auth.js
Persistence
- Database connection
src/lib/db.js - User records
src/models/user.js - Project records
src/models/project.js - Issue records
src/models/issue.js
Other components
- User
- MongoDB
Connections 39
- User → Login page: signs in
README.md - User → Registration page: registers
README.md - User → Dashboard entry: manages work
README.md - Login page → Login endpoint: submits credentials
- Registration page → Registration endpoint: creates account
- Dashboard entry → Project workspace: renders
src/app/dashboard/page.jsx - Project workspace → Project view: renders selection
src/components/dashboard/DashboardShell.jsx - Project view → Issue editor: renders editor
src/components/dashboard/ProjectView.jsx - Project view → Issue list: renders issues
src/components/dashboard/ProjectView.jsx - Issue list → Status badge: renders status
src/components/IssueList.jsx - Status badge → Status normalization: normalizes status
src/components/StatusBadge.jsx - Project workspace → Project endpoints: requests projects
- Project view → Issue endpoints: requests issues
- Project view → Issue detail endpoints: updates issues
- Login endpoint → Session and tokens: creates token
src/app/api/auth/login/route.js - Login endpoint → Database connection: connects
src/app/api/auth/login/route.js - Login endpoint → User records: looks up user
src/app/api/auth/login/route.js - Registration endpoint → Database connection: connects
src/app/api/auth/register/route.js - Registration endpoint → User records: creates user
src/app/api/auth/register/route.js - Session endpoint → Session and tokens: checks session
src/app/api/auth/me/route.js - Dashboard entry → Session and tokens: checks session
src/app/dashboard/page.jsx - Session and tokens → Database connection: connects
src/lib/auth.js - Session and tokens → User records: loads user
src/lib/auth.js - Project endpoints → Session and tokens: validates session
src/app/api/project/route.js - Project endpoints → Database connection: connects
src/app/api/project/route.js - Project endpoints → Project records: reads and writes
src/app/api/project/route.js - Project detail endpoints → Session and tokens: validates session
src/app/api/project/[id]/route.js - Project detail endpoints → Database connection: connects
src/app/api/project/[id]/route.js - Project detail endpoints → Project records: reads and writes
src/app/api/project/[id]/route.js - Project detail endpoints → Issue records: deletes project issues
src/app/api/project/[id]/route.js - Issue endpoints → Session and tokens: validates session
src/app/api/issue/route.js - Issue endpoints → Database connection: connects
src/app/api/issue/route.js - Issue endpoints → Project records: checks ownership
src/app/api/issue/route.js - Issue endpoints → Issue records: reads and creates
src/app/api/issue/route.js - Issue detail endpoints → Session and tokens: validates session
src/app/api/issue/[id]/route.js - Issue detail endpoints → Database connection: connects
src/app/api/issue/[id]/route.js - Issue detail endpoints → Project records: checks ownership
src/app/api/issue/[id]/route.js - Issue detail endpoints → Issue records: reads and mutates
src/app/api/issue/[id]/route.js - Database connection → MongoDB: connects
src/lib/db.js