An open API service indexing awesome lists of open source software.

https://github.com/jillmpla/node_js_space_events_app

Space-themed event management app built with Node.js, Express, EJS, and MongoDB Atlas. MVC architecture with session-based authentication and role-based authorization, RSVP workflow, and Cloudinary uploads.
https://github.com/jillmpla/node_js_space_events_app

bcrypt ejs events events-management events-manager express helmet javascript mongodb mongodb-atlas mongoose multer mvc mvc-pattern node-js nodejs webapp webapplication

Last synced: 2 months ago
JSON representation

Space-themed event management app built with Node.js, Express, EJS, and MongoDB Atlas. MVC architecture with session-based authentication and role-based authorization, RSVP workflow, and Cloudinary uploads.

Awesome Lists containing this project

README

          

# ๐ŸŒŒ 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*.

๐Ÿ”— **Live Demo:** [celestialgatherings.com](https://www.celestialgatherings.com)
>๐Ÿ“Œ *Note: Demo resets daily.*

Want to explore without signing up?
Use the following demo credentials:

- **Email:** `johndoe2@gmail.com`
- **Password:** `JaaL42$Aa`

---

## โœจ Core Functionality

- **Event Management**
Create, edit, and manage events with full CRUD capabilities. Each event includes title, category, location, description, start/end dates, and optional image.

- **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** (with Multer). If no image is uploaded, a placeholder is used.

- **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, custom CSS
- **Backend**: Node.js, Express.js
- **Database**: MongoDB Atlas with Mongoose
- **Authentication**: `express-session` + `connect-mongo` session storage
- **File Uploads**: Multer + Cloudinary (`multer-storage-cloudinary`)
- **Validation & Security**: express-validator, validator, Helmet, express-rate-limit, bcryptjs
- **Performance & Logging**: compression, morgan
- **Utilities**: Luxon (date/time), he (HTML entity encoding)

---

## ๐Ÿ” 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
- Manage RSVPs

- **Authorization** middleware ensures only event hosts can modify their own events.

---

## ๐Ÿง‘โ€๐ŸŽจ UI/UX

- **Space-inspired theme** with deep blues 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, 401, 404, 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
- Text scales smoothly on all screens; clean spacing; sticky footer; no layout shift

---

## โ™ฟ Accessibility
- Full keyboard support: clear focus outline + "skip to content" link
- Semantic landmarks (header, nav, main, footer), time elements, meaningful headings
- Forms announce errors; labels tied to inputs; status messages are announced
- Large, readable text and strong color contrast (meets WCAG AA level)
- Respects "Reduce Motion" preference

---

## ๐Ÿงช Validation & Error Handling

- Uses **express-validator** to validate/sanitize form input
- Passwords are hashed securely with **bcrypt** before storage
- Friendly error pages for:
- Invalid IDs
- Unauthorized 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`, `multer-storage-cloudinary`, `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 logic (auth/sessions/logging).

```bash
โ”œโ”€ app.js #app entrypoint: Express config, sessions, MongoDB, routes, views
โ”œโ”€ middlewares.js #auth/role checks (isAuthenticated, isGuest, isHost/isNotHost)
โ”œโ”€ 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
โ”‚ โ””โ”€ nav.ejs
โ”œโ”€ public/ #static assets served by Express
โ”‚ โ”œโ”€ css/
โ”‚ โ”œโ”€ images/
โ”‚ โ””โ”€ javascript/ #client-side scripts
โ”œโ”€ package.json
โ””โ”€ package-lock.json
```
---

## ๐Ÿš€ Getting Started (Local Dev)

1) Clone repository

```bash
git clone https://github.com/jillmpla/node_js_space_events_app.git
cd node_js_space_events_app
```

2) Install dependencies

```bash
npm install
```

3) Create a .env file with your keys

```bash
MONGODB_URI=...
SECRET_KEY=...
CLOUDINARY_CLOUD_NAME=...
CLOUDINARY_API_KEY=...
CLOUDINARY_API_SECRET=...
CLOUDINARY_URL=...
```

4) Run the app

```bash
npm start
```

5) Visit: http://localhost:3000

---

## ๐Ÿ“œ License
This project is licensed under the MIT License. See the [License](./LICENSE) file for details.

## If you find this project useful, consider giving it a star! โญ