DEV Community

PrakadAlpha
PrakadAlpha

Posted on

2 1

MERN BOILER PLATE

" A well structured and commented boiler plate code for devs "

Link for the code on Github

πŸ‘·β€β™‚οΈ Contents of the backend

  • Node and Express server
  • Simple User authentication mechanism
  • Basic Route protection also enabled
  • Implemented JWT, token based authentication
  • Also added Role Based Authentication sample code
  • Express asyncHandler wrapping mechanism for handling async errors
  • Routes and Middleware details are well commented
  • Used dotenv for Environment Variables(config.env)
  • Mongoose for Db connection in config folder(db.js)
  • Powerpacked express middlewares(helmet etc..) for preventing basic attacks (XXS, NoSQL injection)

πŸ‘¨β€πŸ’» Contents of the frontend

  • Built with React and Redux
  • Updated Redux Hooks usage(useSelector and useDispatch)
  • Usage of redux-thunk for handling the async code
  • Added basic customizable css for easy usage
  • Axios for api requests
  • Removed tests and extra files

πŸ›  Project Setup Instructions

  • To install the Client and Server dependencies.

    npm run setup
    

Development mode scripts

  • To run the both end's using concurrently.

    npm run dev
    
  • To run the backend in development mode using Nodemon.

    npm run server
    
  • To run the frontend in development mode.

    npm run client
    

Production mode script

  • To build the client and run the server

    npm run prod
    

πŸ’– Download & Share

Absoultely! Feel free to share the repo and the code,

Give a ⭐ star if it was helpful, please do share!

βž• Contribution

Anyone is welcome to contribute. Please feel free to submit a Pull Request for typo fixes, spelling corrections and improvements etc..

Link for the code on Github

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly β€” using the tools and languages you already love!

Learn More

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

πŸ‘‹ Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay