Ok, I don't know if I'm ready or not to fly alone... Maybe I won't be able to ever finish this project but I don't care !
Here I am, in front of this empty directory with nobody to help me (except the good old friend Google).
I'm not diving into something I have no chance to complete here.
The idea is really simple, it is going to be a simple app where you can authenticate and sell products. Registered people can add some information about them and have access to their orders. Finally, registered user can also send an order to buy any product available.
-Add/delete a product.
-Order a product.
-Access to orders.
The frontend part will be written in React.Js, I think the context API will be enough to manage my app state.
There will be 4 pages :
-(/auth) sign up and login.
-(/profile/products) manage products.
-(/profile/orders) manage orders.
-(/) browse products.
The backend is a Rest API built with Node/Express and I'm using MongoDB for storing data.
My API endpoints :
-(GET)(api/products) send all products.
-(GET)(api/products/:userId) send products for current user.
-(POST)(api/products) add a product.
-(DELETE)(api/products/:pid) delete a product.
-(POST)(api/users/signup) sign up.
-(GET)(api/orders/:uid) send user orders.
-(POST)(api/orders) add new order.
-Brand new React project made with
-Most of my components state is managed by react hooks, so far it works fine for getting/adding/deleting products.
-Just finished a Modal component which include a backdrop. They are both rendered with ReactDOM.createPortal();
-From now, I can use my Form component to send data to my backend, I'm still missing input validation though...
-After surfing on the internet for a little while I did manage to implement React context in my app to manage user authentication state.
-Let's start with my app.js file.
-I'm installing Express, BodyParser, nodemon, cors and Mongoose.
-Serious work starts now, I am building my controllers and testing my endpoints with Postman
-Testing my error handling middleware.
-Products and Users routes looks good.
-Thanks to axios, I can start fetching dummy data from my backend to make sure everything is working fine.
-Authentication seems to work, I'm trying to send back token with JWT from my backend to the frontend and store it somewhere.
-Added a middleware to check if user's token is real and protect routes that require the user to be authenticated.
-Pushed backend to heroku with CLI (I am always so surprised how fast and easy it is).
-Configuring environment variables and testing all routes.
No matter how buggy and dummy is this app, I enjoyed myself so much working on it! I am also really proud that I could implement all features I wanted.
I could spend time improving UX, fixing layout bugs and adding feature (damn, there is still no input validation at all) but I can't wait to start another project and try something new such as Material-UI.
Once again, every tip to improve my way of coding or writing is more than welcome 😇
Thank you for reading !