How danieldimitrov5/photo-album works
Photo Album is an Express web application for browsing and sharing photos, with user accounts, comments, administrative management, contact messages, and upload notifications. The main workflow is a visitor or logged-in user submitting a photo through the photo route; the controller delegates creation to the photo service and emits a Socket.IO event, while visitors browse photo pages and comments. User and comment operations are represented from documented capabilities and the available route/controller structure; their detailed service wiring was not sampled, so uncertain internal links are omitted.
Main entry points: application.ts HTTP and socket app · photoController.ts Photo controller · indexController.ts Home controller · userController.ts User controller
Components 23
Web application
- HTTP and socket app
src/application.ts - Home routes
src/routes/indexRoutes.ts - Home controller
src/controllers/indexController.ts - Photo routes
src/routes/photoRoutes.ts - Photo controller
src/controllers/photoController.ts - User routes
src/routes/userRoutes.ts - User controller
src/controllers/userController.ts - Comment routes
src/routes/commentRoutes.ts - Comment controller
src/controllers/commentController.ts - Session and access
src/middlewares/auth - Page templates
src/views
Photo and user services
- Photo service
src/services/photoService.ts - User service
src/services/userService.ts - User mail service
src/services/userMailService.ts - Comment service
src/services/commentService.ts
Persistence
- Photo model
src/database/models/photo.ts - User model
src/database/models/user.ts - Comment model
src/database/models/comment.ts - Message model
src/database/models/message.ts - MySQL database
src/database/sequelizeClient.ts
External integrations
- Email service
Other components
- Visitor / user
- Connected clients
Connections 33
- Visitor / user → HTTP and socket app: sends requests
- HTTP and socket app → Home routes: mounts home
- HTTP and socket app → User routes: mounts users
- HTTP and socket app → Photo routes: mounts photos
- HTTP and socket app → Comment routes: mounts comments
- HTTP and socket app → Session and access: applies sessions
- Home routes → Home controller: dispatches home
- Home controller → Photo service: loads latest photos
- Home controller → User service: loads latest users
- Photo routes → Session and access: guards actions
- Photo routes → Photo controller: dispatches photo actions
- Photo controller → Photo service: manages photos
- Photo controller → Comment service: loads comments
- Photo controller → HTTP and socket app: emits upload event
- User routes → Session and access: guards account actions
- User routes → User controller: dispatches user actions
- User controller → User mail service: handles user messages
- User controller → Comment service: deletes comments
- Comment routes → Comment controller: dispatches comment actions
- Photo service → Photo model: reads and writes
- User service → User model: reads and writes
- User mail service → User model: manages accounts
- Comment service → Comment model: reads and writes
- User mail service → Message model: stores messages
- Photo model → MySQL database: persists through
- User model → MySQL database: persists through
- Comment model → MySQL database: persists through
- Message model → MySQL database: persists through
- HTTP and socket app → Connected clients: broadcasts events
- User mail service → Email service: sends email
- Photo controller → Page templates: renders photo pages
- Home controller → Page templates: renders home pages
- User controller → Page templates: renders user pages