Skip to content

Tetra4ge/First_Contact

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

First Contact

First Contact is a sovereign, offline-first mesh communication protocol built for environments where traditional internet infrastructure is unavailable, untrustworthy, or actively compromised. Whether in disaster zones, remote deployments, or high-security facilities, First Contact allows teams to coordinate securely and efficiently without relying on centralized servers or cloud infrastructure.

Tech Stack

React Node.js Express.js CouchDB PouchDB WebSocket Bonjour Docker Vite Tailwind CSS

Screenshots

Landing Page - Top Landing Page - Setup Chat Interface

Features & Usage

First Contact creates a local mesh network. Devices connect directly to each other over local Wi-Fi or LAN. The network handles discovery, database synchronization, and peer connectivity automatically.

There are three ways to connect to the mesh:

  1. Mobile Deployment (QR Code): For mobile devices. Scan the tactical barcode on a host node to instantly access the web client and connect directly to the server.
  2. Terminal Deployment (URL): For laptops and tablets without a camera. Enter the secure mDNS frequency (e.g., http://hostname.local:5173) into a web browser to connect to a host node's server.
  3. Server Node (Mesh): For true decentralization, run the full backend stack on another computer on the same network. The Bonjour service will automatically discover peers and set up a continuous, bidirectional CouchDB replication mesh on port 5984.

Environment Configuration (.env Example)

You will need to configure environment variables for both the frontend and backend.

Frontend (.env):

VITE_COUCHDB_USER=admin
VITE_COUCHDB_PASSWORD=password
VITE_COUCHDB_PORT=5984

Backend (.env):

COUCHDB_URL=http://admin:password@localhost:5984
PORT=5000

How to Run the Project

1. Database (Docker)

Ensure Docker is installed and running on your machine. Start the CouchDB container:

docker-compose up -d

2. Backend

Navigate to the backend directory, install dependencies, and start the development server:

cd backend
npm install
npm run dev

3. Frontend

Open a new terminal, navigate to the frontend directory, install dependencies, and start the development server:

cd frontend
npm install
npm run dev

The client will be available at http://localhost:5173.

Folder Structure

First_Contact/
├── backend/
│   ├── config/          # Database and Mesh Service configurations
│   ├── routes/          # API endpoints
│   ├── sockets/         # Real-time WebSocket handlers
│   ├── server.js        # Main Express server
│   ├── package.json     # Node.js dependencies
│   └── .env             # Backend environment variables
├── frontend/
│   ├── src/             # React application source code
│   │   ├── components/  # Reusable UI components
│   │   ├── pages/       # Application views (Setup, Chat)
│   │   ├── services/    # Socket and user state services
│   │   └── App.tsx      # Main application entry point
│   ├── public/          # Static assets (fonts, icons)
│   ├── package.json     # Frontend dependencies
│   └── .env             # Frontend environment variables
├── images/              # Example screenshots
├── docs/                # Architecture documentation
├── docker-compose.yml   # CouchDB deployment configuration
├── local.ini            # CouchDB configuration overrides
└── README.md            # Project documentation

Built by team TetraFourge

About

Build for Build.IT '26 | Software Track: First Contact

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages