Skip to content

A website in which people can register or login and share their secrets secretly and see other's with authentication.

License

Notifications You must be signed in to change notification settings

R-i-t-i-k-a/Secrets-website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Certainly! Here's an example of a README file for the code you provided:

Secrets Web Application

This is a web application that allows users to share secrets anonymously. It provides user authentication using Passport.js and Google OAuth2. Users can register, log in, and submit secrets once authenticated.

Features

  • User registration: Users can create accounts by providing a username and password.
  • User login: Registered users can log in to access their account.
  • Google OAuth2 authentication: Users can also authenticate using their Google accounts.
  • Secrets submission: Authenticated users can submit secrets anonymously.
  • View secrets: Authenticated users can view and read the secrets shared by other users.
  • Logout: Users can log out of their accounts.

Prerequisites

To run this application, you need the following:

  • Node.js installed on your machine
  • MongoDB database

Installation

  1. Clone the repository:
git clone https://github.com/your-username/secrets-web.git
  1. Navigate to the project directory:
cd secrets-web
  1. Install the dependencies:
npm install
  1. Set up environment variables:

Create a .env file in the project root directory and add the following variables:

CLIENT_ID=your-google-client-id
CLIENT_SECRET=your-google-client-secret

Make sure to replace your-google-client-id and your-google-client-secret with your actual Google OAuth2 client ID and client secret.

  1. Start the application:
node app.js
  1. Open your web browser and visit http://localhost:3000 to access the application.

Folder Structure

The folder structure of the project is as follows:

├── app.js               # Main application file
├── models               # Database models
│   └── User.js          # User model
├── public               # Public assets (CSS, images, etc.)
├── routes               # Express routes
│   ├── auth.js          # Authentication routes
│   └── secrets.js       # Secrets routes
├── views                # EJS view templates
├── .env                 # Environment variables configuration
└── package.json         # Project dependencies and scripts

Dependencies

The main dependencies used in this project are:

  • Express: Fast and minimalist web framework for Node.js
  • Passport: Authentication middleware for Node.js
  • Mongoose: MongoDB object modeling for Node.js
  • EJS: Embedded JavaScript templates for rendering views
  • Express-session: Session middleware for Express.js
  • Passport-local-mongoose: Passport.js plugin for simplifying local authentication with Mongoose
  • Passport-google-oauth20: Passport.js strategy for Google OAuth2 authentication
  • Mongoose-findorcreate: Mongoose plugin for simplified findOrCreate operations

Please refer to the package.json file for a complete list of dependencies and their versions.

Contributing

Contributions to this project are welcome. Feel free to open issues and submit pull requests to suggest improvements or fix any bugs.

License

This project is licensed under the MIT License.


Feel free to customize this README file based on your specific project requirements and add any additional sections or information you deem necessary.

About

A website in which people can register or login and share their secrets secretly and see other's with authentication.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published