Repository navigation
Directory Structure
This page documents the current project structure. It replaces older starter-template structure proposals that did not match the actual repository.
README.md
package.json
package-lock.json
tsconfig.json
.env.example
project-overview.md
project-recommendations.mdsrc/
views/
public/
storage/Backend application code.
src/
server.ts
controllers/
routes/
models/
middleware/
utils/
types/
new_admin_account.ts
test.tsMain application entry point.
Responsibilities:
- Load environment configuration.
- Connect to MongoDB.
- Set up Express.
- Set up sessions.
- Register middleware.
- Mount routes.
- Start Socket.IO.
- Register error handlers.
- Start the HTTP server.
Request handlers and workflow logic.
Current major controllers:
admin.controller.ts
auth.controller.ts
creator.controller.ts
index.controller.ts
viewer_content_hub.controller.tsSmall route registration files that delegate behavior to controllers.
Current route groups:
admin.routes.js
auth.routes.js
creator.routes.js
index.routes.js
viewer_content_hub.routes.jsMongoose models and file storage service.
Important files:
User.ts
CreatorProfile.ts
ContentPage.ts
FileService.ts
AuditLog.js
Theme.jsAuthentication, role checks, CSRF protection, request attachment, and error pages.
Important files:
security.ts
requireAuth.ts
reqAttachments.ts
errorPages.jsShared helpers.
Important files:
asyncHandler.ts
dbUtils.ts
loggingUtils.ts
timezoneUtils.tsServer-rendered EJS templates.
views/
admin/
creator/
content_hub/
errors/
partials/
public/
about.ejs
home.ejs
login.ejsImportant sections:
-
views/admin/: admin dashboard and creator account pages. -
views/creator/: creator dashboard, content list, editor, and profile. -
views/content_hub/: public viewer content hub. -
views/partials/: shared head, topbar, sidebar, scripts, footer. -
views/errors/: 403, 404, and 500 pages.
Static browser-loaded assets.
public/
assets/
bootstrap/
css/
js/Important files:
public/js/content-editor.jspublic/js/content-hub.jspublic/js/main.jspublic/css/dashboard.csspublic/css/content-hub.csspublic/css/layout/forms.css
Runtime upload storage.
Uploaded files are served through:
/storage/<fileKey>Uploaded user files should not be committed to Git.
The current app does not have a src/services/ folder, but adding one later would be useful.
Good future service candidates:
ContentPageServiceCreatorProfileServiceAnalyticsService- Cloud-backed
FileService
Do not document these as current folders until they exist.