A robust Node.js RESTful API server powering the Kinship platform π
- Overview
- β¨ Features
- π οΈ Technology Stack
- π Getting Started
- π API Documentation
- ποΈ Project Structure
- βοΈ Environment Variables
- π€ Contributing
- π License
- π Support & Contact
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.
- JWT-based Authentication with Passport.js
- Role-based Authorization system
- Email Verification with OTP
- Password Reset functionality
- Social Login integration (Google, Apple)
- 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
- 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 Forums with topics
- Post Creation with media support
- Like & Comment system
- Community Joining/Leaving
- Content Moderation tools
- Event Creation with details
- Event Scheduling with reminders
- RSVP System (Yes/No/Maybe)
- Upcoming Events listing
- Event Notifications via push
- Push Notifications via Firebase FCM
- Email Notifications via SendGrid
- In-app Notifications system
- Customizable Notification preferences
- Input Validation with Joi schemas
- Data Encryption for sensitive information
- Rate Limiting protection
- CORS Configuration for security
- Error Handling middleware
- Background Jobs with node-cron
- Database Optimization with Mongoose
- Caching Strategies implementation
- API Documentation with Swagger UI
| 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+ |
| Nodemailer + SendGrid | Latest | |
| Documentation | Swagger UI | 4.1+ |
| Process Manager | PM2 | Latest |
| Development | Nodemon + Babel | Latest |
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
-
Clone the repository
git clone https://github.com/skyroomdev/Kinship-Backend.git cd Kinship-Backend -
Install dependencies
npm install
-
Configure environment variables
# Create .env file in root directory cp .env.example .env # if example exists nano .env
-
Start the development server
# Development mode with hot reload npm run start # Production mode with PM2 npm run start:dev
-
Verify installation
- Server should start on
http://localhost:8001 - API docs available at
http://localhost:8001/api/documentation
- Server should start on
Once the server is running, access the comprehensive API documentation:
π Swagger UI: http://localhost:8001/api/documentation
| 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 |
All protected endpoints require a Bearer token in the Authorization header:
Authorization: Bearer <your-jwt-token>
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
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/certsWe welcome contributions from the community! Here's how you can help:
- Use the GitHub Issues page
- Provide detailed information about the bug
- Include steps to reproduce the issue
- Open a new issue with the "enhancement" label
- Describe the feature and its benefits
- Discuss implementation details
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow the existing code style
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting
This project is licensed under the ISC License - see the LICENSE file for details.
- GitHub Issues: Report bugs or request features
- Documentation: Check the API Documentation
| Contact Method | Icon | Details |
|---|---|---|
| π§ Development Team | skyroomdev1@gmail.com | |
| π± Telegram Support | @skyroom07 | |
| π Bug Reports | GitHub Issues |
- Repository: GitHub
- Issues: GitHub Issues
- Pull Requests: GitHub PRs