Skip to content

Secrets app using Node.js/Express/EJS, MongoDB-Atlas/Mongoose, Heroku, Bootstrap. minimalist app where you can share your secrets anonymously.

License

Notifications You must be signed in to change notification settings

AbayIbrayev/SecretsApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SecretsApp

logo

Secrets app using Node.js/Express/EJS minimalist clone of the Whisper app where you can share your secrets anonymously.

To make changes

  • If you want to make any changes in the app or if you had any issues/bugs you can fork the app and try to pull request to my repo and I will be able to merge your changes

To set up your own Secrests app

  • I strongly recommend to use environment variables to secure your sensitive data (https://www.npmjs.com/package/dotenv)
  • You can just simply clone the app and set it up like I explain below:
  1. First you need to install all the packages by openning the repository directory in your terminal and run npm install
  2. You need to set up a database cluster for your app on mongoDB Atlas(https://www.mongodb.com/cloud/atlas)
  3. Link your cluster with the app in the app.js file
mongoose.connect(
  'HERE_YOU_INSERT_THE_LINK_FROM_YOUR_CLUSTER', {
    useNewUrlParser: true,
    useUnifiedTopology: true,
    useCreateIndex: true
  }
);
  1. Set up your app on the Google Developers Console(https://console.developers.google.com/)
  2. In the dashboard select API & Services and set up OAuth 2.0 credentials for your web app
  3. Insert your app's Client ID and Client Secret from the Google Developers Console into the app.js file
passport.use(
  new GoogleStrategy({
      clientID: 'YOUR_CLIENT_ID',
      clientSecret: 'YOUR_CLIENT_SECRET',
      callbackURL: "YOUR_OWN_URL/auth/google/secrets",
      // callbackURL: "http://localhost:3000/auth/google/secrets",
      userProfileURL: "https://www.googleapis.com/oauth2/v3/userinfo"
    },
    function (accessToken, refreshToken, profile, cb) {
      User.findOrCreate({
        googleId: profile.id
      }, function (err, user) {
        return cb(err, user);
      });
    }
  )
);
  1. Set up a random string for the Passport.js to secure sessions/cookies
app.use(
  session({
    secret: 'YOUR_LONG_AND_SECURE_STRING',
    resave: false,
    saveUninitialized: false
  })
);
  1. Deploy your app on heroku and set up all your config variables(https://dashboard.heroku.com/)
  2. Finally! Now you have your own Secrets app =)

Thank you for checking my app! ✌️

  • Hope this repository will be helpfull, happy coding or using! 😁