Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-elm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:

- name: Build Elm project
run: |
cd tp-frontend && elm make src/ThirdPlaceApp.elm --output=/dev/null
cd tp-frontend && elm make src/UI/Main.elm --output=/dev/null
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ attached_assets/

elm-stuff/

.gradle/
.idea/
launch.json
settings.json
build/

.amazonq/

node_modules/
dist/

# Elm/frontend files
bin/
deploy/
tpapp.js
main.js

# Relay files
tp-ipfs/
Expand Down
23 changes: 0 additions & 23 deletions .llmrc/INSTRUCTIONS.md

This file was deleted.

20 changes: 0 additions & 20 deletions .llmrc/MEMORIES.md

This file was deleted.

70 changes: 64 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,70 @@
# ThirdPlace
A free and open sourced social hangout, designed to get people talking with no pressure and no bullshit.
See the [wiki](https://github.com/ldaIas/ThirdPlace/wiki)

A decentralized social coordination app that helps people find others to join them for real-world activities, fostering authentic connections and combating social isolation.

## The Problem

Singles and small groups often want to engage in social activities (bars, coffee shops, hiking, events) but avoid going alone. Existing solutions like Meetup focus on large recurring groups, while dating apps create artificial high-pressure interactions. Many people end up staying home instead of enjoying activities they'd love to do.

## The Solution

ThirdPlace enables ad-hoc social coordination where users can:

- Propose activities ("Who wants to grab coffee at [Cafe Name] at 2pm?")
- Join others' activity proposals in their local area
- Form small, intimate groups (1-on-1 to small groups of 3-4)
- Connect in low-pressure, activity-focused settings
- Meet people in their actual community/geographic area

## Key Features

- **Activity-focused**: Organize around specific venues and times, not abstract socializing
- **Geographic filtering**: Only see and connect with people in your local community
- **Ephemeral posts**: Activities expire after their event time to keep content fresh
- **Gender balancing**: Optional balanced group formation for more natural social dynamics
- **Direct messaging**: Coordinate details before meeting up

## Technical Architecture

ThirdPlace is built as a decentralized application using:

- **Frontend**: Elm for reliable UI with JavaScript for effects
- **Data Storage**: IPFS for distributed content storage
- **Database**: OrbitDB for stateful data management (posts, RSVPs, messages)
- **Persistence**: Pinning services ensure content availability
- **Infrastructure**: Decentralized backend on Akash Network

### Why Decentralized?

- **User-first design**: No algorithms optimizing for engagement over user success
- **Community ownership**: No central authority controlling social interactions
- **Privacy-focused**: Data distributed across network, not centralized in corporate databases
- **Transparent operations**: Open source and auditable

## Development Status

🚧 **Currently in development** - Building MVP with core activity coordination features.

### Current Phase: IPFS Foundation
Setting up basic distributed content storage and retrieval capabilities.

## Getting Started

*Development setup instructions will be added as the project progresses.*

## Contributing

This project is fully open source. Contributions welcome through:
- Code contributions (PRs)
- Community feedback and testing
- Donations for development and infrastructure

## Vision

ThirdPlace aims to recreate the social coordination that historically happened in physical "third places" (spaces outside work and home) by providing digital tools that facilitate real-world connections rather than replacing them.

The goal is to get people off their phones and into shared activities with their neighbors and community members.
# License
GNU AFFERO GENERAL PUBLIC LICENSE Version 3

See LICENSE

# Development
See contributing/

29 changes: 0 additions & 29 deletions tp-frontend/.llmrc/INSTRUCTIONS.md

This file was deleted.

13 changes: 0 additions & 13 deletions tp-frontend/PACKAGES.md

This file was deleted.

129 changes: 2 additions & 127 deletions tp-frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,129 +1,4 @@
# tp-frontend README

# ThirdPlace Frontend
This is the directory for the frontend, user facing, side of ThirdPlace.

A decentralized social application frontend designed to foster conversation and community. The frontend is a single-page application focused on simplicity, anonymity, and resilience, served entirely over IPFS.

## Overview

ThirdPlace is a decentralized social app that enables real-time P2P chat through WebRTC, with web3 identity authentication via KILT blockchain. The application prioritizes user privacy and decentralized infrastructure.

## Technologies

- **Elm** – Main frontend language (pure functional, type-safe)
- Ports – Used for JavaScript interop (LibP2P, KILT integration)
- **IPFS** – Hosts and serves the static frontend (fully decentralized)
- **LibP2P (via JS)** – Enables real-time P2P chat via WebRTC
- **IndexedDB / localStorage** – Client-side state persistence
- **Polkadot/KILT blockchain** – Web3 identities for authentication
- **Vite** – Development server and build tooling

## Project Structure

```
tp-frontend/
├── src/
│ ├── JSPorts/ # JavaScript interop ports
│ │ ├── Identity/ # KILT identity management
│ │ ├── Sporran/ # Sporran wallet integration
│ │ ├── Geohash/ # Location-based room discovery
│ │ ├── RoomPubsub/ # Room messaging system
│ │ └── WebRTC/ # P2P communication
│ ├── Views/ # UI components
│ │ ├── Login/ # Authentication interface
│ │ ├── Room/ # Chat room interface
│ │ └── ThirdPlaceAppView.elm
│ ├── Utils/ # Utility functions
│ ├── ThirdPlaceApp.elm # Main application entry point
│ └── ThirdPlaceModel.elm # Application state model
├── stylesheets/ # CSS styling
├── index.html # HTML entry point
├── build.sh # Elm compilation script
├── serve.sh # Development server script
└── package.json # Node.js dependencies
```

## Development Setup

### Prerequisites

- [Elm](https://guide.elm-lang.org/install/elm.html)
- Node.js and npm
- Modern web browser with WebRTC support

### Installation

1. Install dependencies:
```bash
npm install
```

2. Build the Elm application:
```bash
sh build.sh
```

3. Start the development server:
```bash
sh serve.sh
```

The application will be available at `http://localhost:5173/`

## Architecture

### Elm Application
The main application is written in Elm (`ThirdPlaceApp.elm`) using The Elm Architecture (TEA) pattern with:
- **Model** – Application state
- **Update** – State transitions
- **View** – UI rendering
- **Subscriptions** – External event handling

### JavaScript Ports
JavaScript integration is handled through Elm ports in the `JSPorts/` directory:
- **Identity** – KILT DID generation and authentication
- **Sporran** – Wallet connectivity
- **WebRTC** – P2P communication setup
- **Geohash** – Location-based room discovery
- **RoomPubsub** – Real-time messaging

### UI Components
- **Login View** – User authentication interface
- **Room View** – Main chat interface with conversation panel and chat panel
- **Chat Panel** – Message display and input
- **Conversations** – Room/conversation management

## Deployment

_This is a manual process right now, but we hope to make this automatic._
The application is designed for decentralized deployment via IPFS:

1. Build the application:
```bash
sh build.sh
```

2. Collect all assets (HTML, CSS, JS, compiled Elm) into a deployment folder

3. Upload to IPFS for decentralized hosting

Users access the application via IPFS URLs or HTTP gateways rather than traditional domain names.

## Features

- **Decentralized Identity** – KILT blockchain-based authentication
- **P2P Communication** – Direct WebRTC connections for chat
- **Location-based Rooms** – Geohash-based room discovery
- **Privacy-focused** – No central servers for messaging
- **Anonymous by Design** – Optional identity disclosure
- **IPFS Hosting** – Fully decentralized application delivery

## Development Commands

- `npm run dev` – Start development server
- `npm run build` – Build for production
- `sh build.sh` – Compile Elm to JavaScript
- `sh serve.sh` – Start development server (via npm)

## License

GNU AFFERO GENERAL PUBLIC LICENSE Version 3 - See [LICENSE](../LICENSE)
1 change: 0 additions & 1 deletion tp-frontend/build.sh

This file was deleted.

37 changes: 9 additions & 28 deletions tp-frontend/index.html
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
<!DOCTYPE HTML>
<html>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ThirdPlace Login</title>
<link rel="stylesheet" href="stylesheets/thirdplace.css">
<link rel="stylesheet" href="stylesheets/loginstyles.css">
<link rel="stylesheet" href="stylesheets/roomstyles.css">
<link rel="stylesheet" href="stylesheets/conversationstyles.css">
<link rel="stylesheet" href="stylesheets/chatpanelstyles.css">
<script src="tpapp.js"></script>
<script type="module" src="src/JSPorts/Identity/libp2p-identity.js"></script>
<script type="module" src="src/JSPorts/Sporran/sporran.js"></script>
<script type="module" src="src/JSPorts/Geohash/geohash-room.js"></script>
<script type="module" src="src/JSPorts/RoomPubsub/room-pubsub.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ThirdPlace</title>
<link rel="stylesheet" href="stylesheets/main.css">
</head>

<body>
<script type="module">
import {setupSporranPorts} from './src/JSPorts/Sporran/sporran.js';
import {setupIdentityPorts } from './src/JSPorts/Identity/libp2p-identity.js'
import {setupRoomPorts} from './src/JSPorts/Geohash/geohash-room.js'
import {setupRoomPubSubPorts} from './src/JSPorts/RoomPubsub/room-pubsub.js'
var app = Elm.ThirdPlaceApp.init({node: document.getElementById('app')});
setupSporranPorts(app);
setupIdentityPorts(app);
setupRoomPorts(app);
setupRoomPubSubPorts(app);
</script>
<div id="app"></div>
<script src="main.js"></script>
<script type="module" src="tpapp.js"></script>
</body>

</html>
Loading