Skip to content

ToaaMahmoud/Isalny-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💭 Isalny Backend API

Status ITI

Note: This project was developed during my journey in the ITI Training Program. It represents a key milestone in mastering backend development skills, clean architecture & design, AI integration, and production-ready practices.

Isalny Backend is a RESTful API built with Express and TypeScript. It provides secure authentication, service provider management, rating & review flows, and AI-powered assistance — all wired to MongoDB with a structured module-based architecture.


🚀 Key Features

Authentication & Authorization

  • Email/password registration & login with JWT access/refresh tokens
  • Protected routes with role-based access (e.g. admin vs normal users)
  • Password recovery flow: OTP-based forget & reset password endpoints
  • Session management using express-session and connect-mongo

User Management

  • Typed DTOs and validation using class-validator / class-transformer
  • User profile and accounts stored in MongoDB via Mongoose models
  • Extended types for Express to carry authenticated user info (userId, roles, etc.)

Services Module

  • Full CRUD for services (create, read, update, delete)
  • Search & filtering with pagination (query-based search for services)
  • Bulk create endpoint for inserting multiple services at once
  • File uploads (e.g. service images) via multer and multer-storage-cloudinary with Cloudinary integration

Ratings & Reviews

  • Users can create or update ratings for services
  • Fetch all ratings for a service with pagination
  • Get all ratings for a specific user and a single user's rating for a given service
  • Delete ratings securely with ownership checks

AI Assistant Module

  • General AI chat endpoint to generate a response from a text prompt
  • Chat about a specific service: AI uses service context to answer user questions
  • Find nearest location: Uses AI output (chatContext) plus coordinates to determine the nearest relevant location
  • Integrates with providers like Google Generative AI, Groq, and Replicate

Security & Hardening

  • helmet for secure HTTP headers
  • cors configuration for controlled cross-origin access
  • Session storage in MongoDB with cookie expiration configuration
  • Centralized error handling middleware with a shared ApiError utility
  • Rate limiting support via express-rate-limit

🛠️ Tech Stack

Category Technologies
Runtime & Language Node.js (CommonJS), TypeScript
Core Framework Express 5
Database & ORM MongoDB, Mongoose
Auth & Security JWT, bcrypt, Passport, passport-google-oauth20, express-session, connect-mongo, helmet, cors, express-rate-limit
File & Media multer, multer-storage-cloudinary, Cloudinary
Email nodemailer
AI & External APIs @google/genai, @google/generative-ai, groq-sdk, replicate, axios
Tooling typescript, ts-node-dev, nodemon

📂 API Modules Overview

/api/v1/auth

  • Register, login, and protected route access
  • OTP-based forget/reset password
  • Refresh token flow
  • Update password, validate OTP

/api/v1/user

  • User-related operations (profiles, related resources)

/api/v1/services

  • Create single or multiple services (with optional media)
  • List services with pagination and filters
  • Search services
  • Get service by ID, update, and delete

/api/v1/ratings

  • Create or update a rating for a service
  • List all ratings for a service (paginated)
  • Get ratings for a specific user
  • Get/delete a specific rating with proper permissions

/api/v1/ai

  • General prompt → AI response
  • Chat about a specific serviceId
  • Find nearest location based on chatContext + coordinates

🌐 Live Demo

Explore the live web platform and see the full user flow in action:

🔗 Web Platform

Backend Team

This Backend application was developed by:

About

A platform that connects people with the services they need — powered by AI to help users find the right provider, in the right place, at the right time.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors