
Develop a full stack invoice web app using docker, nginx, portainer, makefiles, and redux toolkit with rtk query, and deploy securely on a custom domain with letsencrypt ssl.
Prepare for this non-beginner MERN course by meeting prerequisites in JavaScript, APIs, Node.js with Express, Docker and containerization basics, and token-based authentication, React, Redux Toolkit, Git, Nginx, and SSL certificates.
Explore building a full stack invoice app with mongodb, express, react, and node, using docker, redux toolkit, material ui, and formik for forms.
Create a working directory and initialize git, then set up a new gitHub repository for the invoice app, configure node and npm versions, and generate a .gitignore for the project.
Initialize the project with npm to create a package.json, create a backend folder and .env file, install express and mongoose, and scaffold server.js using ECMAScript modules.
Explore insomnia basics: install the free tool, create a request collection, configure environments and variables (local and docker URLs, JWT token), and test an API endpoint with a get request.
Configure nodejs with docker by creating a dockerfile for a node 16 alpine base, adding labels, env, and a non-root user, and preparing the docker ignore and docker compose setup.
Build and configure a docker compose setup (version 3.9) with api, mongodb, mongo express, and mailhog, using a .env file, volumes, and a custom invoice network.
Build backend docker containers for the MERN invoice app by starting docker, running docker compose up -d --build --remove-orphans, and verify API, MongoDB, and mailhog via logs and web UIs.
Create and use a makefile to shorthand docker compose tasks for the MERN invoice app, including build, up, down, logs, and volume inspection.
Learn logging in Node.js with Morgan and Winston, understand NPM logging levels from error to silly, and use logs for tracing, http transactions, and debugging with stack traces.
Set up a custom logging system using Winston and Morgan, with rotating file transports, json formatted logs, exception and rejection handling, and a dedicated Morgan middleware for detailed http logs.
Learn to scaffold a React frontend for a MERN invoice app using redux toolkit, run locally, and dockerize the client with a Dockerfile and .dockerignore ahead of NGINX reverse proxy.
Learn how nginx acts as a reverse proxy and load balancer to route frontend and backend requests, enable https encryption, and support path-based routing for single-port production.
Set up the mern invoice app backend with nginx alpine by creating a dockerfile, defining upstream api port 1997 and client port 3000, and configuring proxy rules and websocket support.
Define client and nginx services in docker compose, configure reverse proxy at port 8080 with shared volumes and networks, and verify the front end and API connectivity.
Configure the backend database connection in the config directory's connect db.js using mongoose and env vars, then wire into server.js and install node mailer, express mongo sanitize, and validator.
Implement express-mongo-sanitize in the backend to guard against mongo operator injection by removing dollar signs and dots from request body, params, headers, and query.
Create a backend user model with authorization constants, mongoose schema, and validators; implement pre-save hooks for bcrypt password hashing, default roles, and a password-compare method.
Create a verify reset token model in MongoDB to support time-limited tokens for email verification and password reset, linked to the user via ObjectId with a 15-minute TTL.
Create a backend helpers folder with an email transport using NodeMailer, configured for mailhog in development and a production plan using Mailgun; set env vars and JWT keys.
Implement role-based access and authentication middlewares using JWT, with JSON error handling, not found routing, and API plus login rate limiters to secure the MERN app.
Implement an email service in the utils directory using handlebars templates and the node mailer transport, with a send email function and templates for welcome, account verification, and password reset.
Distinguish authentication from authorization, then examine access and refresh tokens, JWTs, and token rotation with reuse detection to secure API calls and user sessions.
Register and verify user emails via dedicated register and verify email controllers, sending verification tokens via email templates and login links through API v1 auth routes in a MERN backend.
Implement a login controller that authenticates users, issues access and refresh tokens with jwt, and stores the refresh token in an http-only cookie.
Learn to implement a refresh token controller that issues new access tokens, rotates refresh tokens, deletes old tokens, and detects token reuse to secure authentication.
Master resending of email verification tokens for tokens that expire after 15 minutes in a mern app, including backend controller logic, crypto-based token generation, and sending verification links by email.
Implement forgot password with two controllers to send a reset email and to reset the password using a verification token, including email delivery, token validation, and password updates.
Implement a secure logout flow by adding a logout controller, clearing the JWT cookie and access token, and removing the refresh token from the database, with proper cookie options.
Hi, welcome to this course on building a functional fullstack MERN app, that can be used for generating invoices, quotations and receipts.
We shall build this app, step by step, by leveraging tools and technologies such as Docker, NGINX, NGINX Proxy manager, Makefiles,Portainer, shell scripts, MongoDB, Express, ReduxToolkit and Redux Toolkit query, also called RTK-Query.
You will also learn how to serve your application on a custom domain name, and serve it securely over HTTPS with SSL Certificates from letsencrypt.
This course is NOT for absolute beginners. It is aimed at those with at least 1 year of relevant Fullstack Javascript experience. Having prior exposure to the MERN Stack will be advantageous.
This app was built by one person(myself), so of course, none of us is perfect. You might discover bugs here and there , or see ways of improving the codebase. Kindly, if you are able to fix any bugs you come across,or see ways of improving the codebase, please raise a PR on the repo.
I will review and merge in the changes for the benefit of all the other learners of this course.
Who am I? I am Alpha Ogilo, a self-taught full-stack software developer, currently working as a Senior Software Engineering Manager.
My Hope is that you shall gain immense value from this.