This repository currently contains a Node.js + Express + MongoDB web app that is running in Docker and serving a personal portfolio-style homepage, while also containing partially built modules for a larger learning/ecommerce platform.
The codebase is a mix of:
- Active portfolio functionality (homepage, contact form, Medium RSS feed).
- Inactive or unfinished platform features (users, courses, cart/order, permissions, wallet/payment helpers, i18n, auth scaffolding).
- Delivery mode: Hybrid
- Public portfolio landing pages.
- Full platform behind authentication.
- Payments: Keep Paystack.
- Authentication: Local auth + social auth.
- Social auth rollout: Google first.
- Access rule: signup requires verified email before platform access (local via email token; Google via Google-verified email).
Based on routes, models, views, and middleware, the intended final application appears to be:
- A personal brand site and portfolio.
- A course/mentorship platform with user accounts and enrollments.
- A payment-enabled commerce flow (cart/orders/wallet/transaction verification).
- Role-based access control (owner/admin/student/subscriber).
- Optional multilingual support.
The platform foundation is now partially wired, but major product features are still pending.
- App boots and serves on port
3000. - MongoDB connects in Docker.
- Home page is rendered from
views/pages/index.ejs. - Contact form submits to
POST /send-messageand stores aMessage. - Blog section calls
GET /api/blogsand reads Medium RSS feed. - Local auth routes are available (
/user/register,/user/login,/user/logout). - Email verification is enforced before platform access.
- Platform pages are protected (
/learn,/courses,/user/dashboard). - Google auth route is scaffolded and enabled when Google credentials are configured.
- Entry point:
app.js - Web framework: Express + EJS templating
- Database: MongoDB via Mongoose
- Containers:
app+mongovia Docker Compose - Static assets:
public/
There is now a controllers/ layer for public/auth/platform flows, while some legacy modules still need migration.
app.js: Express bootstrap, middleware, route mounting, DB connection.routes/: HTTP endpoints.models/: Mongoose schemas.middleware/: helper modules for auth, validation, email, market, wallet, etc.worker/: async email worker wrappers.views/: EJS templates (pages + partials).public/: CSS/JS/fonts/images.config/: db + passport config.locales/: translation JSON files (many currently empty).Dockerfile,docker-compose.yml,docker-compose copy.yml: container setup.
/->routes/index.js/user->routes/user.js/and/pages->routes/pages.js/admin->routes/admin.js/blog->routes/blog.js/payment->routes/payment.js
-
GET /- Renders
views/pages/index.ejs.
- Renders
-
GET /about -
GET /ask -
POST /send-message- Saves contact form payload to MongoDB
Message. - Triggers background contact email sender.
- Saves contact form payload to MongoDB
-
GET /api/blogs- Fetches latest Medium RSS entries.
-
GET /learn -
GET /courses- Authenticated + email-verified platform routes.
-
GET /user/register/POST /user/register -
GET /user/login/POST /user/login -
GET /user/verify-email/:token -
GET /user/dashboard -
GET /user/logout -
GET /user/auth/google- Returns 503 unless Google credentials are provided.
-
GET /payment/enroll/:product- Placeholder enrollment route behind auth + verification.
-
GET /admin/- Restricted to
admin/ownerroles, currently placeholder.
- Restricted to
-
GET /blog/- Redirects to homepage blog section anchor.
User: account profile, role, auth tokens, enrolled courses.Course: course metadata and instructor relation.Category: course grouping.Cart: cart-like data model (room/hotel-style fields; needs cleanup).Order: purchase record (schema differs from market middleware expectations).Permission: role-to-route permission map.Review: review model for blog/course.Blog: internal blog schema.Message: contact form submissions.Item: simple name model.
email.js,worker/workers.js: email sending wrappers.confirm.js,permissionCache.js,apiAuth.js: auth/permission helpers.validator.js: signup/signin/contact validation helpers.storage.js: multer upload helper.verifyPayment.js: Paystack verify helper.market.js: cart/order helpers.walletCreate.js,walletBalance.js: wallet helpers.language.js: user language application.gravatar.js,ipwhiteList.js,qrCode.js: extra utility middleware.
- Missing models referenced by wallet code:
models/wallet,models/balance.
- Missing email templates referenced by
middleware/email.js:views/emails/emailActivate.ejsis present.- Other templates (
emailWelcome,emailBirthday,emailPasswordReset,emailCompletedOrder) are still missing.
- Route/functionality mismatch:
- Paystack enrollment route is only a placeholder right now.
- Several frontend links still point to not-yet-built product pages.
- Data/model consistency issues:
- Mixed Mongoose connection usage (
conn.model(...)vsmongoose.model(...)). middleware/market.jsorder payload shape does not matchmodels/order.js.
- Mixed Mongoose connection usage (
- i18n quality issues:
- many locale JSON files are empty/invalid.
- namespace typo mismatch (
settiings.jsonfile vssettingsnamespace ini18n.js).
- View/template quality issues:
views/pages/courses.ejsnow has starter content, but needs full product content.- duplicated sidebar markup in
views/pages/index.ejs. - legacy contact form snippets still exist in partials.
- Docker config duplication:
docker-compose.ymlexpects env-providedMONGO_URI.docker-compose copy.ymlhardcodesMONGO_URIand is currently the reliable local file.
docker compose -f "docker-compose copy.yml" up --build -dCheck:
docker compose -f "docker-compose copy.yml" ps
docker compose -f "docker-compose copy.yml" logs -f app
docker compose -f "docker-compose copy.yml" logs -f mongoStop:
docker compose -f "docker-compose copy.yml" downAt minimum for a full build:
PORTMONGO_URISESSION_SECRETAPP_BASE_URLMAIL_USERNAMEMAIL_PASSWORDMAIL_SERVERMAIL_PORTDEFAULT_SENDERADMIN_EMAILFEEDBACK_EMAILPAYSTACK_KEY(or align with current Paystack key naming)GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETGOOGLE_CALLBACK_URL
Use TODO_APP.md as the execution plan to complete this application safely and in phases.