A secure family-oriented application backend for managing family connections, communications, and media sharing with end-to-end encryption.
APIhub Legacy is a Node.js backend service that provides secure family management functionality, including user authentication, family creation, and encrypted communication between family members. The application uses the Signal Protocol for end-to-end encrypted messaging.
-
User Management
- Member registration and authentication
- Head of Family (HOF) registration and authentication
- Email verification with OTP
- Profile management
-
Family Management
- Create and manage family units
- Add and remove family members
- View family details based on user role (HOF or Member)
-
Secure Communication (work in progress)
- End-to-end encrypted messaging using the Signal Protocol
- Secure key management and registration
- Private family messaging
-
Media Sharing (Coming Soon)
- Encrypted media upload and sharing
- Family-specific media galleries
- Node.js with Express.js framework
- MongoDB database with Mongoose ODM
- JWT for authentication
- Signal Protocol (@signalapp/libsignal-client) for end-to-end encryption
- Cloudinary for media storage
- Nodemailer for email services
- Multer for file uploads
Backend/
├── public/ # Public assets
│ └── temp/ # Temporary file storage
├── src/
│ ├── app.js # Express application setup
│ ├── constants.js # Application constants
│ ├── index.js # Application entry point
│ ├── controllers/ # Request handlers
│ ├── db/ # Database configuration
│ ├── middlewares/ # Express middlewares
│ ├── models/ # MongoDB schema models
│ ├── routes/ # API routes
│ └── utils/ # Utility functions and services
│ ├── ApiError.js
│ ├── ApiResponse.js
│ ├── asyncHandler.js
│ └── services/ # Core services
│ ├── crypto/ # Encryption services
│ ├── fileUpload/
│ ├── mail/ # Email services
│ └── otp/ # OTP generation and verification
POST /legacy/api/v1/members/register-user
- Register a new family memberPOST /legacy/api/v1/members/login-user
- Member loginPOST /legacy/api/v1/members/complete-profile
- Complete member profile
POST /legacy/api/v1/hof/register
- Register as Head of FamilyPOST /legacy/api/v1/hof/entry
- HOF login
POST /legacy/api/v1/family/create
- Create a new familyPOST /legacy/api/v1/family/add-member/:userId
- Add member to familyPOST /legacy/api/v1/family/remove-member/:userId
- Remove member from familyGET /legacy/api/v1/family/total-member
- Get total member countGET /legacy/api/v1/family/get-all-members
- Get all family membersPOST /legacy/api/v1/family/view-hof
- View family as HOFPOST /legacy/api/v1/family/view-member
- View family as member
POST /legacy/api/v1/verify/send-otp
- Send verification OTPPOST /legacy/api/v1/verify/verify-otp
- Verify OTPGET /legacy/api/v1/verify/status
- Check verification status
POST /media/keys/generate
- Generate Signal Protocol keysPOST /media/keys/register
- Register Signal Protocol keysGET /media/keys/family/:familyId
- Get family Signal Protocol keysPOST /media/message/send
- Send encrypted messageGET /media/message/family/:familyId
- Get encrypted messages
- Node.js (v16 or higher)
- MongoDB (v5 or higher)
- npm or yarn
- Clone the repository
git clone https://github.com/yourusername/APIhub-Legacy.git
cd APIhub-Legacy/Backend
- Install Dependencies
npm install
npm warn deprecated (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) npm error code 1 npm error path G:\Project\APIhub-Legacy\Backend\node_modules\node-base64 npm error command failed npm error command C:\Windows\system32\cmd.exe /d /s /c ./install.sh npm error '.' is not recognized as an internal or external command, npm error operable program or batch file.
npm install --force
- Create a
.env
file in the root directory with the following variables:
PORT=3000
MONGODB_URI=mongodb://localhost:27017/apihub_legacy ACCESS_TOKEN_SECRET=your_secret_key_here
ACCESS_TOKEN_EXPIRY=1d
# Cloudinary Config
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
# Email Config
EMAIL_SERVICE=gmail
[email protected]
APP_PASSWORD=your_app_password```
4. Start th server
```bash
npm run legacy
- Password hashing with bcrypt
- JWT-based authentication
- Email verification
- Rate limiting for verification attempts
- Signal Protocol for end-to-end encryption
- Secure file handling
- CORS protection
- Input validation and sanitization
- Protection against common web vulnerabilities
- Efficient database queries
- Response caching
- Optimized file handling
- Error logging and monitoring
- Group chat functionality
- Event planning for families
- Shared calendars
- Family photo albums
- Emergency contacts and location sharing
- Cross-platform compatibility improvements
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Harsh Yadav - Initial work and maintenance
- H&V sync - Development and support.
This project is licensed under MIT licence