A basic JWT authentication boilerplate, using MongoDB, Express Sessions and TypeScript, along with React as the main front-end library.
First, clone the repo:
$ git clone https://github.com/gantoreno/mern-jwt-template.git # Or fork the project
$ cd mern-jwt-template
Install all the server dependencies with yarn
:
$ yarn install
Don't forget to install client dependencies too:
$ cd client && yarn install
Then, rename .env.example
to .env
and place your MongoDB connection string, JWT secret and session secreto into the file.
Finally, run the project using the dev
script in the project's root directory:
$ yarn run dev
Happy hacking! 🎉️