/evote-app

Online voting App using basic nodejs, express and openPGP for encryption.

Primary LanguageJavaScriptMIT LicenseMIT

evote-app

Online voting App using basic nodejs, express and openPGP for encryption.

Testing

  1. First you need to install mongodb server in you machine

    • 🤭 By the way you can Fork 🐸 and star 💓 ⭐ the repo
  2. Install NodeJs version > 10. Though, NodeJs LTS version 14 is recommended.

  3. Clone the repo using one of the two methods:

      # Using https link
      git clone https://github.com/faouziMohamed/evote-app.git
     # Or using the ssh link
     git git@github.com:faouziMohamed/evote-app.git
  4. Change directory to evote-app and install dependencies:

      cd evote-app
    • Install dependencies using npm

      npm install
    • Or using yarn

      yarn
  5. For testing purpose create a file called .env in the root of the project (evote-app) and paste the following content:
    This file will not be stagged into Git, Keep it only localy. Note that random secret bellow are generated using nanoid

      PORT = 3000
      APP_NAME = 'evote-app'
      DB_URL_DEV = 'mongodb://localhost:27017/evote-app'
      # Change the uri bellow with a mongo cloud atlas uri for production  
      DB_URL_PROD = 'mongodb://localhost:27017/evote-app'
      SESSION_EXPIRY = 1296000000
      SESSION_MAXAGE = 1296000000
    
      SERVER_NAME = 'Web Server in node'
      SERVER_EMAIL = 'server@webserver.ma'
      SERVER_PASSHPRASE = 'U2FsdGVaJunkyRanDomSECRETuP'
    
      COCENTER_NAME = 'Counting Center'
      COCENTER_EMAIL = 'co.server@server.ma'
      COCENTER_PASSHPRASE = 'CPutHere A RANDOM SECRET9yfDbhnBm51kSNpkL'
    
      VALIDATION_CENTER_NAME = 'Validation Center'
      VALIDATION_CENTER_EMAIL = 'validation.server@server.ma'
      VALIDATION_CENTER_PASSHPRASE = 'your RANDOM SERCER HERE plLrtFj2T7S'
    
      PASSPHRASE_KEY = 'RANDOMw22PiTFHSECRET0vQdZzUHQvIR98OWbVwpw9qZT_h'
      SESSION_SECRET='cZk_slfK84QiDDo-vMARANDOM SECRET CODElKJRUs-v7QbxUW-4'
  6. Then run tests on local typing:

    npm - yarn
    npm run dev Or yarn dev
  7. Open in your browser the url http://localhost:3000 to see result

🆗 That's it!!!

LICENSE MIT