Skip to content

gauravsingh1281/ConfessionsVerse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ConfessionsVerse is a secure, anonymous confession-sharing web application where users can express their deepest thoughts, secrets, and confessions without revealing their identity. Built with modern web technologies, it provides a safe space for people to share what's on their mind while maintaining complete anonymity.

✨ Key Features

  • 🔐 Anonymous Sharing - Share confessions without revealing your identity
  • 🔐End-to-End Encryption - All user secrets are encrypted before storage and decrypted on retrieval
  • 👤 User Authentication - Secure login/registration system with OAuth support
  • 📱 Mobile Responsive - Optimized for all device sizes and screen types
  • 🎨 Modern UI/UX - Clean, dark-themed interface with smooth animations
  • 🔐 Privacy Focused - No personal information stored with confessions, enhanced with encryption
  • 💬 Real-time Updates - See latest confessions from the community
  • 📝 Personal Dashboard - View your own submitted confessions

🚀 Live Demo

🔗 Visit ConfessionsVerse

💬 Go ahead and share your own confessions anonymously.
Let your heart speak — no names, no judgment.
Show some love 💖 and be a part of ConfessionsVerse.

🛠️ Technologies Used

Backend

  • Node.js - JavaScript runtime environment
  • Express.js - Fast, unopinionated web framework
  • MongoDB - NoSQL database for data storage
  • Mongoose - MongoDB object modeling for Node.js
  • Passport.js - Complete authentication middleware for all login/register strategies
  • Express-Session - Session management middleware
  • crypto - Built-in Node.js encryption/decryption for user secrets
  • dotenv - Environment variable management

Frontend

  • EJS - Embedded JavaScript templating engine
  • Tailwind CSS - Utility-first CSS framework
  • Font Awesome - Icon library for beautiful icons
  • Responsive Design - Mobile-first responsive approach

Authentication Strategies (All via Passport.js)

  • Passport Local Strategy - Traditional username/password authentication with bcrypt hashing
  • Passport Google OAuth 2.0 - One-click social login integration with Google accounts
  • Passport Facebook OAuth - Seamless social login integration with Facebook accounts
  • Unified Passport Framework - All authentication methods managed through Passport.js middleware
  • Strategy Configuration - Custom passport configuration for each authentication method
  • Session Serialization - Passport handles user session serialization and deserialization

📁 Project Structure

ConfessionsVerse/
├── views/
│   ├── partials/
│   │   ├── header.ejs
│   │   └── footer.ejs
│   ├── home.ejs
│   ├── login.ejs
│   ├── register.ejs
│   ├── secrets.ejs
│   ├── submit.ejs
│   └── userSecrets.ejs
├── public/
│   ├── input.css
│   └── output.css
├── app.js
├── package.json
└── README.md

🔌 API Endpoints

Authentication Routes (Passport.js Powered)

Method Endpoint Description Access Passport Strategy
GET / Home page Public None
GET /login Login page Public None
POST /login User login authentication Public passport-local
GET /register Registration page Public None
POST /register User registration Public passport-local
GET /logout User logout Private req.logout()

OAuth Routes (Passport.js Strategies)

Method Endpoint Description Access Passport Strategy
GET /auth/google Initiate Google OAuth login Public passport-google-oauth20
GET /auth/google/secrets Google OAuth callback Public passport-google-oauth20
GET /auth/facebook Initiate Facebook OAuth login Public passport-facebook
GET /auth/facebook/secrets Facebook OAuth callback Public passport-facebook

Application Routes

Method Endpoint Description Access
GET /secrets View all community confessions Private
GET /secrets/:userId View specific user's confessions Private
GET /submit Submit confession page Private
POST /submit Submit new confession Private

## ⚙️ Installation & Setup

### Prerequisites

- Node.js (v18 or higher)
- MongoDB Atlas account or local MongoDB installation
- Passport.js strategies configured for authentication
- Google OAuth credentials (optional for social login)
- Facebook OAuth credentials (optional for social login)

### 1. Clone the Repository

```bash
git clone https://github.com/gauravsingh1281/ConfessionsVerse.git
cd ConfessionsVerse

2. Install Dependencies

npm install

3. Environment Variables

Create a .env file in the root directory:

# Database Configuration
MONGODB_URI=mongodb+srv://username:[email protected]/confessionsverse

# Session Secret (Generate a secure random string)
SESSION_SECRET=your-super-secret-session-key-here

# Encryption Key for User Secrets (Generate a secure 32-character key)
ENCRYPTION_KEY=your-32-character-encryption-key-here

# Google OAuth Configuration (Optional)
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret

# Facebook OAuth Configuration (Optional)
FACEBOOK_APP_ID=your-facebook-app-id
FACEBOOK_APP_SECRET=your-facebook-app-secret

# Server Configuration
PORT=3000
NODE_ENV=development

4. Setup MongoDB

  • Create a MongoDB Atlas account or install MongoDB locally
  • Create a new database named confessionsverse
  • Update the MONGODB_URI in your .env file

5. Setup Passport.js Configuration

Create passport configuration file (if not exists) to handle authentication strategies:

// config/passport.js or in app.js
const passport = require("passport");
const LocalStrategy = require("passport-local").Strategy;
const GoogleStrategy = require("passport-google-oauth20").Strategy;
const FacebookStrategy = require("passport-facebook").Strategy;

// Configure Passport Local Strategy
passport.use(new LocalStrategy(/* your local strategy config */));

// Configure Passport Google OAuth Strategy
passport.use(new GoogleStrategy(/* your Google OAuth config */));

// Configure Passport Facebook OAuth Strategy
passport.use(new FacebookStrategy(/* your Facebook OAuth config */));

6. Start the Application

# Development mode with nodemon
npm run dev

# Production mode
npm start

6. Access the Application

Open your browser and navigate to http://localhost:3000

🔧 OAuth Configuration

Google OAuth Setup

  1. Go to Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the Google+ API
  4. Go to "Credentials" → "Create Credentials" → "OAuth 2.0 Client IDs"
  5. Add authorized redirect URIs:
    • http://localhost:3000/auth/google/secrets (development)
    • https://yourdomain.com/auth/google/secrets (production)

Facebook OAuth Setup

  1. Go to Facebook Developers
  2. Create a new app
  3. Add "Facebook Login" product
  4. Configure OAuth redirect URIs:
    • http://localhost:3000/auth/facebook/secrets (development)
    • https://yourdomain.com/auth/facebook/secrets (production)

📱 Features in Detail

🔐 Anonymous Confession System

  • Users can submit confessions without revealing personal details
  • Encrypted Storage: All confessions are encrypted before being saved to the database
  • Secure Retrieval: Confessions are decrypted only when displayed to users
  • No Tracking: Confessions are displayed without author information
  • Complete privacy and anonymity maintained throughout the platform

Deploy to Render

  1. Push your code to GitHub
  2. Create a new account on Render
  3. Connect your GitHub repository
  4. Set up environment variables in Render dashboard
  5. Deploy with automatic builds enabled

Environment Variables for Production

MONGODB_URI=your-production-mongodb-uri
SESSION_SECRET=your-production-session-secret
ENCRYPTION_KEY=your-production-encryption-key
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
FACEBOOK_APP_ID=your-facebook-app-id
FACEBOOK_APP_SECRET=your-facebook-app-secret
NODE_ENV=production

👨‍💻 Author

Gaurav Singh


Made with 💖 for the community to share and connect anonymously.

🔗 Visit ConfessionsVerse and be part of the conversation!

Remember: Your confessions are safe, anonymous, and help others feel less alone. Share your story today.

About

Don’t keep your confessions secret — share them anonymously.

Resources

Stars

Watchers

Forks