How skakke/react_calendar works
This is a calendar web app with token-based sign-in: users open the calendar or sign in, after which protected routes become available. The calendar currently renders a hard-coded meeting; no calendar-event API or persistence is shown. Authentication uses a React client and FastAPI endpoints backed by SQL Server. The sampled backend entry point contains register, login, and current-user endpoints; the separate auth router’s wiring is unclear, so it is omitted.
Main entry points: main.py FastAPI endpoints · App.tsx Routes and shell · AuthContext.tsx Auth state · auth.ts Auth API client
Components 16
Web client
- Client bootstrap
frontend/src/main.tsx - Routes and shell
frontend/src/App.tsx - Navigation bar
frontend/src/components/NavBar.tsx - Calendar view
frontend/src/pages/FullCalendarPage.tsx
Authentication
- Login form
frontend/src/pages/Login.tsx - Auth state
frontend/src/auth/AuthContext.tsx - Route guard
frontend/src/auth/RequireAuth.tsx - Auth API client
frontend/src/api/auth.ts
Backend API
- FastAPI endpoints
backend/app/main.py - Auth dependencies
backend/app/deps.py - Token and passwords
backend/app/security.py - Request responses
backend/app/schemas.py
Persistence
- User model
backend/app/models.py - DB sessions
backend/app/database.py
Other components
- User
- SQL Server
Connections 19
- User → Client bootstrap: opens app
- Client bootstrap → Routes and shell: renders
- Routes and shell → Navigation bar: renders
- Routes and shell → Login form: routes to
- Routes and shell → Route guard: protects routes
- Routes and shell → Calendar view: routes to
- Navigation bar → Auth state: reads auth state
- Navigation bar → Auth API client: clears token
- Route guard → Auth state: reads auth state
- Login form → Auth API client: submits credentials
- Login form → Auth state: sets user
- Auth state → Auth API client: fetches identity
- Auth API client → FastAPI endpoints: HTTP auth requests
- FastAPI endpoints → DB sessions: uses sessions
- FastAPI endpoints → User model: queries users
- FastAPI endpoints → Token and passwords: hashes and tokens
- FastAPI endpoints → Request responses: validates responses
- FastAPI endpoints → Auth dependencies: requires current user
- DB sessions → SQL Server: connects