Portal is a real-time collaborative text editor that allows multiple users to edit shared documents simultaneously in private, room-based sessions. Powered by WebSockets, it ensures low-latency synchronization and seamless teamwork across devices.
- Real-time Collaboration — Type together with instant sync between users.
- Room-based System — Create or join sessions using a unique 6-digit room code.
- Auto-Cleanup — Inactive rooms are automatically removed after 1 hour to optimize resources.
- Cross-platform Support — Accessible via modern web browsers with responsive design.
Portal is a full-stack web application composed of:
- WebSocket server for managing real-time connections.
- REST API for room lifecycle operations (
/create
,/exists
,/ws
). - Thread-safe room state handling using mutexes for concurrency control.
- Intuitive UI for creating and joining rooms.
- Collaborative text editor with WebSocket-based live updates.
- Built with Vite, React Router, Tailwind CSS, and shadcn/ui for modern styling.
- Go v1.19+
- Node.js & npm
-
Clone the repository
git clone https://github.com/swgtds/portal.git cd portal
-
Run the backend
cd backend go run main.go
The backend server runs on
http://localhost:5001
-
Run the frontend
cd frontend npm install npm run dev
The frontend runs on
http://localhost:8080
- Create a Room — Click "Create Room" to generate a 6-digit session code.
- Join a Room — Enter a valid code to collaborate with others.
- Start Editing — Begin typing and watch all connected users sync in real time.
Method | Endpoint | Description |
---|---|---|
POST | /create |
Creates a new room and returns its ID |
GET | /exists?room=<id> |
Checks if a room exists |
WS | /ws?room=<id> |
WebSocket endpoint for collaboration |
- Backend: Go, Gorilla WebSocket,
net/http
- Frontend: React 18, TypeScript, Vite, Tailwind CSS, shadcn/ui
- Portal uses CORS middleware to handle cross-origin communication between frontend and backend.
- Includes robust error handling for invalid room codes, connection failures, and session timeouts.
- The frontend was initially scaffolded using Lovable.dev for modern, developer-friendly UI.