This repository contains a full boilerplate application stack with a Vite + React (TypeScript) frontend, a Node.js Express backend, MongoDB & PostgreSQL databases, and a production-grade Jenkins CI/CD Pipeline complete with formatted Telegram notifications.
graph TD
subgraph Users
client[Vite Frontend - Port 3000]
end
subgraph Backend Services
api[NodeJS Express Server - Port 5000]
end
subgraph Databases
pg[(PostgreSQL - Port 5432)]
mongo[(MongoDB - Port 27017)]
end
client -->|APIs| api
api -->|SQL Query| pg
api -->|Mongoose Connection| mongo
.
βββ backend/
β βββ src/
β β βββ index.js # Express server entry point with MongoDB & Postgres connections
β βββ Dockerfile # Node lightweight docker environment
β βββ package.json
βββ frontend/
β βββ src/
β β βββ App.tsx # Live status dashboard with build simulation
β β βββ main.tsx
β βββ Dockerfile # Multi-stage docker file serving Vite static builds with Nginx
β βββ package.json
βββ jenkins/
β βββ scripts/
β βββ telegram-notify.sh # Script executing curl payload to Telegram API
βββ docker-compose.yml # Core orchestrator running the entire stack locally
βββ Jenkinsfile # Jenkins Declarative Pipeline definition
βββ README.md
To run the application locally outside of Jenkins:
- Make sure you have Docker and Docker Compose installed.
- Clone the repository and run:
docker compose up --build
- Open http://localhost:3000 to view the live dashboard. The dashboard will automatically ping the backend container at
http://localhost:5000/api/healthand display the status of PostgreSQL and MongoDB connections.
To receive status notifications, you need a Telegram Bot token and Chat ID.
- Create a bot via @BotFather and copy the HTTP API Token.
- Create a channel or group chat, add the bot as an administrator, and get the chat ID (e.g. using @raw_data_bot or query
https://api.telegram.org/bot<TOKEN>/getUpdates).
Add two Secret Text credentials in your Jenkins Credentials Manager:
- ID:
TELEGRAM_BOT_TOKEN, Secret:YOUR_TELEGRAM_BOT_TOKEN - ID:
TELEGRAM_CHAT_ID, Secret:YOUR_TELEGRAM_CHAT_ID
- In Jenkins, create a new Pipeline job.
- Under Pipeline Definition, select Pipeline script from SCM.
- Select Git, enter your repository URL, set the branch to
main, and typeJenkinsfileas the Script Path. - Trigger the build!
The pipeline outputs formatted alerts to your Telegram chat containing rich information:
π’ Jenkins Build #15 SUCCESS
π Repository: company-project
πΏ Branch: main (commit: d8a71c3)
π€ Author: namnk
π¬ Message: feat: add postgres backend integration
β± Duration: 1m 24s
π Jenkins UI Link