Welcome to the backend of the Smishing Detection project — a mobile security solution designed to combat SMS phishing (smishing) attacks. This repository powers the server-side logic, including user management, database interactions, middleware, and third-party service integrations.
smishing-backend/
├── .husky/ # Git pre-commit hooks
|
├── docs/ # API documentation
| └── research/ # Research papers
| └── technical/ # Architectural diagrams, API documentation etc.
|
├── machine-learning/ # Machine Learning & AI (TO-DO: Move to seperate repo)
| ├── datasets/ # CSV, parquet files (training data, test sets)
| ├── notebooks/ # Jupyter notebooks (Model training, evaluation)
| └── projects/ # Partially complete/completed student projects
|
├── src/
│ ├── configs/ # MongoDB connection, environment config
│ ├── controllers/ # Functions handling request logic for user routes
│ ├── middlewares/ # Auth checks, logging, or other Express middleware
│ ├── models/ # Mongoose schema/models (e.g., user, post, etc.)
│ ├── routes/ # Express route definitions (e.g. /users, /login)
│ ├── services/ # Business logic, 3rd-party integrations (e.g., code for sending emails, external APIs)
│ ├── utils/ # Utility/helper functions (e.g., JWT generation, password hashing, etc.)
│ └── index.js # Entry point, Express app setup, registering routes/middleware
│
├── tests/ # Unit/integration tests (Jest/Mocha, etc.)
│
├── .env # Environment variables (DB URI, secrets) - NOT committed
├── .env.example # Example .env
├── .gitattributes
├── .gitignore
├── .prettierrc # Prettier config file
├── CONTRIBUTING.md
├── package-lock.json
├── package.json
├── README.md
└── Dockerfile # (TO-DO) Docker setup for containerizing backend to host in GCP
- Node.js 22+
- MongoDB or MongoDB Atlas
git clone https://github.com/your-username/smishing-backend.git
cd smishing-backendnpm installCreate a .env file using the provided .env.example template:
cp .env.example .envFill in required values:
MONGO_URI=<your_mongodb_connection_string>PORT(optional, default3000)EMAIL_USER=<your_email_address>EMAIL_PASS=<your_app_password>(generate here)JWT_SECRET=(optional, defaultmysecret)OTP_EXPIRY_MINUTES=(optional, default10)OTP_LENGTH=(optional, default6)OTP_LIMIT=(optional, default5)OTP_LOCKOUT_TIME=(optional, default10 * 60 * 1000)
npm run devThis launches the backend with nodemon on http://localhost:3000.
| Command | Description |
|---|---|
npm run dev |
Start in development mode |
npm run test |
Run tests |
npm run format |
Run code formatter (Prettier) |
Please refer to the contributing guide for more details