Deployment-Link : https://sas-slim-and-fit.onrender.com
SAS Fit To Slim is a web application built using Node.js, Express.js, MongoDB, and Auth0 for user authentication. It includes features such as user registration, login, profile management, admin dashboard, and sending messages via WhatsApp using Twilio.
- Checks if the user is authenticated using Auth0 (
req.oidc.isAuthenticated()
). - Renders the "once.ejs" view if the user is not authenticated.
- Retrieves user data from MongoDB and renders the "homepage.ejs" view if the user is authenticated.
- Accessible only after authentication.
- Renders the "aftersignup.ejs" view for additional user details input also will render if the user after signup has not fill the details.
- Accessible after authentication.
- Renders the "editDetails.ejs" view for editing user details.
- Handles form submission for user details.
- Creates a new user document in MongoDB and redirects to the home page.
- Handles form submission for updating user details.
- Updates user details in MongoDB based on the provided data.
- Requires admin authentication.
- Calculates statistics (BMI ranges, age groups) based on user data and renders the "index.ejs" view.
- Renders the user's profile page with profile data.
- Handles user deletion based on user ID.
- Renders the "adminedit.ejs" view for editing user data as an admin.
- Handles form submission for updating user details by admin.
- Sends WhatsApp messages to all users available in the users collection.
- Calculates unique visitors per month based on admin's specified time.
- User authentication using Auth0.
- CRUD operations for user management.
- BMI calculation for users.
- Admin dashboard with statistics (BMI ranges, age groups, average BMI, total logins).
- WhatsApp messaging functionality using Twilio.