How alejandrob12/art-museum-platform works
1. Overall shape
- This repository is a small Node.js + Express web application for a museum catalog system.
- Its runtime architecture is layered: HTTP server → route handlers → data/model layer → database, with a separate static presentation layer made of HTML and CSS files.
2. Application entry point
- The main server process lives in server/server.js.
- That file is the bootstrap boundary for the app: it starts Express, wires middleware, mounts the route modules, and serves the user-facing pages and static assets.
3. Route boundaries
- The routing layer is split into three main domains:
- routes/Catalogo.js: public browsing of artworks, authors, and catalog content.
- routes/Login.js: authentication and recovery flows for regular users.
- routes/Admin.js: administrator login and management actions.
- This separation is important for the diagram because it reflects role-based access and distinct UI flows.
4. Presentation layer
- The app does not appear to use a frontend SPA framework; instead it relies on server-served HTML pages under views/.
- Views are grouped by audience:
- views/public/ for catalog pages like inicio, Obras, Autor, Artistas.
- views/user/ for user login, registration, payment, verification, and account-status pages.
- views/admin/ for admin login, registration, success/error messages, and the admin panel.
- views/recovery/ for password reset and email confirmation screens.
- Styling and visual assets are centralized in assets/, especially assets/styles/ and image/icon folders.
5. Domain model
- The data model layer is represented by the files in models/:
- Obra for artworks.
- Autor for artists/authors.
- Genero, Nacionalidad, and Especializacion as supporting classification entities.
- From the file names and README, Obra is the central entity, with relationships to author and categorization data such as genre and author metadata.
6. Persistence architecture
- The repository contains evidence of two persistence-related tracks:
- config/database.js and sql/scripts.sql, which suggest a MySQL/relational setup.
- config/mongodb.js, scripts/seed-mongodb.js, data/museo_seed.json, and the models/ directory, which suggest a MongoDB/Mongoose-style setup.
- For an architecture diagram, this means the repo should be shown as having a database configuration boundary with relational scripts and a separate MongoDB seed/config path. The codebase likely reflects either a migration, dual support, or artifacts from different phases of the project.
7. Data initialization and seed flow
- data/museo_seed.json provides seed content.
- scripts/seed-mongodb.js loads that seed data into the database.
- This is a one-way initialization path: seed file → seed script → database.
8. User flows
- There are three major user journeys:
- Public browsing: landing page and catalog exploration through Catalogo.
- Authenticated user flow: login, registration, account verification, and payment-related pages in views/user/.
- Password recovery flow: recovery request, code confirmation, password update, and success messaging in views/recovery/.
- These flows are mostly page-driven and likely exchange form submissions with the login/recovery routes.
9. Admin flow
- The admin subsystem is isolated from the regular user experience.
- Pages under views/admin/ cover admin authentication, success/error states, and an admin dashboard/panel.
- This suggests a distinct authorization boundary: admin actions are not just another catalog view, but a separate management path through routes/Admin.js.
10. Supporting artifacts
- entregables/sprint-1/consultas/ contains standalone query scripts for filtering by availability, genre, and price. These look like learning/delivery artifacts rather than runtime code.
- docs/ and the images under assets/images/ are documentation and media assets, not application logic.
11. What to show in an architecture diagram
- The most accurate diagram would include:
- Browser/client
- Express server
- Three route modules: Catalogo, Login, Admin
- HTML/CSS static view layer
- Domain models for Obra/Autor and supporting classification entities
- Database boundary with both the MySQL script/config side and the MongoDB seed/config side
- Seed/import scripts as an operational path into the database
- The key architectural idea is a server-rendered museum catalog application with role-specific routes and a structured data model for artworks and authors.
Main entry points: server.js Express app · Catalogo.js Catalogo · Autor.js Autor · database.js DB config
Components 18
Runtime
HTTP server and request handling
- Browser · User-facing entry into the app
- Express app · Bootstraps middleware, routes, and static serving
server/server.js - Catalogo · Public catalog and browsing routes
routes/Catalogo.js - Login · User authentication and recovery routes
routes/Login.js - Admin · Administrator authentication and management routes
routes/Admin.js
Presentation
Server-rendered pages and assets
- Public pages · Catalog browsing pages
views/public - User pages · Login, registration, account, and payment pages
views/user - Admin pages · Admin login, status, and dashboard pages
views/admin - Recovery pages · Password reset and email confirmation screens
views/recovery - Assets · Styles, images, and icons served by the app
assets
Domain
Core data models
Persistence
Database configuration, scripts, and seed flow
- DB config · Relational database connection boundary
config/database.js - SQL scripts · Relational schema and setup scripts
sql/scripts.sql - Mongo config · MongoDB connection boundary
config/mongodb.js - Seed script · Loads seed data into MongoDB
scripts/seed-mongodb.js - Seed data · Museum seed content
data/museo_seed.json
Connections 24
- Browser → Express app: HTTP requests · Client traffic enters the Express app
- Express app → Catalogo: mounts · Wires public catalog routes
- Express app → Login: mounts · Wires user auth routes
- Express app → Admin: mounts · Wires admin routes
- Express app → Public pages: serves · Renders public HTML pages
- Express app → User pages: serves · Renders user-facing pages
- Express app → Admin pages: serves · Renders admin pages
- Express app → Recovery pages: serves · Renders recovery pages
- Express app → Assets: serves · Serves static styles and media
- Catalogo → Obra: reads · Queries artworks for catalog pages
- Catalogo → Autor: reads · Resolves author data for browsing views
- Catalogo → Catalog data: reads · Uses supporting catalog classifications
- Login → Autor: auth flow · Uses user-related data during login and recovery
- Login → Recovery pages: renders · Drives recovery screens and forms
- Admin → Admin pages: renders · Drives admin authentication and panel pages
- Obra → DB config: persists via · Artwork data stored through relational boundary
- Autor → DB config: persists via · Author data stored through relational boundary
- Catalog data → DB config: persists via · Classification data stored through relational boundary
- SQL scripts → DB config: provisions · Initializes relational schema
- Seed data → Seed script: input · Seed JSON consumed by import script
- Seed script → Mongo config: loads into · Imports data through MongoDB connection
- Seed script → Seed data: reads · Consumes seed content
- Obra → Mongo config: persists via · Mongo-side model persistence path
- Autor → Mongo config: persists via · Mongo-side model persistence path