GithubHelp home page GithubHelp logo

rajeshkhadka200 / collab Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 1.0 4.63 MB

A realtime code-sync tool, Collab is the platform for any developer or a code enthusiasts who wants to collaborate with other developer around the globe.

Home Page: https://collabb-app.netlify.app

License: MIT License

HTML 2.01% JavaScript 68.71% CSS 28.36% Shell 0.88% Procfile 0.04%
hakathon redis

collab's Introduction

Introducing Collab - Realtime Code Collabration tool .

Collab is Realtime code sync tool where users can collab to others developers to write code on a same time. Beside this, user can save written code snippets to the website by creating profile in the website.

Overview video

Watch here.

How it works

The workflow of application is describe by the following architecture diagram.

architecture diagram

At first, the socket connection is established through client. When the user get connected to the socket, users write the code in Editor. And the code written in editor get saved in redis as a Redis JSON .

How the data is stored:

The collab's data is stored in JSON format based upon RediJSON. The overall mapping of data is configured by Redis-Om Node js package.

At first connection need to be established in redis cloud by:

import { Client } from "redis-om";
const url = process.env.REDIS_HOST;
const client = new Client();
try {
  const res = await client.open(url);
  console.log("Connected to redis !");
} catch (error) {
  console.log("failed connecting redis", error);
}
export default client;

Schema of Code

const codeSchema = new Schema(
Code,
  {
    code_title: {
      type: "text",
    },
    code: {
      type: "text",
    },
    code_doc: {
      type: "text",
    },
    user_id: {
      type: "string",
    },
  },
  {
    dataStructure: "JSON",
  }
);

Schema of user

const userSchema = new Schema(
  User,
  {
    user_name: {
      type: "string",
    },
    user_profile: {
      type: "string",
    },
    user_email: {
      type: "string",
    },
    google_id: {
      type: "string",
    },
  },
  {
    dataStructure: "JSON",
  }
);

All the controllers files that communicates to redis for various CRUD operation.

How the data is accessed:

Since, The project collab is using redis-om package to communicate to redis database hosted on redis cloud, which have the diffrent commands for various CRUD operation :

Create a data

const code = codeRepository.createEntity(req.body);
const id = await codeRepository.save(code);

Read a data

const { user_id } = req.params;
  const myCode = await codeRepository
    .search()
    .where("user_id")
    .eq(user_id)
    .return.all();

Delete a data

await codeRepository.remove(req.params.code_id);

How to run it locally?

Prerequisites

  • Node - v16.15.0
  • npm - v8.18.0
  • yarn -v1.22.18

Local installation

Go to /server folder (cd ./server) and then:

Manage all .env file

install dependencies

yarn install

Run server

yarn server

Go to /client folder (cd ./client) and then:

Manage all .env file

install dependencies

yarn install

run development mode

yarn dev

Locally,Collab runs in:

  • Server localhost:5000
  • Client localhost:3000

Deployment

This web app is deployed at:

  • Netlify (Frontend)
  • Heroku (For backend)

More Information about Redis Stack

Here some resources to help you quickly get started using Redis Stack. If you still have questions, feel free to ask them in the Redis Discord or on Twitter.

Getting Started

  1. Sign up for a free Redis Cloud account using this link and use the Redis Stack database in the cloud.
  2. Based on the language/framework you want to use, you will find the following client libraries:

The above videos and guides should be enough to get you started in your desired language/framework. From there you can expand and develop your app. Use the resources below to help guide you further:

  1. Developer Hub - The main developer page for Redis, where you can find information on building using Redis with sample projects, guides, and tutorials.
  2. Redis Stack getting started page - Lists all the Redis Stack features. From there you can find relevant docs and tutorials for all the capabilities of Redis Stack.
  3. Redis Rediscover - Provides use-cases for Redis as well as real-world examples and educational material
  4. RedisInsight - Desktop GUI tool - Use this to connect to Redis to visually see the data. It also has a CLI inside it that lets you send Redis CLI commands. It also has a profiler so you can see commands that are run on your Redis instance in real-time
  5. Youtube Videos

collab's People

Contributors

rajeshkhadka200 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

leonsting

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.