Skip to content

Kinship Backend is a scalable Node.js RESTful API for parenting and social communities, featuring secure authentication, real-time chat, group management, community forums, event scheduling, notifications, and more. Built with Express, MongoDB, Socket.io, and JWT, it powers modern social platforms with robust, modular, and production-ready code.

Notifications You must be signed in to change notification settings

skyroom07/Kinship-Backend

Repository files navigation

🏠 Kinship Backend

Node.js Express.js MongoDB License PRs Welcome

A robust Node.js RESTful API server powering the Kinship platform πŸš€


πŸ“‹ Table of Contents


🌟 Overview

Kinship Backend is a powerful and scalable Node.js RESTful API server designed to power the Kinship platformβ€”a comprehensive social and support network for parents, caregivers, and communities.

This backend provides a complete ecosystem including:

  • πŸ” Secure Authentication & Authorization
  • πŸ’¬ Real-time Chat & Messaging
  • πŸ‘₯ Smart Group Management
  • 🏘️ Community Forums & Topics
  • πŸ“… Event Creation & Scheduling
  • πŸ”” Push Notifications
  • πŸ“Š Admin Dashboard

Built with scalability, security, and performance in mind, it leverages modern technologies to deliver a seamless experience for both web and mobile clients.


✨ Features

πŸ” Authentication & Security

  • JWT-based Authentication with Passport.js
  • Role-based Authorization system
  • Email Verification with OTP
  • Password Reset functionality
  • Social Login integration (Google, Apple)

πŸ‘₯ User & Group Management

  • Profile Management with detailed user information
  • Smart Group Matching based on kinship reasons
  • Group Creation with minimum member requirements
  • User Blocking/Unblocking system
  • Profile Completion tracking

πŸ’¬ Real-time Communication

  • Socket.io Integration for real-time messaging
  • Group Chat functionality
  • Private Messaging between users
  • File & Media Sharing support
  • Message Search capabilities
  • Read Receipts and typing indicators

🏘️ Community Features

  • Community Forums with topics
  • Post Creation with media support
  • Like & Comment system
  • Community Joining/Leaving
  • Content Moderation tools

πŸ“… Event Management

  • Event Creation with details
  • Event Scheduling with reminders
  • RSVP System (Yes/No/Maybe)
  • Upcoming Events listing
  • Event Notifications via push

πŸ”” Notifications

  • Push Notifications via Firebase FCM
  • Email Notifications via SendGrid
  • In-app Notifications system
  • Customizable Notification preferences

πŸ›‘οΈ Security & Validation

  • Input Validation with Joi schemas
  • Data Encryption for sensitive information
  • Rate Limiting protection
  • CORS Configuration for security
  • Error Handling middleware

⚑ Performance & Monitoring

  • Background Jobs with node-cron
  • Database Optimization with Mongoose
  • Caching Strategies implementation
  • API Documentation with Swagger UI

πŸ› οΈ Technology Stack

Category Technology Version
Runtime Node.js 18+
Framework Express.js 4.17+
Database MongoDB 6.8+
ODM Mongoose 6.8+
Real-time Socket.io 4.7+
Authentication Passport.js + JWT Latest
Validation Joi 17.4+
Notifications Firebase Admin SDK 11.8+
Email Nodemailer + SendGrid Latest
Documentation Swagger UI 4.1+
Process Manager PM2 Latest
Development Nodemon + Babel Latest

πŸš€ Getting Started

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18 or higher)
  • npm or yarn package manager
  • MongoDB instance (local or cloud)
  • Git for version control

πŸ› οΈ Installation

  1. Clone the repository

    git clone https://github.com/skyroomdev/Kinship-Backend.git
    cd Kinship-Backend
  2. Install dependencies

    npm install
  3. Configure environment variables

    # Create .env file in root directory
    cp .env.example .env  # if example exists
    nano .env
  4. Start the development server

    # Development mode with hot reload
    npm run start
    
    # Production mode with PM2
    npm run start:dev
  5. Verify installation

    • Server should start on http://localhost:8001
    • API docs available at http://localhost:8001/api/documentation

πŸ“š API Documentation

πŸ” Interactive API Docs

Once the server is running, access the comprehensive API documentation:

🌐 Swagger UI: http://localhost:8001/api/documentation

πŸ“– API Endpoints Overview

Module Base Path Description
Authentication /api/v1/auth Login, register, OTP verification
Users /api/v1/user Profile management, settings
Groups /api/v1/group Group creation and management
Chat /api/v1/chat Real-time messaging
Events /api/v1/event Event creation and management
Community /api/v1/community Forums and posts
Comments /api/v1/comment Comment system
Notifications /api/v1/notification Push notifications

πŸ” Authentication

All protected endpoints require a Bearer token in the Authorization header:

Authorization: Bearer <your-jwt-token>

πŸ—οΈ Project Structure

kinship-backend-development/
β”œβ”€β”€ πŸ“ app.js                 # Main application entry point
β”œβ”€β”€ πŸ“ package.json           # Dependencies and scripts
β”œβ”€β”€ πŸ“ swagger.yaml           # OpenAPI specification
β”œβ”€β”€ πŸ“ .babelrc              # Babel configuration
β”œβ”€β”€ πŸ“ nodemon.json          # Nodemon configuration
β”‚
β”œβ”€β”€ πŸ“ src/                   # Source code
β”‚   β”œβ”€β”€ πŸ“ auth/             # Authentication module
β”‚   β”œβ”€β”€ πŸ“ user/             # User management
β”‚   β”œβ”€β”€ πŸ“ group/            # Group functionality
β”‚   β”œβ”€β”€ πŸ“ chat/             # Real-time chat
β”‚   β”œβ”€β”€ πŸ“ events/           # Event management
β”‚   β”œβ”€β”€ πŸ“ community/        # Community features
β”‚   β”œβ”€β”€ πŸ“ comments/         # Comment system
β”‚   β”œβ”€β”€ πŸ“ notification/     # Push notifications
β”‚   β”œβ”€β”€ πŸ“ admin/            # Admin dashboard
β”‚   └── πŸ“ common/           # Shared utilities
β”‚
β”œβ”€β”€ πŸ“ model/                # Mongoose models
β”œβ”€β”€ πŸ“ routes/               # API route definitions
β”œβ”€β”€ πŸ“ public/               # Static assets
β”œβ”€β”€ πŸ“ views/                # EJS templates
└── πŸ“ seeder/               # Database seed scripts

βš™οΈ Environment Variables

Create a .env file in the root directory with the following variables:

# Server Configuration
PORT=8001
NODE_ENV=development
BASE_URL=http://localhost:8001

# Database
DB_MONGO_URL=mongodb://localhost:27017/kinship

# Authentication
JWT_SECRET=your-super-secret-jwt-key
AES_ENC_KEY=your-aes-encryption-key
AES_IV=your-aes-iv-key

# Firebase (Push Notifications)
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_PRIVATE_KEY=your-private-key
FIREBASE_CLIENT_EMAIL=your-client-email

# Email (SendGrid)
SENDGRID_API_KEY=your-sendgrid-api-key
MAIL_FROM=dev@findkinship.com

# CORS
ALLOW_ORIGIN=http://localhost:3000

# SSL (Production)
IS_SECURE=false
SSL_CERT_BASE_PATH=/path/to/ssl/certs

🀝 Contributing

We welcome contributions from the community! Here's how you can help:

πŸ› Reporting Bugs

  • Use the GitHub Issues page
  • Provide detailed information about the bug
  • Include steps to reproduce the issue

πŸ’‘ Suggesting Features

  • Open a new issue with the "enhancement" label
  • Describe the feature and its benefits
  • Discuss implementation details

πŸ”§ Pull Requests

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“‹ Development Guidelines

  • Follow the existing code style
  • Add tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting

πŸ“„ License

This project is licensed under the ISC License - see the LICENSE file for details.


πŸ“ž Support & Contact

πŸ†˜ Getting Help

Contact Method Icon Details
πŸ“§ Development Team Gmail skyroomdev1@gmail.com
πŸ“± Telegram Support Telegram @skyroom07
πŸ› Bug Reports GitHub GitHub Issues

🌐 Links


Made with ❀️ by the Kinship Team

GitHub stars GitHub forks

About

Kinship Backend is a scalable Node.js RESTful API for parenting and social communities, featuring secure authentication, real-time chat, group management, community forums, event scheduling, notifications, and more. Built with Express, MongoDB, Socket.io, and JWT, it powers modern social platforms with robust, modular, and production-ready code.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published