WanderList is a small Express + MongoDB web application for sharing travel listings and reviews. It includes user authentication, image uploads via Cloudinary, location maps using Mapbox, and a minimal responsive UI rendered with EJS.
This README documents how to set up, run and develop the project locally.
- Create, read, update and delete travel listings
- Add reviews to listings (authenticated users)
- User authentication and sessions (Passport.js)
- Image uploads (Cloudinary)
- Location display using Mapbox
- Server-side validation with Joi
- Node.js (recommended LTS) — package.json specifies an
engines.nodevalue but any modern Node 18+ should work - MongoDB (Atlas cloud URI or local MongoDB)
- A Cloudinary account (for image uploads)
- A Mapbox account (for map and geocoding tokens)
-
Install dependencies
npm install
-
Create a
.envfile in the project root (see Environment variables below) -
Start the app in development mode
npm start
-
Open http://localhost:3000 in your browser (default port configured in
app.js)
Create a .env file at the project root and add the following keys (example names used in the codebase):
- ATLASDB_URL - MongoDB connection string (e.g. from MongoDB Atlas)
- SECRET - Session secret used by express-session
- CLOUD_NAME - Cloudinary cloud name
- CLOUD_API_KEY - Cloudinary API key
- CLOUD_API_SECRET - Cloudinary API secret
- MAP_TOKEN - Mapbox public token
- NODE_ENV - set to
productionin production deployments (optional)
Example .env (do not commit to source control):
ATLASDB_URL=mongodb+srv://<user>:<password>@cluster0.example.mongodb.net/wanderlist?retryWrites=true&w=majority
SECRET=your_session_secret_here
CLOUD_NAME=your_cloud_name
CLOUD_API_KEY=your_cloudinary_key
CLOUD_API_SECRET=your_cloudinary_secret
MAP_TOKEN=your_mapbox_token
NODE_ENV=development
app.js— main Express applicationcontrollers/— route handler logicmodels/— Mongoose schemas (Listing, Review, User)routes/— Express routersviews/— EJS templatespublic/— static assets (CSS, client JS, images)middleware.js— custom middleware (e.g. auth, validation)cloudConfig.js— Cloudinary configurationschema.js— Joi validation schemasinit/— optional seed data or init scripts
npm start— starts the server usingnpx nodemon app.js(development)npm test— placeholder test script (no tests configured)
You can also run the app directly with node app.js but nodemon is convenient in development.
- The app uses
connect-mongoto store sessions in MongoDB whenATLASDB_URLis provided. - Image uploading uses
multer+ Cloudinary;cloudConfig.jsreads Cloudinary credentials from environment variables. - Map and geocoding features rely on Mapbox tokens (
MAP_TOKEN).
- MongoDB connection errors: verify
ATLASDB_URLand network access to Atlas (IP allowlist). - Cloudinary upload errors: verify
CLOUD_NAME,CLOUD_API_KEY, andCLOUD_API_SECRET. - Map features not showing: ensure
MAP_TOKENis set and is a valid Mapbox token.
If you'd like to contribute:
- Fork the repository
- Create a feature branch
- Open a pull request with a clear description of changes
This project is published under the ISC license (see package.json).