diff --git a/.env b/.env index 5acda1b..f7d5684 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ -REACT_APP_API_BASE_URL=http://localhost:8000 +REACT_APP_API_BASE_URL=http://192.168.1.48:8000 HOST=0.0.0.0 diff --git a/src/pages/AboutUs.jsx b/src/pages/AboutUs.jsx index 940e264..adfc29f 100644 --- a/src/pages/AboutUs.jsx +++ b/src/pages/AboutUs.jsx @@ -9,22 +9,61 @@ import mechanicalBg from "../assets/mechanical-bg.jpg"; import electricalBg from "../assets/electrical-bg.jpg"; import electromechanicalBg from "../assets/electromechanical-bg.jpg"; import itBg from "../assets/it-bg.jpg"; -import renewableBg from "../assets/renewable-bg.jpg"; // renamed image +import renewableBg from "../assets/renewable-bg.jpg"; -// Animation variants +/* ===================== + Animation Variants +===================== */ const containerVariants = { hidden: { opacity: 0 }, - visible: { + visible: { opacity: 1, - transition: { staggerChildren: 0.2 } + transition: { staggerChildren: 0.2 }, }, }; const itemVariants = { hidden: { opacity: 0, y: 20 }, - visible: { opacity: 1, y: 0 } + visible: { opacity: 1, y: 0 }, }; +/* ===================== + Working Fields Data + (Declared Once) +===================== */ +const WORKING_FIELDS = [ + { + title: "Civil Engineering", + desc: "Urban infrastructure, roadworks, dams, WTPs, STPs, stormwater management, and structural development.", + bg: civilBg, + }, + { + title: "Mechanical Engineering", + desc: "Fabrication, installation, and maintenance of industrial systems, heavy machinery, and automated solutions including SCADA.", + bg: mechanicalBg, + }, + { + title: "Electrical Engineering", + desc: "Reliable installations, power distribution, and maintenance services.", + bg: electricalBg, + }, + { + title: "Electromechanical & Instrumentation", + desc: "Integration of mechanical and electrical systems for pumping stations and automation.", + bg: electromechanicalBg, + }, + { + title: "Information Technology", + desc: "Project planning, GIS, data systems, and automation tools for smart engineering.", + bg: itBg, + }, + { + title: "Renewable Energy", + desc: "Solar, wind and sustainable energy solutions with advanced engineering support.", + bg: renewableBg, + }, +]; + const AboutUs = () => { return ( <> @@ -32,8 +71,12 @@ const AboutUs = () => {

About Us

-

Building the Nation with Precision & Excellence

-

“Engineering the future, one project at a time.”

+

+ Building the Nation with Precision & Excellence +

+

+ “Engineering the future, one project at a time.” +

@@ -51,110 +94,84 @@ const AboutUs = () => { About Laxmi Civil Engineering Services Pvt. Ltd.

- Laxmi Civil Engineering Services Pvt. Ltd. was established on 15th August 1980 as a partnership firm and later - converted into a Private Limited Company on 31st March 2000. + Laxmi Civil Engineering Services Pvt. Ltd. was established on{" "} + 15th August 1980 as a partnership firm and later + converted into a Private Limited Company on{" "} + 31st March 2000.

- For over four decades, LCEPL has been delivering exceptional engineering and construction services, making us one of the leading civil engineering solution providers in India. + For over four decades, LCEPL has been delivering exceptional + engineering and construction services.

- We specialize in major infrastructure projects such as portable water supply, irrigation, pumping stations, electromechanical works, and operation & maintenance. + We specialize in major infrastructure projects such as portable + water supply, irrigation, pumping stations, electromechanical + works, and operation & maintenance.

- Our leadership in these unique services has allowed us to establish a strong foothold in the central, western, and southern regions of India, while also expanding into the northern region. + Our leadership in these unique services has allowed us to expand + across central, western, southern, and northern India.

- With a workforce of 1300+ professionals, supported by advanced technology and an inspiring work environment, we continue to move forward with confidence. + With a workforce of 1300+ professionals, we + continue to move forward with confidence.

{/* COUNTERS */} - - + - + - + - {/* QUOTE BANNER */} -
- “Driven by innovation, guided by integrity, delivering with passion.” -
- - {/* VISION & MISSION SECTION */} - - -

- - Vision & Mission - - -

-
- {/* Vision */} - -
-
- - - - -
-
-

Vision

-

To be a company at the forefront of engineering and construction, renowned for excellence, quality, performance, and reliability.

-
-
-
- - {/* Mission */} - -
-
- - - -
-
-

Mission

-

To complete every project undertaken with sincerity, excellence, and in a time-bound manner, meeting all expectations of the client.

-
-
-
-
-
-
- {/* WORKING FIELDS SECTION */}
-

Expertise Across Multiple Sectors

-

Our multidisciplinary approach helps us lead across multiple domains.

+

+ Expertise Across Multiple Sectors +

+

+ Our multidisciplinary approach helps us lead across multiple domains. +

- {[ - { title: "Civil Engineering", desc: "Urban infrastructure, roadworks, dams, WTPs, STPs, stormwater management, and structural development.", bg: civilBg }, - { title: "Mechanical Engineering", desc: "Fabrication, installation, and maintenance of industrial systems, heavy machinery, and automated solutions including SCADA.", bg: mechanicalBg }, - { title: "Electrical Engineering", desc: "Reliable installations, power distribution, and maintenance services.", bg: electricalBg }, - { title: "Electromechanical & Instrumentation", desc: "Integration of mechanical and electrical systems for pumping stations and automation.", bg: electromechanicalBg }, - { title: "Information Technology", desc: "Project planning, GIS, data systems, and automation tools for smart engineering.", bg: itBg }, - { title: "Renewable Energy", desc: "Solar, wind and sustainable energy solutions with advanced engineering support.", bg: renewableBg }, - ].map((field, idx) => ( -
+ {WORKING_FIELDS.map((field) => ( +
+
-
{field.icon}

{field.title}

{field.desc}

diff --git a/src/pages/AddProjects.jsx b/src/pages/AddProjects.jsx index c70c339..0e1d0f6 100644 --- a/src/pages/AddProjects.jsx +++ b/src/pages/AddProjects.jsx @@ -2,6 +2,23 @@ import React, { useState, useEffect } from "react"; import axios from "axios"; import { toast } from "react-toastify"; +/* ===================== + Constants (Optimized) +===================== */ +const API_BASE = process.env.REACT_APP_API_BASE_URL; + +const SECTORS = [ + { label: "Water Supply", value: "water supply" }, + { label: "Storm Water", value: "storm water" }, + { label: "Electromechanical", value: "electromechanical" }, + { label: "Real Estate / Buildings", value: "real estate / buildings" }, + { label: "Tunnel", value: "tunnel" }, + { label: "Roads", value: "roads" }, + { label: "Wastewater / Sewerage", value: "wastewater / sewerage" }, + { label: "Irrigation", value: "irrigation" }, + { label: "Renewable Energy", value: "renewable energy" }, +]; + const AddProjects = () => { const [projects, setProjects] = useState([]); const [sector, setSector] = useState(""); @@ -10,22 +27,12 @@ const AddProjects = () => { const [editMode, setEditMode] = useState(false); const [editProjectId, setEditProjectId] = useState(null); - const sectors = [ - { label: "Water Supply", value: "water supply" }, - { label: "Storm Water", value: "storm water" }, - { label: "Electromechanical", value: "electromechanical" }, - { label: "Real Estate / Buildings", value: "real estate / buildings" }, - { label: "Tunnel", value: "tunnel" }, - { label: "Roads", value: "roads" }, - { label: "Wastewater / Sewerage ", value: "wastewater / sewerage " }, - { label: "Irrigation", value: "irrigation" }, - { label: "Renewable Energy", value: "renewable energy" } - ]; - - // Fetch all projects + /* ===================== + Fetch Projects + ===================== */ const fetchProjects = async () => { try { - const res = await axios.get(`${process.env.REACT_APP_API_BASE_URL}/api/projects`); + const res = await axios.get(`${API_BASE}/api/projects`); setProjects(res.data); } catch (err) { console.error("Error fetching projects", err); @@ -36,7 +43,9 @@ const AddProjects = () => { fetchProjects(); }, []); - // Reset the form + /* ===================== + Helpers + ===================== */ const resetForm = () => { setSector(""); setImage(null); @@ -45,16 +54,18 @@ const AddProjects = () => { setEditProjectId(null); }; - // Handle image selection const handleImageChange = (e) => { const file = e.target.files[0]; setImage(file); setImagePreview(file ? URL.createObjectURL(file) : null); }; - // Handle form submit (add or update) + /* ===================== + Submit (Add / Update) + ===================== */ const handleSubmit = async (e) => { e.preventDefault(); + if (!sector || (!editMode && !image)) { toast.error("Sector and image are required!"); return; @@ -66,10 +77,13 @@ const AddProjects = () => { try { if (editMode) { - await axios.post(`${process.env.REACT_APP_API_BASE_URL}/api/projects/update/${editProjectId}`, formData); + await axios.post( + `${API_BASE}/api/projects/update/${editProjectId}`, + formData + ); toast.success("Project updated successfully!"); } else { - await axios.post(`${process.env.REACT_APP_API_BASE_URL}/api/projects`, formData); + await axios.post(`${API_BASE}/api/projects`, formData); toast.success("Project added successfully!"); } @@ -81,21 +95,25 @@ const AddProjects = () => { } }; - // Load project into form for editing + /* ===================== + Edit Project + ===================== */ const handleEdit = (project) => { setSector(project.sector); setImage(null); - setImagePreview(`${process.env.REACT_APP_API_BASE_URL}${project.image}`); + setImagePreview(`${API_BASE}${project.image}`); setEditMode(true); setEditProjectId(project.id); }; - // Delete a project + /* ===================== + Delete Project + ===================== */ const handleDelete = async (id) => { if (!window.confirm("Are you sure you want to delete this project?")) return; try { - await axios.delete(`${process.env.REACT_APP_API_BASE_URL}/api/projects/${id}`); + await axios.delete(`${API_BASE}/api/projects/${id}`); toast.success("Project deleted"); fetchProjects(); } catch (err) { @@ -111,14 +129,17 @@ const AddProjects = () => { {/* FORM */} -
+