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
- Pinboard to save favorite destinations
- 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 run dev
-
Open http://localhost:8080 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) - USE_MEMORY_STORE - set to
trueto use in-memory sessions (not recommended for production)
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
src/app.js— main Express applicationsrc/controllers/— route handler logicsrc/models/— Mongoose schemas (Listing, Review, User)src/routes/— Express routersviews/— EJS templatespublic/— static assets (CSS, client JS, images)src/middleware/— custom middleware (e.g. auth, validation)src/config/— app configuration (Cloudinary, Joi schemas)init/— optional seed data or init scripts
npm run dev— starts the server using nodemon (development)npm start— starts the server using node (production)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).
This app is ready for standard Node.js hosting (Render, Railway, Fly.io, etc.). Use these guidelines:
- Set
NODE_ENV=production. - Ensure
ATLASDB_URLpoints to your hosted MongoDB instance. - Set all required secrets (
SECRET, Cloudinary, Mapbox). - Use the default
npm startcommand (runsnode app.js). - Make sure the hosting provider supplies
PORT(the app listens onprocess.env.PORT).
If your hosting platform does not provide HTTPS by default, you must add it before using NODE_ENV=production because session cookies are marked secure.
- 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).