NodeExamProject is a web application that consists of a client and server. The client is built with Svelte and Vite, and the server is built with Node.js and Express. This project includes functionalities for user authentication, session management, XSS prevention, and a machine learning model for fruit prediction.
- User Authentication
- Session Management
- XSS Prevention
- Fruit Prediction using a Machine Learning Model
NodeExamProject-master/
├── .env.sample
├── .gitignore
├── LICENSE
├── README.md
├── request.rest
├── client/
│ ├── .gitignore
│ ├── README.md
│ ├── index.html
│ ├── jsconfig.json
│ ├── package-lock.json
│ ├── package.json
│ ├── svelte.config.js
│ ├── vite.config.js
│ ├── public/
│ │ ├── Justchattingbanner.png
│ │ ├── facebook-icon.png
│ │ ├── github-icon.png
│ │ ├── icon.png
│ │ ├── linkedin-icon.png
│ │ ├── twitter-icon.png
│ ├── src/
│ │ ├── App.svelte
│ │ ├── app.css
│ │ ├── main.js
│ │ ├── vite-env.d.ts
│ │ ├── components/
│ │ ├── routes/
│ │ ├── services/
│ │ ├── stores/
│ │ ├── util/
├── server/
│ ├── app.js
│ ├── database.db
│ ├── fruit_model.h5
│ ├── package-lock.json
│ ├── package.json
│ ├── predict.py
│ ├── train_model.py
│ ├── database/
│ ├── routers/
│ ├── util/
- Node.js
- npm
-
Clone the repository
git clone https://github.com/ErdalErdem/NodeExamProject.git cd NodeExamProject-master
-
Install server dependencies
cd server npm install
-
Install client dependencies
cd ../client npm install
-
Setup environment variables
- Copy
.env.sample
to.env
in the server directory and fill in the required values.
- Copy
Navigate to the server
directory and start the server:
cd server
nodemon app.js
Navigate to the client
directory and start the client:
cd client
npm run dev or sudo npm run dev
- POST /api/auth/register: Register a new user.
- POST /api/auth/login: Login a user.
- GET /api/session: Check user session.
- POST /api/predict: Predict the type of fruit.
- POST /api/xss: Check for XSS vulnerabilities.
The machine learning model for fruit prediction is located in server/fruit_model.h5
and is utilized by the predict.py
script.
- Fork the repository
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -m 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.