How younsseamazzal/social-network works
This is a small social-network application with a Next.js frontend and Go HTTP backend. The demonstrated workflow is account registration or login, followed by a session-protected feed where users can read and create posts. The backend initializes SQLite and validates session cookies on protected routes. Chat, groups, and profile pages are present in the tree, but their sampled files provide no evidence of implemented behavior or backend connections; their relationships are therefore not inferred.
Main entry points: server.go HTTP router · sqlite.go SQLite initialization · register.go Registration handler · page.js Login and registration
Components 20
Web application
- Login and registration
frontend/app/login/page.js - Registration form
frontend/app/register/page.js - Page session guard
frontend/middleware.js - Post feed
frontend/app/page.js - Chat page
frontend/app/chat/page.js - Groups page
frontend/app/groups/page.js - Profile page
frontend/app/profile/page.js
HTTP backend
- HTTP router
backend/server.go - Login handler
backend/pkg/handlers/login.go - Registration handler
backend/pkg/handlers/register.go - Posts handler
backend/pkg/handlers/posts.go - Users handler
backend/pkg/handlers/users.go - API session guard
backend/pkg/middleware/session.go - Error responses
backend/pkg/response/error.go
Persistence and sessions
- SQLite initialization
backend/pkg/db/sqlite/sqlite.go - Login queries
backend/pkg/db/queries/login.go - User queries
backend/pkg/db/queries/register.go - Session queries
backend/pkg/db/queries/session.go - Social database
backend/social_network.db
Other components
- Visitor
Connections 17
- Visitor → Login and registration: uses
frontend/app/login/page.js - Visitor → Registration form: registers
frontend/app/register/page.js - Login and registration → HTTP router: posts login
frontend/app/login/page.js - Registration form → HTTP router: posts registration
frontend/app/register/page.js - Visitor → Post feed: views feed
frontend/app/page.js - Post feed → HTTP router: fetches and creates posts
frontend/app/page.js - HTTP router → SQLite initialization: initializes
backend/server.go - HTTP router → Login handler: routes login
backend/server.go - HTTP router → Registration handler: routes registration
backend/server.go - HTTP router → API session guard: protects routes
backend/server.go - HTTP router → Posts handler: routes protected posts
backend/server.go - HTTP router → Users handler: routes protected users
backend/server.go - API session guard → Session queries: validates session
backend/pkg/middleware/session.go - Registration handler → User queries: creates user
backend/pkg/handlers/register.go - Registration handler → SQLite initialization: checks email
backend/pkg/handlers/register.go - Session queries → SQLite initialization: reads and writes session
backend/pkg/db/queries/session.go - SQLite initialization → Social database: opens database
backend/pkg/db/sqlite/sqlite.go