This project is a full-stack CRUD (Create, Read, Update, Delete) web application built with React.js, Node.js (Express), MongoDB, and Socket.io. It follows best practices for modern web development, making it suitable for local development and future deployment in Kubernetes and CI/CD pipelines using GitHub Actions and Docker.
✅ CRUD Operations: Add, read, update, and delete items.
✅ Real-Time Updates: Changes appear instantly using Socket.io.
✅ Search Functionality: Users can filter records dynamically.
✅ Popup Modals: Clean UI for adding and updating items.
✅ RESTful API: A structured backend to interact with the database.
✅ Docker Ready: Designed for local containerized development.
✅ Secure Configurations: Uses environment variables instead of .env
.
crud-app/
│── backend/ # Server-side code
│ ├── models/ # Mongoose schemas
│ ├── routes/ # Express API routes
│ ├── server.js # Main Express server
│── frontend/ # Client-side React app
│ ├── src/
│ │ ├── components/ # Reusable React components
│ │ ├── pages/ # Page-level components
│ │ ├── App.js # Main React component
│ │ ├── index.js # Entry point for React
│── docker-compose.yml # Docker Compose configuration for local setup
│── Dockerfile # Docker configuration
│── README.md # Project documentation
- React.js (Component-based UI)
- Axios (API requests)
- Tailwind CSS (Styling)
- Socket.io-client (Real-time updates)
- Node.js + Express.js (REST API)
- MongoDB (Mongoose) (Database)
- Socket.io (WebSockets for real-time updates)
- MongoDB (Local containerized instance using Docker)
git clone https://github.com/AdhamGamal/crud-app-devops.git
cd crud-app-devops
bash setup.sh
This command will:
- Install frontend and backend dependencies.
- Build the frontend for production.
- Create a Docker network (if not exists).
- Build Docker images for the backend, frontend, and MongoDB.
- Set up environment variables.
- Stop and remove any existing containers.
- Start new containers for MongoDB, backend, and frontend.
- Display backend logs for debugging.
- Open the application in the browser (Linux only).
- Separation of Concerns: Organized code structure.
- Environment Variables: No hardcoded secrets.
- Real-Time Updates: Uses WebSockets efficiently.
- Containerized Database: Uses MongoDB in a local Docker container.
🔹 Set up a CI/CD pipeline with GitHub Actions 🚀 🔹 Deploy the application on Kubernetes (K8s) ☸️
🔹 Implement authentication (JWT or OAuth) 🔐
🔹 Add unit and integration tests 🧪
🚀 Happy Coding! 😃
- Create Dockerfiles for both frontend and backend.
- Build and push Docker images to a container registry (Docker Hub/GitHub Container Registry).
- Automate builds and tests.
- Deploy new versions to Kubernetes automatically on push to
main
branch.
- Define Kubernetes manifests (Deployment, Service, and Ingress).
- Use ConfigMaps and Secrets for managing environment variables.