This repository contains the CCAPDEV MCO project. The runnable Express application lives in CCAPDEV-MCO-RubberDuckGroup, a duck-themed community forum built with Express, Handlebars, MongoDB, and session-based authentication.
.
|-- CCAPDEV-MCO-RubberDuckGroup/ # Main application
`-- README.md
- User registration, login, logout, and session persistence
- Profile editing with profile photo uploads
- Post creation, editing, deletion, voting, and image uploads
- Nested comments with edit and delete support
- Search and filtering for posts by keyword, author, date range, and sort order
- Activity feed per user
- Server-rendered pages using Handlebars partials and layouts
- Node.js + npm
- Express 5
- MongoDB + Mongoose
- Handlebars (
hbs) express-sessionwith a Mongo-backed session storeexpress-fileuploadfor image uploads
Before running the project, install:
- Node.js
- npm
- MongoDB, or access to a MongoDB Atlas cluster
- Open a terminal in the repository root.
- Move into the application folder:
cd CCAPDEV-MCO-RubberDuckGroup- Install dependencies:
npm install- Create a local environment file from the example:
Copy-Item .env.example .env- Update
.envwith your own values:
MONGODB_URI=your-mongodb-connection-string
SESSION_SECRET=your-session-secretRun these inside CCAPDEV-MCO-RubberDuckGroup:
npm startstarts the production server withnode server.jsnpm run devstarts the app withnodemonnpm run seedpopulates the database with sample users, posts, comments, and activity data
The seed script only runs when the database is empty. If users, posts, comments, or activity records already exist, seeding is skipped.
Sample seeded accounts use password password123. You can log in with either username or email, for example:
JohnDuckjohnduck@email.com
- Make sure your MongoDB instance is accessible through the
MONGODB_URIin.env. - Optionally seed the database:
npm run seed- Start the server:
npm start- Open the app in your browser:
http://localhost:3000
/home feed/loginlogin page/registerregistration page/profileprofile page/create-postpost creation page/search-resultsfiltered search results/aboutdependency and third-party library credits
/authauthentication endpoints/usersuser profile endpoints/postspost, vote, and upload endpoints/api/commentscomment endpoints/activityuser activity feed endpoints
Inside CCAPDEV-MCO-RubberDuckGroup:
controllers/ request handlers
models/ Mongoose schemas
public/ static assets, uploaded images, CSS, and client JS
routes/ Express route definitions
utils/ shared helpers such as uploads and session storage
views/ Handlebars pages, partials, and layouts
server.js application entrypoint
seed.js database seed script