OnlyMembers is a simple, user-friendly, responsive session-based authentication demo application. After users create their accounts, they can leave messages on the message board. An unauthenticated person cannot see who posted the message and when it was posted.
PS: Don't get excited, it has nothing to do with OnlyFans :)
- Node.js
- Express.js
- passport.js
- bcrypt
- MongoDB Atlas
- Boostrap
- Clone the repository.
- Install dependencies
npm install
- Create a .env file in the root directory.
- Add following variables:
MONGODBURI
SECRET
SESSION_COLLECTION_NAME
- Paste your MongoDB string
"mongodb+srv://<user>:<password>@cluster0.xxxxxxx.mongodb.net/<dbname>?retryWrites=true&w=majority"
- Choose secret key
SECRET
for session secret. - Choose a collection name for your sessions in database.
- Start the server
npm run devstart
- Access the application using
http://localhost:3000
Main page for unauthenticated person
Main page for authenticated person
Eight messages are displayed on each page (You can change it if you want). You can use the pagebar to navigate.
You can view your own messages by using the "Your Messages" button, and you can view other users' messages by clicking on their usernames below the messages.