Members Only

Source code: https://github.com/gofhilman/members-only
Website: https://members-only-production-3629.up.railway.app/
Members Only is a web application where users can create and view posts. However, access to certain details depends on the user's role. The application is designed to demonstrate role-based access control, allowing different levels of access for visitors, logged-in users, members, and admins.
Features
- Public Access: Visitors can view posts, but author names and timestamps are hidden.
- User Registration and Login: Users can sign up and log in to create posts.
- Membership: Users can enter a passcode to become members, unlocking the ability to see author names and timestamps.
- Admin Access: Admins can delete posts and have full visibility of all details.
- Post Management: Users can create posts with titles and content.
- Validation: Form inputs are validated to ensure data integrity.
- Authentication: Secure login system using passport.js with session-based authentication.
- User Local Time: Posts are displayed with timestamps adjusted to the user's local time.
- Responsive Design: The application is mobile-friendly.
Tech stack
- Node.js: JavaScript runtime for building the server-side application.
- Express.js: Web framework for routing and middleware.
- PostgreSQL: Relational database for storing session, user, and post data.
- Passport.js: Authentication middleware for user login.
- bcrypt.js: Library for hashing passwords securely.
- EJS: Templating engine for rendering dynamic HTML pages.
- CSS: Custom styles with responsive design principles.
- date-fns: Library for formatting timestamps.
- express-validator: Middleware for validating and sanitizing form inputs.
- express-session: Middleware for managing user sessions.