Welcome to Connect, a revolutionary platform that redefines social media by giving users full control over their data. Our goal is to empower users and provide a secure, privacy-centric platform. We prioritize data protection while providing an exceptional digital experience.
The platform is divided into three branches:
- Personal
- Professional
- Educational
Users can customize their experience across these categories and control what content is visible in each branch.
- Introduction
- Getting Started
- Version Control
- Security
- Content Analysis and Moderation
- Social Networking Algorithm
- Messaging
CONNECT
│
├── client
│ ├── build
│ ├── node_modules
│ ├── public
│ ├── src
│ ├── types
│ ├── .gitignore
│ ├── package-lock.json
│ ├── package.json
│ ├── tsconfig.json
│ └── Documentations
│
├── server
│ ├── dist
│ ├── node_modules
│ ├── src
│ ├── types
│ ├── .gitignore
│ ├── package-lock.json
│ ├── package.json
│ └── tsconfig.json
│
├── UML
├── .env
└── connect_documentation.md
-
Navigate to the
clientdirectory:cd client -
Install the required dependencies:
npm install
-
Start the React server:
npm start
You can now view Connect in the browser at http://localhost:3000.
Note: The development build is not optimized. Use npm run build to create a production build.
-
Navigate to the
serverdirectory:cd server -
Install the required dependencies:
npm install
-
Compile the TypeScript files:
cd src npx tscThis creates
.jsexecutables inside thedistdirectory. -
Start the server:
cd .. node dist/server.jsThe server will run on http://localhost:8000.
We use MongoDB as the database for Connect.
-
Download MongoDB Compass from here.
-
Connect to the database using the following connection string:
mongodb+srv://kamrulhassan:fNXADjxipNKubPlP@connect.ny9wvom.mongodb.net/
Note: Do not share the connection string with anyone.
Make sure you are in the root directory before running these commands.
-
Add your changes:
git add . -
Commit your changes:
git commit -m "your message" -
Push to your branch:
git push origin <your_branch>
-
To check your current branch:
git branch
- Always push to your respective branch first. Collaborate with your teammates through pull requests.
- Kamrul and Zoheb are the only ones who can push from the
TestBranchtomain.
- Go to GitHub Pull Requests.
- Click on New pull request.
- Choose the branch you want to merge from and into.
We use the Signal Protocol to ensure secure messaging and profile content protection in Connect.
- Key Generation: Each user generates a unique identity key pair during registration, which consists of identity keys and pre-keys.
- Double Ratchet Algorithm: Ensures that each message is encrypted with a unique key, offering forward secrecy.
Key Generation:
import { generateIdentityKeyPair, generatePreKeyBundle } from '@signalapp/libsignal-client';
const generateKeys = async () => {
const identityKeyPair = await generateIdentityKeyPair();
const preKeyBundle = await generatePreKeyBundle(identityKeyPair);
return { identityKeyPair, preKeyBundle };
};Session Setup:
import { SignalProtocolAddress, SessionBuilder, PreKeyBundle } from '@signalapp/libsignal-client';
const setupSession = async (store, address, preKeyBundle: PreKeyBundle) => {
const sessionBuilder = new SessionBuilder(store, address);
await sessionBuilder.processPreKey(preKeyBundle);
};Message Encryption & Decryption:
import { SessionCipher } from '@signalapp/libsignal-client';
const encryptMessage = async (store, address, message) => {
const sessionCipher = new SessionCipher(store, address);
const ciphertext = await sessionCipher.encrypt(message);
return ciphertext;
};
const decryptMessage = async (store, address, ciphertext) => {
const sessionCipher = new SessionCipher(store, address);
const plaintext = await sessionCipher.decryptPreKeyWhisperMessage(ciphertext.body, 'binary');
return plaintext;
};- Profile Content Protection: Each user's profile content (photos, videos, text) is encrypted with a unique symmetric key (AES).
- The symmetric key is then encrypted using the recipient's public key (ECC).
Profile Encryption in TypeScript:
import { randomBytes, createCipheriv } from 'crypto';
// Generate AES key for content encryption
const generateSenderKey = () => {
return randomBytes(32); // 256-bit AES key
};
// Encrypt content using the sender's key
const encryptContent = (content: Buffer, senderKey: Buffer) => {
const iv = randomBytes(16); // Random initialization vector (IV) for AES
const cipher = createCipheriv('aes-256-cbc', senderKey, iv);
const encryptedContent = Buffer.concat([cipher.update(content), cipher.final()]);
return { encryptedContent, iv };
};
// Example content to encrypt
const videoContent = Buffer.from('Example video content');
// Generate the key and encrypt the content
const senderKey = generateSenderKey();
const { encryptedContent, iv } = encryptContent(videoContent, senderKey);Encrypting the Sender Key with Session Keys:
import { SessionCipher } from '@signalapp/libsignal-client';
// Encrypt sender key using session keys
const encryptSenderKey = async (store, address, senderKey) => {
const sessionCipher = new SessionCipher(store, address);
const encryptedSenderKey = await sessionCipher.encrypt(senderKey);
return encryptedSenderKey;
};
// Example usage for encrypting sender keys for multiple recipients
const encryptedSenderKeyForRecipient1 = await encryptSenderKey(store, recipient1Address, senderKey);
const encryptedSenderKeyForRecipient2 = await encryptSenderKey(store, recipient2Address, senderKey);
// Store the encrypted content and keys on the server
await uploadEncryptedContentToServer({
encryptedContent,
iv,
encryptedKeys: {
recipient1: encryptedSenderKeyForRecipient1,
recipient2: encryptedSenderKeyForRecipient2,
},
});We use multi-label classification for tagging content, leveraging models like TensorFlow Lite and PyTorch Mobile.
- Text, Images, Videos: The system supports analyzing text, multiple images, and video posts.
- Pre-trained models are fine-tuned for optimal performance across mobile and web platforms.
We are implementing a social networking algorithm to enhance user interaction and content recommendation.
Messaging on Connect is fully end-to-end encrypted using the Signal Protocol. This ensures private and secure communication between users.
For more details and further technical documentation, please refer to connect_documentation.md.
Connect LLC © 2024