-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/admin #224
base: develop
Are you sure you want to change the base?
Feature/admin #224
Conversation
✅ Deploy Preview for scrollme-ecommerce ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hey @samriddhitiwary , |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@thakuratul2 I have resolved the conflicts |
@saurabhbakolia @thakuratul2 I have resolved the conflict, could you please review the PR |
`} | ||
</style> | ||
|
||
<div className='container mt-5'> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on the app! I'd suggest using styled-components
for more modular and maintainable styling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I am making these changes.
@@ -4,7 +4,7 @@ const authMiddleware = require('../middleware/authMiddleware'); | |||
const productController = require('../controllers/productController'); | |||
|
|||
// Route to add a new product (only for admins) | |||
router.post('/add', authMiddleware, productController.addProduct); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you can add the support to edit this, only for admins and sellers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of now, I have disabled all the auth flow. Later, we can add it in separate issue and PR?
app.use(cookieParser()); | ||
app.use(helmet()); | ||
|
||
app.use("/api/auth", authRoutes); // Authentication routes | ||
app.use("/api/cart", authMiddleware, cartRoute); // Cart routes | ||
app.use("/api/product", productRoute); // Product routes | ||
app.use("/api/user", userRoute); // user routes | ||
app.use("/api/auth", authStatusRoute); // Check Auth Status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saurabhbakolia
I am sorry, but, for time being, can we hold all Auth related flow, Its causing lots of issue in local. We can have separate issue to fix all the auth related work.
console.log(`Server running on port ${PORT}`); | ||
console.log(`API available at http://localhost:${PORT}/api/auth`); | ||
}); | ||
// const PORT = process.env.PORT || 8080; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am trying to connect the MongoDB ATLAS. It seems, existing code was not compatible with ATLAS, So when i modified, It started working. I did not try with local mongo db.
@@ -10,6 +10,10 @@ import ProtectedRoute from './utils/ProtectedRoute'; | |||
import ContributorsPage from './pages/ContributorsPage'; | |||
import { lazy, Suspense } from 'react'; | |||
import ContactUsPage from './pages/ContactUsPage'; | |||
import Admin from './components/Admin'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you installed prettier
and eslint
in your IDE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will do it. I missed it.
@@ -13,11 +13,13 @@ | |||
"@testing-library/react": "^13.4.0", | |||
"@testing-library/user-event": "^13.5.0", | |||
"axios": "^1.6.0", | |||
"bootstrap": "^5.3.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you install Bootstrap? We are using styled-components for styling and material-ui-icons for icons. Could you please stick to these for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will check, I am not using anywhere. I will remove it.
"firebase": "^10.14.0", | ||
"framer-motion": "^11.9.0", | ||
"myapp": "file:", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-hot-toast": "^2.4.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to use react-hot-toast; we're using chakra-ui, so please use their toast method instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will check and will use chakra-ui.
@@ -42,14 +46,6 @@ function App() { | |||
</Suspense> | |||
} | |||
/> | |||
<Route |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you didn't pull the latest changes. Please avoid removing code unnecessarily.
background: `linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)), url('https://images.pexels.com/photos/6984650/pexels-photo-6984650.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940') center`, | ||
backgroundSize: 'cover', | ||
backgroundAttachment: 'fixed', // Keep the background fixed during scroll | ||
minHeight: '100vh', // Ensure it covers the full height of the viewport |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unnecessary comments and logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will do it.
@saurabhbakolia Ok I will check it again |
Hey @samriddhitiwary, if you can make the required changes so that I can merge this PR. |
Admin.1.mp4
Pull Request Template
Title: Create ADMIN page to CREATE, READ, UPDATE, and DELETE Products into MongoDB using existing CRUD API
Description
Please provide a clear and concise description of what this pull request does, including any relevant details.
Related Issue
Link to the issue that this pull request addresses (if applicable). Use the format:
Fixes #165
Changes Made
This issue involves building an Admin page that allows for the Create, Read, Update, and Delete (CRUD) operations on Products stored in MongoDB. The page will interact with an existing CRUD API for product management. The page should include a form for product creation and editing, a table to display all products, and functionality to delete products.
Checklist
I have tested my code and it works as expected.
I have added/updated documentation where necessary.
I have included tests for new features.
I have followed the project's coding standards.
Checklist: