Skip to content

About

Space-themed event platform built with Node.js, Express, EJS, and MongoDB Atlas. Features secure session authentication, host-owned event CRUD, RSVP workflows, Cloudinary image uploads, and a responsive, accessible UI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🌌 Celestial Gatherings

Celestial Gatherings is a space-themed event management platform that makes it easy to create, share, and join events under the stars. Built with Node.js, Express.js, MongoDB Atlas, and EJS, it follows the MVC pattern and provides a smooth, secure experience for both event hosts and guests.

The app combines robust backend functionality with a clean, responsive UI/UX, giving users everything they need to plan astronomy meetups, science talks, watch parties, or any gathering that feels out of this world.


Want to explore the full workflow? Create a temporary account on the live demo, then try hosting, editing, deleting, and RSVPing to events.

🔗 Live Demo: celestialgatherings.com

📌 The live demo restores its seeded events and clears user-created events and RSVPs daily.


✨ Core Functionality

  • Event Management
    Create, edit, and manage events with full CRUD capabilities. Each event includes title, category, location, description, UTC start/end times, and an optional image. Demo accounts can host up to 10 events at once.

  • RSVP System
    Registered users can RSVP YES / NO / MAYBE. Hosts are prevented from RSVPing to their own events to keep data clean and meaningful.

  • Authentication & Profiles
    Secure sign-up and login with session-based auth. Logged-in users can view their profile, hosted events, and RSVPs.

  • Image Hosting
    Upload event images via Cloudinary using Multer's in-memory upload handling. Files are restricted by type and size, replaced/deleted assets are cleaned up automatically, and a placeholder can be used when no image is selected.

  • Reliable Data Updates
    MongoDB transactions keep event ownership, RSVP references, and related records synchronized during multi-document operations.

  • Daily Demo Reset
    With RESET_MODE=full, a protected Vercel cron job scheduled daily at 06:00 UTC restores the canonical seeded events, removes demo-created events and RSVPs, repairs user references, and cleans up associated Cloudinary images. Registered user accounts are preserved.

  • User Feedback
    Flash messages and custom error pages provide clear guidance for success, warning, and error states.

  • Responsive UI/UX
    Space-inspired theme with accessible forms, visible focus states, and navigation that adapts to login state.


🛠️ Tech Stack

  • Frontend: EJS templates, Bootstrap 4/5 on selected pages, custom CSS and client-side JavaScript
  • Backend: Node.js, Express.js
  • Database: MongoDB Atlas with Mongoose
  • Authentication: express-session + connect-mongo session storage
  • File Uploads: Multer memory storage + Cloudinary upload streams
  • Validation & Security: express-validator, validator, Helmet, express-rate-limit, bcryptjs, same-origin mutation checks
  • Performance & Logging: compression, morgan
  • Utilities: Luxon (date/time), he (HTML entity decoding)

🔐 Authentication & Authorization

  • Guests can:

    • Browse events
  • Registered Users can:

    • Sign up / log in securely
    • RSVP to events
    • Host new events
    • Edit or delete events they created
    • View RSVPs on their profile and update their RSVP status from an event page
  • Authorization middleware ensures only event hosts can modify their own events.


🧑‍🎨 UI/UX

  • Space-inspired theme with deep blues, purples, and cosmic accents
  • Accessible forms with visible focus states, proper input validation, and keyboard-friendly navigation
  • Dynamic header navigation: changes based on login state (Sign Up/Login vs. Profile/New Event/Logout)
  • Custom error views: informative 400, 403, 404, 429, and 500 pages
  • Responsive layouts: looks great on desktop, tablet, and mobile

🧩 Design System

  • Shared style variables in one place (colors, spacing, corners, shadows, type)
  • Consistent hover/active/focus states across main nav and account links
  • Responsive type scales, consistent spacing, and a sticky-footer layout

♿ Accessibility

  • Keyboard-friendly navigation with visible focus styles and skip links on every page
  • Semantic landmarks, time elements, descriptive labels, and meaningful heading structure
  • Form errors use alert/status semantics, labels are associated with inputs, and dynamic RSVP counts are announced
  • Large, readable text and strong color contrast designed with WCAG AA considerations
  • Respects "Reduce Motion" preference

🧪 Validation & Error Handling

  • Uses express-validator to validate/sanitize form input
  • Passwords are hashed securely with bcryptjs before storage
  • Login and signup requests are rate limited, and successful login regenerates the session identifier
  • Each account can host up to 10 events at once; creation is limited to 10 requests per hour and editing to 30 requests per hour
  • State-changing requests require a matching Origin or Referer to reduce cross-site request forgery risk
  • Uploaded images are limited to supported image types and a maximum size of 2 MB
  • Friendly error pages for:
    • Invalid IDs
    • Forbidden access
    • Missing resources
    • Server/database errors

📚 Key Libraries

  • Backend: express, mongoose, express-session, connect-mongo
  • Auth/Security: bcryptjs, express-rate-limit, helmet, validator
  • File Uploads: multer, cloudinary
  • Validation/Formatting: express-validator, luxon, he
  • UX/Feedback: connect-flash
  • Performance/Logging: compression, morgan

🧱 Project Structure (MVC)

This codebase follows the Model-View-Controller (MVC) pattern. This keeps the app maintainable, testable, and easy to extend.

  • Models (Mongoose): data schema + validation.
  • Views (EJS): server-rendered HTML templates.
  • Controllers (Express): request in → response out.
  • Routes: HTTP method + path → controller.
  • Middleware: pre-route security, authentication, ownership, and eligibility checks.
├─ app.js                         #Express app config, sessions, database readiness, routes, and views
├─ server-local.js                #local entry point; starts Express after MongoDB connects
├─ middlewares.js                 #same-origin, authentication, ownership, and RSVP guards
├─ api/
│  └─ cron/reset.js               #protected Vercel daily demo reset
├─ controllers/                   #controllers (request handlers)
│  ├─ mainController.js           #home/about/contact
│  ├─ userController.js           #auth, profile
│  └─ eventController.js          #event CRUD, RSVP
├─ models/                        #models (Mongoose schemas)
│  ├─ user.js
│  ├─ eventModel.js
│  └─ rsvp.js
├─ routes/                        #express routers
│  ├─ mainRoutes.js
│  ├─ userRoutes.js
│  └─ eventRoutes.js
├─ views/                         #views (EJS templates)
│  ├─ about.ejs
│  ├─ contact.ejs
│  ├─ edit.ejs
│  ├─ error.ejs
│  ├─ event.ejs
│  ├─ events.ejs
│  ├─ index.ejs
│  ├─ login.ejs
│  ├─ newEvent.ejs
│  ├─ profile.ejs
│  ├─ signup.ejs
│  └─ partials/                   #shared UI
│     ├─ header.ejs
│     └─ footer.ejs
├─ public/                        #static assets served by Express
│  ├─ css/
│  ├─ images/
│  ├─ javascript/                 #event-management browser scripts
│  └─ js/                         #authentication browser scripts
├─ seed/
│  └─ defaultEvents.json          #canonical events restored by seed/reset tooling
├─ services/
│  └─ seedEvents.js               #shared seeded-event synchronization service
├─ scripts/                       #syntax checking, seeding, and seed export utilities
├─ vercel.json                    #serverless routes and the daily cron schedule
├─ package.json
└─ package-lock.json

🚀 Getting Started (Local Dev)

  1. Clone repository
git clone https://github.com/jillmpla/node_js_space_events_app.git
cd node_js_space_events_app
  1. Install dependencies

Node.js 24.x and npm 11 or newer are required.

npm ci
  1. Create a .env file with your keys
MONGODB_URI=...
SECRET_KEY=...
CLOUDINARY_CLOUD_NAME=...
CLOUDINARY_API_KEY=...
CLOUDINARY_API_SECRET=...

# Required when running the protected demo reset
CRON_SECRET=...
HOST_USER_ID=...
RESET_MODE=full
  1. Run the app
npm start

While developing, use npm run dev instead.

  1. Visit: http://localhost:3000

📜 License

This project is licensed under the MIT License. See the License file for details.

If you find this project useful, consider giving it a star! ⭐

About

Space-themed event platform built with Node.js, Express, EJS, and MongoDB Atlas. Features secure session authentication, host-owned event CRUD, RSVP workflows, Cloudinary image uploads, and a responsive, accessible UI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages