Boilerplate for NodeJS Frontend & Backend Web Application Development
- Requirements
- Quick Start
- Built In - Technologies
- Modules References
- Environmental Variables
- Features
- Browser Support
- Bug Reports
- Support The Project
- NodeJS (Latest version recommended)
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.
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.
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 ) |
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 |
- 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 👀...
This project uses PostCSS along with the AutoPrefixer Plugin to support all the latest and stable releases of all major browsers.
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!
- 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!
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 🖤