How nexit-ux/dealit works
DEALIT is an EJS/Express C2C marketplace. Buyers browse and search postings, while sellers register or log in, create listings with images and location, and manage their own listings. The graph follows the evidenced Express route/controller flow, authentication and validation middleware, Mongoose models, and external image/geocoding services. README-documented OpenRouter description assistance and Mapbox map display are retained as optional features; their implementation wiring was not shown in the sampled source.
Main entry points: postings.js Posting workflows · models/posting.js Posting model · app.js Express application · routes/posting.js Posting routes
Components 23
Marketplace
- Express application
app.js - Posting routes
routes/posting.js - Posting workflows
controllers/postings.js
Identity & access
- Account routes
routes/user.js - Account workflows
controllers/users.js - Access controls
middleware.js
Data & validation
- Posting model
models/posting.js - User model
models/user.js - Posting validation
schema.js - Listing categories
utils/categories.js - Session store
app.js - MongoDB
- Sample listings
init/data.js - Database initializer
init/index.js
External services
- Image storage config
cloudConfig.js - Cloudinary
- Mapbox geocoding
- Mapbox maps
- OpenRouter AI
Views & maps
- Posting pages
views/postings - Listing map
public/js/map.js - Account pages
views/users
Other components
- Marketplace user
Connections 28
- Marketplace user → Express application: uses
README.md - Express application → Posting routes: mounts
app.js - Express application → Account routes: mounts
app.js - Posting routes → Access controls: guards
routes/posting.js - Posting routes → Posting workflows: dispatches
routes/posting.js - Posting routes → Image storage config: configures uploads
routes/posting.js - Image storage config → Cloudinary: stores images
README.md - Posting workflows → Posting model: queries
controllers/postings.js - Posting workflows → Mapbox geocoding: geocodes location
controllers/postings.js - Mapbox geocoding → Posting model: provides geometry
- Posting workflows → Posting pages: renders
controllers/postings.js - Posting workflows → Listing categories: uses categories
controllers/postings.js - Posting model → Listing categories: constrains
models/posting.js - Posting model → MongoDB: persists
README.md - Posting pages → Listing map: displays location
README.md - Listing map → Mapbox maps: renders map
README.md - Marketplace user → Account routes: authenticates
README.md - Account routes → Account workflows: dispatches
routes/user.js - Account routes → Access controls: saves redirect
routes/user.js - Account workflows → User model: registers users
controllers/users.js - Account workflows → Account pages: renders
controllers/users.js - Express application → User model: configures Passport
app.js - Express application → Session store: configures sessions
app.js - Access controls → Posting model: checks ownership
middleware.js - Access controls → Posting validation: validates input
middleware.js - Posting workflows → OpenRouter AI: assists descriptions
README.md - Database initializer → Sample listings: loads
init/index.js - Database initializer → Posting model: inserts listings
init/index.js