Skip to content

CygnusMaximillian/GDlite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

20 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

.

๐Ÿ“ GDlite โ€“ Real-Time Collaborative Editor

GDlite is a real-time collaborative text editor built with a modern full-stack architecture. It supports user authentication, document management, and is designed to scale using WebSockets and PostgreSQL.

๐Ÿš€ Features

๐Ÿ” User Authentication (JWT-based)

๐Ÿ“„ Create & manage documents

๐Ÿค Real-time collaboration (planned via WebSockets)

๐Ÿ—„๏ธ PostgreSQL for persistent storage

โšก Fast development setup with Vite + React

๐Ÿงฉ Modular backend architecture

๐Ÿ—๏ธ Tech Stack Backend

Node.js

Express.js

PostgreSQL

pg (node-postgres)

dotenv

JWT Authentication

Frontend

React

Vite

React Router DOM

๐Ÿ“‚ Project Structure collab-editor/ โ”‚ โ”œโ”€โ”€ server/ โ”‚ โ”œโ”€โ”€ src/ โ”‚ โ”‚ โ”œโ”€โ”€ index.js # Server entry point โ”‚ โ”‚ โ”œโ”€โ”€ db.js # PostgreSQL connection โ”‚ โ”‚ โ”œโ”€โ”€ routes/ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ documents.js # Document routes โ”‚ โ”‚ โ””โ”€โ”€ controllers/ โ”‚ โ”‚ โ””โ”€โ”€ documentsController.js โ”‚ โ”œโ”€โ”€ package.json โ”‚ โ””โ”€โ”€ .env โ”‚ โ””โ”€โ”€ client/ โ””โ”€โ”€ Editor/ # React frontend (Vite)

โš™๏ธ Backend Setup 1๏ธโƒฃ Install Dependencies cd server npm install

2๏ธโƒฃ PostgreSQL Setup

Create the database and tables:

CREATE DATABASE GDlite;

CREATE TABLE users ( id SERIAL PRIMARY KEY, email VARCHAR(255) UNIQUE NOT NULL, password_hash VARCHAR(255) NOT NULL );

3๏ธโƒฃ Environment Variables

Create a .env file inside server/:

DATABASE_URL=postgresql://postgres:<your_password>@localhost:5432/GDlite PORT=5000

โš ๏ธ Replace <your_password> with your actual PostgreSQL password.

4๏ธโƒฃ Start Backend Server npm run dev

You should see:

Connected to postgres Server running on port 5000

๐ŸŽจ Frontend Setup 1๏ธโƒฃ Install Dependencies cd client/Editor npm install

2๏ธโƒฃ Run Development Server npm run dev

Open:

http://localhost:5173

๐Ÿง  Architecture Overview

Controllers handle business logic

Routes define API endpoints

Database pool manages PostgreSQL connections

JWT tokens secure API requests

React Router manages client-side navigation

๐Ÿ”ฎ Planned Improvements

๐Ÿ”„ WebSocket-based real-time editing

๐Ÿ‘ฅ Multi-user cursors & presence

๐Ÿ“œ Document versioning

๐Ÿ›ก๏ธ Role-based access control

๐Ÿš€ Production deployment (Docker + Nginx)

๐Ÿงช Common Issues

Blank page in frontend โ†’ Check App.jsx, routes, and exports

Postgres connection errors โ†’ Verify password & .env loading

Vite import errors โ†’ Ensure dependencies are installed

๐Ÿ“œ License

This project is licensed under the MIT License.

๐Ÿ‘จโ€๐Ÿ’ป Author

Prajjwal Dwivedi ๐Ÿ“Œ Full-Stack Developer | Systems & Backend Enthusiast.

About

Realtime docs editor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors