Skip to content

kmanish527/CodeHive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐝 CodeHive

"A realtime collaborative platform for developers to share and discover code snippets."

✨ Live Demo

https://codeehive.netlify.app/


📖 Table of Contents


📖 About The Project

CodeHive is a real-time collaborative code editor, perfect for developers who need to quickly pair program, debug, or teach.

Powered by socket.io, it allows multiple users to edit the same code snippet simultaneously, seeing every change as it happens. Each session is assigned a unique and private URL using uuid, allowing you to instantly share the link and start collaborating with anyone, anywhere.

Features

  • Feature 1: [e.g., Unique Sharable Code, Create & Forget]
  • Feature 2: [e.g., Create, Read, Update, and Delete code snippets]
  • Feature 3: [e.g., Syntax highlighting for multiple languages]
  • Feature 4: [e.g., Real-time collaboration features]

📸 Screenshots

[CodeHive Homepage] image

[CodeHive Editorpage] image

[CodeHive Realtime Code Sharing] image


🚀 Tech Stack

This project is a monorepo built with the following technologies:

Category Technology
Frontend React Vite Tailwind CSS
Backend Node.js Express.js
Deployment Netlify

📂 Folder Structure

The project uses a monorepo structure to manage the frontend and backend code in the same repository.

CODEHIVE/ ├── codehive-backend/ # Express.js REST API ├── codehive-frontend/ # Vite + React Frontend ├── netlify/ │ └── functions/ │ └── api.js # Serverless function handler for Express ├── .gitignore ├── netlify.toml # Netlify deployment configuration └── README.md


🛠️ Getting Started

To get a local copy up and running, follow these simple steps.

Prerequisites

Make sure you have the following installed on your machine:

  • Node.js (v18 or higher recommended)
  • npm (Node Package Manager)
  • Git

Installation

  1. Clone the repository:

    git clone [https://github.com/kmanish527/CodeHive.git](https://github.com/kmanish527/CodeHive.git)
    cd codehive
  2. Install backend dependencies:

    npm install --prefix codehive-backend
  3. Install frontend dependencies:

    npm install --prefix codehive-frontend

Environment Variables

You will need to create .env files for both the frontend and backend.

  1. Backend Environment: Create a .env file in the codehive-backend directory.

    # codehive-backend/.env
    PORT=5000
    CORS_ORIGIN=http://localhost:5173
    
  2. Frontend Environment: Create a .env.local file in the codehive-frontend directory. The Vite proxy will handle API requests in development.

    # codehive-frontend/.env.local
    VITE_BACKEND_URL=http://localhost:5000
    

🏃 Running the Project

To run both the frontend and backend servers concurrently in development mode, use the following command from the root directory:

cd .\codehive-frontend\
npm run dev
The frontend development server will start on http://localhost:5173.

cd .\codehive-backend\
npm start
The backend server will start on http://localhost:5000 (or your specified PORT).


🌐 Deployment
This application is deployed on Netlify.

The frontend is served as a static site from the codehive-frontend/dist directory.

The Express.js backend is deployed as a Netlify Serverless Function.

The netlify.toml file contains all the necessary build and redirect configurations. Any request to /api is automatically routed to the serverless backend.

🤝 Contributing
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

Fork the Project

Create your Feature Branch (git checkout -b feature/AmazingFeature)

Commit your Changes (git commit -m 'Add some AmazingFeature')

Push to the Branch (git push origin feature/AmazingFeature)

Open a Pull Request

📝 License
Distributed under the MIT License. See LICENSE file for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published