Deleted useless files such as backend, node_modules and package-lock. Modified readme.

This commit is contained in:
K
2025-02-23 09:04:05 +05:30
parent 699bcb9d2c
commit 3f9e6d3dee
406 changed files with 1 additions and 119215 deletions
-25
View File
@@ -1,25 +0,0 @@
const express = require("express");
const {
createCrop,
getCropsByFarm,
getCropById,
updateCrop,
deleteCrop,
updateHealthStatus,
updateGrowthStage,
} = require("../Controllers/crop.controller.js");
const { checkAuthenticated } = require("../Middlewares/authentication.js");
const upload = require("../Middlewares/multer.js");
const router = express.Router();
// Routes for crop management
router.post("/", checkAuthenticated, upload.single("image"), createCrop); // Create a new crop
router.get("/farm/:farmId", checkAuthenticated, getCropsByFarm); // Get all crops
router.get("/:cropId", checkAuthenticated, getCropById); // Get a crop by ID
router.put("/:cropId", checkAuthenticated, updateCrop); // Update crop details
router.delete("/:cropId", checkAuthenticated, deleteCrop); // Delete a crop
router.put("/health/:cropId", checkAuthenticated, updateHealthStatus);
router.put("/growth/:cropId", checkAuthenticated, updateGrowthStage);
module.exports = router;
-19
View File
@@ -1,19 +0,0 @@
const express = require("express");
const {
createFarm,
getUserFarms,
getFarmById,
updateFarm,
deleteFarm,
} = require("../Controllers/farm.controller.js");
const { checkAuthenticated } = require("../Middlewares/authentication.js");
const router = express.Router();
router.post("/", checkAuthenticated, createFarm); // Create a new farm
router.get("/", checkAuthenticated, getUserFarms); // Get all farms
router.get("/:farmId", checkAuthenticated, getFarmById); // Get a farm by ID
router.put("/:farmId", checkAuthenticated, updateFarm); // Update a farm
router.delete("/:farmId", checkAuthenticated, deleteFarm); // Delete a farm
module.exports = router;
-24
View File
@@ -1,24 +0,0 @@
const express = require("express");
const {
addTransaction,
createFinance,
getFinanceByFarm,
deleteTransaction,
getTransactions,
getFinancialSummary,
} = require("../Controllers/finance.controller.js");
const { checkAuthenticated } = require("../Middlewares/authentication.js");
const router = express.Router();
// Routes for finance management
router.post("/", checkAuthenticated, createFinance); // Create a new finance record
router.get("/:farmId", checkAuthenticated, getFinanceByFarm); // Get all finance records
router.get("/transactions/:financeId", checkAuthenticated, getTransactions); // Get a finance record by ID
router.get("/summary/:financeId", checkAuthenticated, getFinancialSummary); //
router.delete("/:financeId", checkAuthenticated, deleteTransaction); // Delete a finance record
// Add transactions (Expense/Revenue) to a finance record
router.post("/:financeId/transaction", checkAuthenticated, addTransaction);
module.exports = router;
-25
View File
@@ -1,25 +0,0 @@
const { checkAuthenticated } = require("../Middlewares/authentication.js");
const express = require("express");
const {
createTask,
getTasksByFarm,
getTaskById,
updateTask,
deleteTask,
updateTaskStatus,
} = require("../Controllers/task.controller.js");
const router = express.Router();
// Routes for task management
router.post("/", checkAuthenticated, createTask); // Create a new task
router.get("/farm/:farmId", checkAuthenticated, getTasksByFarm); // Get all tasks for a specific farm
router.get("/:taskId", checkAuthenticated, getTaskById); // Get a task by ID
router.put("/:taskId", checkAuthenticated, updateTask); // Update task details
router.delete("/:taskId", checkAuthenticated, deleteTask); // Delete a task
// Update task status (Pending → Completed)
router.patch("/:taskId/status", checkAuthenticated, updateTaskStatus);
module.exports = router;
-52
View File
@@ -1,52 +0,0 @@
const express = require("express");
const {
registerUser,
loginUser,
logoutUser,
updateUserDetails,
forgetPassword,
resetPassword,
getUserDetails,
updatePassword,
updatePersonalDetails,
DeleteUser,
updateUserRole,
intializeUser,
updateAvatar,
} = require("../Controllers/user.controller.js");
const { checkAuthenticated } = require("../Middlewares/authentication.js");
const upload = require("../Middlewares/multer.js");
const router = express.Router();
router.route("/register").post(registerUser);
router.route("/login").post(loginUser);
router.route("/password/forgot").post(forgetPassword);
router.route("/password/reset/:token").put(resetPassword);
router.route("/logout").get(logoutUser);
router.route("/update/:id").put(updateUserDetails);
router.route("/me").get(checkAuthenticated, getUserDetails);
router.route("/getuser").get(intializeUser);
router.route("/password/update").put(updatePassword);
router.route("/me/update").put(updatePersonalDetails);
router.route("/user/delete/:id").delete(DeleteUser);
router.route("/user/updateRole/:id").put(updateUserRole);
router
.route("/user/avatar")
.put(checkAuthenticated, upload.single("avatar"), updateAvatar);
module.exports = router;