How ajayshivanagol/react-fastapi-postgresql works
This is a small blog web application with a React sign-in/sign-up interface and a FastAPI backend. The main user workflow is account creation or login, followed by authenticated blog listing and blog CRUD operations backed by a relational database. The README documents local PostgreSQL use. Some backend routers and model details were not sampled, so their internal behavior is represented only where the file tree and sampled wiring support it.
Main entry points: main.py FastAPI app · blog.py Blog routes · Login.py Login routes · user.py User routes
Components 18
Web interface
API and routing
- FastAPI app
backend/blog/main.py - Blog routes
backend/blog/routers/blog.py - API schemas
backend/blog/schemas.py
Identity
- Login routes
backend/blog/routers/Login.py - User routes
backend/blog/routers/user.py - OAuth validation
backend/blog/oauth2.py - Token handling
backend/blog/token.py - Password hashing
backend/blog/hashing.py
Blog data
- Blog repository
backend/blog/repository/blog.py - User repository
backend/blog/repository/user.py - Database session
backend/blog/database.py - ORM models
backend/blog/models.py
Other components
- Visitor
- PostgreSQL
Connections 26
- Visitor → React app: uses
- React app → Sign in: routes to
- React app → Sign up: routes to
- Sign in → Blog view: shows after login
- Sign in → Login routes: posts credentials
- Sign up → User routes: posts registration
- Blog view → Blog routes: requests blogs
- FastAPI app → Blog routes: registers router
- FastAPI app → Login routes: registers router
- FastAPI app → User routes: registers router
- FastAPI app → Database session: creates tables
- FastAPI app → ORM models: uses metadata
- Login routes → Token handling: issues tokens
- Login routes → User repository: looks up user
- Login routes → Password hashing: checks password
- User routes → User repository: delegates user work
- User routes → Password hashing: hashes password
- Blog routes → OAuth validation: requires authentication
- OAuth validation → Token handling: verifies token
- Blog routes → Blog repository: delegates blog work
- Blog routes → API schemas: validates responses
- Blog repository → ORM models: queries
- User repository → ORM models: queries
- Blog repository → Database session: uses session
- User repository → Database session: uses session
- Database session → PostgreSQL: reads and writes