Skip to content

Boilerplate for NodeJS Frontend & Backend Web Application Development (currently under development)

License

Notifications You must be signed in to change notification settings

mfacecchia/nodejs-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeJS Boilerplate

Boilerplate for NodeJS Frontend & Backend Web Application Development

Table of contents

Requirements

  • NodeJS (Latest version recommended)

Quick Start

To use this repository as a template for your brand-new project, you can download the latest version from the releases section, or directly create a new repository from here. Once you have created your new repository, open the project in your favorite IDE and type in the terminal the following:

cd backend
npm install
cd ../frontend
npm install

This will install all the node modules and libraries required to run the project.

Built In - Technologies

HTML5 CSS JavaScript
NodeJS ExpressJS
PostCSS TailwindCSS DaisyUI EJS
MySQL Prisma

Modules References

Frontend

Backend

Database

Authentication

Security

Environmental Variables

A .env.sample file is provided in the project for both the Frontend and the Backend with all instructions on how to use it in your project and customize it based on your needs.

Frontend

Variable Name Usage
PORT Express.JS server port
NODE_ENV Application's current environment (development or production)(if the value is on development, all app errors will be printed out to console
BACKEND_ADDRESS Backend application's address and port (default to 127.0.0.1:3000)

Backend

Variable Name Usage
PORT Express.JS server port
NODE_ENV Application's current environment (development or production)(if the value is on development, all app errors will be printed out to console
FRONTEND_ADDRESS Frontend application's address and port (default to 127.0.0.1:5500)
DATABASE_URL Database connection string (type://user@password:port/dbname)
REDIS_URL Redis database connection string (redis://user:password@host:port/dbNumber)
JWT_SECRET Json Web Token secret (used for token generation & validation)
NODEMAILER_HOST SMTP hostname (ex. smtp.google.com)
NODEMAILER_USER Email address to use to send messages (ex. hello@world.com)
NODEMAILER_PASSWORD Email password

Built-In Features

  • Custom classes with the most commonly generated errors & relative errors handling function
  • JWT & CSRF Token Generation and Validation middlewares
  • Most common rate limiters for all the endpoints
  • Sign-Up & Log-In endpoints (data validation middleware included)
  • User CRUD (Obtain, Update, and Delete all user's related information)
  • Email Verification & Password Reset endpoints
  • Most common utility functions & fetch operations (Frontend)
  • ...and more to come 👀...

Browser Support

This project uses PostCSS along with the AutoPrefixer Plugin to support all the latest and stable releases of all major browsers.

Bug Reports

Feel like this boilerplate needs some adjustments or have you just found out a bug or worse a vulnerability that needs to be resolved? Feel free to open an issue and I will try to do my best to implement that new functionality or to fix that bug as soon as possible!

Notes to issue a Bug or a Vulnerability

  • Check if the issue has already been fixed
  • Check if the issue is already open from the Issues Tracker. It may have already been reported by somebody else
  • Provide a good test case, and write down the most descriptive and detailed explanation you can give. A good bug report should include:
    • OS Version
    • Browser Version
    • How to reproduce the bug
    • A video demonstration of the bug (if possible)
    • What you'd expect the functionality to do

Any contribution is highly apreciated!

Support The Project

Tried this project and want to support the developer in some way? I opened a Buymeacoffee account which you can donate to. Any contribution, even a tiny one is highly appreciated and will spur me continue developing projects like this! Thank you so much 🖤

About

Boilerplate for NodeJS Frontend & Backend Web Application Development (currently under development)

Resources

License

Stars

Watchers

Forks

Packages

No packages published