CICD — MERN, Github & Actions, and C-Panel

Vithujan_S
3 min readNov 14, 2023

--

https://ajcarrentals.lk
ajcarrentals.lk

This is our streamlined Simple Car Rental website (ajcarrentals.lk), meticulously crafted using the MERN stack to offer a seamless user experience. The website boasts essential pages such as Home, About, Services, Contact, a personalized Dashboard, and a secure Login feature. Noteworthy is the fact that only designated administrators have access to the Dashboard, where they can efficiently manage the fleet by adding, editing, and deleting cars.

Dashboard — Manage Cars, Request Forms

Open to all users is the ability to view available cars on the platform. However, the exclusive privilege of filling out the vehicle request form, as well as its subsequent management through editing and deletion, lies solely with the admin.

Our project adheres to a well-organized folder structure, with two main subdirectories — ‘client’ for the frontend (React) and ‘server’ for the backend (Node.js). Both components have dedicated GitHub repositories to maintain version control effectively.

Folder Structure

Emphasizing our commitment to robust CI/CD practices, we leverage GitHub Actions for automated builds. This facilitates the seamless deployment of updates to the C Panel. Our CI/CD pipeline includes FTP user and password configurations on the C Panel, ensuring secure and efficient deployment.

  1. Create Github Actions (create actions — master.yaml)
Actions template
master.yml

2. Create FTP account (user, password)

Create FTP Account — then use this in master.yml

Specifically for Node.js, we’ve established a dedicated application on the C Panel, automating the deployment of the Node.js folder. This process generates the backend API link, crucial for integrating with the frontend prior to each build.

  1. Setup node js in CPanel
Setup Node Js by clicking the button Create Application

Get the API Link — Backend (App URI)

To further enhance efficiency, we’ve set up automatic GitHub triggers linked to the main branch, ensuring a continuous integration process. Our comprehensive approach not only ensures a smooth user interface but also reflects our commitment to maintaining a robust and secure development environment.

  1. Deployment automation
Automated Work Flow ( Different workflow for FE and BE)

--

--

Vithujan_S
Vithujan_S

Written by Vithujan_S

DevOps Engineer | B.Sc (hons) in Information Technology

No responses yet