Built with
- Node.js
- Express.js
- PostgreSQL
Libraries/Packages Used
- dotenv - Used to hide secret token key for the generation of JSON Web Tokens.
- pg - Non-blocking PostgreSQL client for Node.js.
- cors - Express middleware.
- jsonwebtoken - For the generation, and verification of tokens for new users.
DATABASE NAME: khabardabar
DATABASE TABLES: users and menuitems
RESTFUL APIs - User Registration (Signup and Login)
- A POST API is used for signing up a new user.
- A POST API is used for logging in a new user.
- A GET API is used for verifying the token of a user when the browser is refreshed.
RESTFUL APIs - Menupage (Private Route)
- A GET API is used to verify the token of a user while visiting the private route.
- A POST API is used to insert/add information of a menu item into the menuitems database.
- A GET API is used to read information of all menu items from the menuitems database.
MIDDLEWARES
- A middleware is used to check the validity and existence of all credentials while performing any sort of user registration (signup or login).
- A middleware is used to verify the token of a new user before visiting the private route.
Built With
- ReactJS.
- Vanilla CSS.
Libraries/Packages Used
- React-Router-DOM - Used for navigating to different routes.
- Tanstack Query (React Query) - Used to fetch data from API.
- React-Hot-Toast - Used to notify users after a certain action is performed.
- React-Hook-Forms - Used for signup and login forms.
AUTHENTICATION
- POST API from the server is used to insert new user information into the database.
FEATURES
- A user can sign up for a new account with name, email and password.
- A user can login to their existing account using email and password.
- A user can view all menu items only after being authenticated. The menupage is a private route.
- An authenticated user can add items to the cart. The cart can have multiple menu items.
- An authenticated user can place an order.
- When an authenticated user places an order, the order summary/reciept is shown right below the cart.
- The total price of all added items is calculated and shown in the cart and the order summary.