Pristine Xylem is a React Native application designed to assess the quality of water images by using a machine learning model to classify them as clean or unclean. It also provides user authentication functionality with MongoDB and JWT.
- User Registration and Login: Secure user registration and login functionality 🔐.
- Machine Learning Model: Classifies images of water as clean or unclean 💧.
- REST API: Provides endpoints for user authentication and data retrieval 📡.
- Deployment: The backend is deployed on Render for accessibility 🌐.
- Node.js: JavaScript runtime used for the backend 🟩.
- Express.js: Web framework for Node.js 🚂.
- MongoDB: NoSQL database for storing user data 📚.
- Mongoose: ODM (Object Data Modeling) library for MongoDB 🏗️.
- Bcrypt.js: Library for hashing passwords 🔒.
- JWT (JSON Web Token): For secure user authentication 🎟️.
- Render: Platform used for deploying the backend 🚀.
To set up the backend locally, follow these steps:
-
Clone the repository:
git clone https://github.com/owaismohammad/Pristine-Xylem.git cd Pristine-Xylem
-
Install dependencies:
npm install
-
Configuration:
Update the
mongoUrl
andJWT_SECRET
in theserver.js
file with your MongoDB connection string and JWT secret key 🔑. -
Run the server:
npm start
The server will start on port
5001
🌟.
- GET /: Returns a status message indicating the server is running 🟢.
- POST /register: Registers a new user. Requires
name
,email
,mobile
, andpassword
in the request body 📝. - POST /login-user: Authenticates a user. Requires
email
andpassword
in the request body 🔑. - POST /userdata: Retrieves user data. Requires a JWT token in the request body 🔍.
This project uses the following dependencies:
express
: ^4.17.3mongoose
: ^6.0.12cors
: ^2.8.5jsonwebtoken
: ^8.5.1multer
: ^1.4.3bcryptjs
: ^2.4.3
- Ensure that your JWT secret key (
JWT_SECRET
) is kept confidential and not exposed in public repositories 🔒. - Regularly update dependencies to mitigate security vulnerabilities 🔄.
This project is licensed under the MIT License 📜.
For any questions or feedback, please reach out to owaismohammad 📧.
Feel free to contribute to this project or provide feedback. Your input is valuable! 🌟