MERN Stack Project
Mongodb
React.js
Node.js
Express.js
Cloudinary
As we discussed @MariemAbdi, UI/UX is a big pilar of front-end development. Your website, although fully functional, could benefit a lot from a refactoring of the User Interface. Ergonomic websites could help us look more professional and friendly and get more customers easily.
Here are a few things that you could start with:
In your current code, any user of the platform can directly call any API with his Bearer Token and do things he is not supposed to do. For example, normal clients can create, delete, and update products.
To solve this, you should implement an authorization
middleware in your Express app.
The middleware is just a function that you can pass to the route
before the request handler and it should:
admin
. Return an error response in case the user is not an admin.role
attribute to your users. And create a function like this:const authorize = (role) => (req, res, next) => {
// calls next() if user has required role
// returns error response if the user does not have the required role
}
And then call it this way
router.post("/products", authorize("admin"), createProduct)
In the API calls from the frontend, you'll have to make sure you send the Bearer Tokens in the requests.
For more on Express middlewares, take a look at this article.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.