Coder Social home page Coder Social logo

members-only's Introduction

Members Only

The idea of this project is taken from Members Only of The Odin Project. It's not exactly the same but the main features of the project is taken.

My goal in this project was to practice authentication using Passport.js local strategy. Aside from this, I learned other things too.

The technologies I used:

I tried my best on the server-side code, but the cliend-side might not be pretty. Sorry for that!

You can see a demo here.

How to run

To run this site and see if it works well, you need to take a few steps.

First, you need to download and install Node.js.

Second, you need to have a MongoDB database so the app can connect to it. You can get a free tier of MongoDB Atlas. There's a guide here.

Third, you need an AWS S3 storage. I myself used Arvan Cloud storage service (for ease).

For the last part, you need to clone this repo. Go to any directory you want in your computer. Then, open the terminal and write the command below (I assume you already have Git installed):

git clone https://github.com/mahdiHash/members-only.git

After that:

cd members-only

Now you need to create a .env file in the root directory. This file is needed so the app can read the important and non-public information from environment variables. Here's the list of variables you need to create:

  • SECRET_KEY: your online storage service secret key,
  • ACCESS_KEY: your online storage service access key,
  • BUCKET: your online storage service bucket name,
  • ENDPOINT: your online storage service endpoint,
  • MONGODB: your mongodb URI.
  • PREMIUM_CODES: the codes to become premium, seperated by a semicolon,
  • SESSION_SECRET: a random long string so the express-session package can use.

After these steps, you need to install the dependencies. For that, you can write npm install in the terminal. This will install all the dependencies the project needs.

Now to run a local server, enter npm run start (you can also write npm run startserver to use nodemon). After starting the server, you can open a browser and write 127.0.0.1:3000 in the address bar. You should see the homepage now.

members-only's People

Contributors

mahdihash avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.