Giter Club home page Giter Club logo

caucus's Introduction

Contributors Forks Stargazers Issues MIT License LinkedIn All Contributors


Logo

caucus

A Real Time Collaborative Editor with an embedded compiler
Explore the project »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Roadmap
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgements

📣 Latest Announcements

🆕 5-10-2021: We now have a discussions form, if you want any new feature to be implemented you can discuss here

🆕 28-09-2021: Caucus is participating in Hacktoberfest 2021 🥳

About The Project

Demonstration

Product Demonstation


Collaborative Code Editor

Product Name Screen Shot

Login Page Navigate Rooms Page
Product Name Screen Shot Product Name Screen Shot

Built With

Written in TypeScript ♥

Getting Started

Follow the instructions to set up the project on your local machine.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • npm

    npm install npm@latest -g

Installation

  1. Fork the repo(required), a star is also appretiated but optional :P

  2. Clone the forked repo

    git clone https://github.com/{your-github-username}/caucus.git

    example : git clone https://github.com/Rishabh-malhotraa/caucus.git

  3. Install NPM packages

    npm run install-modules
  4. Start the react and nodejs server concucrrently

    npm run dev

Setting up DATABASE

To setup the database with mockdata, follow this guide

Execute Code

To allow cuacus to execute code, you need to get your api keys from JDoodle and add them to the .env file Update: I have included API keys from a dummy account, you can get your own also from JDoodle, the keys are restricited to 200 executions per day, and is visible to everyone, you can get your own private key at JDOODLE

JDOODLE_CLIENTID=get_your_key
JDOOLDE_CLIENTSECRET=get_your_key

Roadmap

See the open issues for a list of proposed features (and known issues).

Things To do

  • Inital Login Page
  • Database hookup with login from oAuth
  • Chat Application
  • Video Chat Application (the main chunk of work)
  • Collaborative Editing (the main chunk of work)
  • Resizable Panes
  • Code Running (Easy need to just hookup with an api)
  • Database with all the leetcode question and sorted based on tags.
  • IMP: Sync code using localstorage or sockets when a new person joins in the room, with defaultvalue prop on the monaco editor instance.
  • Add SSL certificate to the docker container, andd get rid of the current bootleg shenanigans D: (LetsEncrypt or Cloudflare)
  • Add codeforce problem using webscraping thingy
  • Add Vim Keybinds
  • Add intellisense using Language Server Protocal for atleast C++ and JAVA
  • Make a public api to fetch questions, based on scraped data
  • Add a full-screen Zen Mode
  • Change Hosting from Heroku to GCP or Digital Ocean
  • Change Heroku PSQL DB to either MongoDB or Firebase SQLITE.
  • Add Autoformating keybind.
  • Fix the number of users in the room.
  • REACH: Add video call functionality (using WEBRTC or something propieteary like Twilo proprietary)
  • Add ability to add different tabs on the editor instance just like that on VSCODE
  • Integrate the random quote thingy on loading screen from forticodes API
  • Fix why the loader gets frozen on intial render -_-

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Refer to this article if you have any difficulty in making a pull request

License

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


Contact

Rishabh malhotraa - @rish_bishhh - [email protected]

Discord : rishabh.malhotra#4193

Project Link: https://caucus-app.herokuapp.com/


Stargazers over time

Stargazers over time


Acknowledgements

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Rishabh Malhotra

🚇 💻 🎨

Maruf

🚇 💻

Swikar Sharma

📖

Dev Valecha

📢

Harrison Mayotte

🚇 👀

Aditya Arya

🎨

Manju Thakur

🎨

Apex Web

🎨

Gaganpreet Kaur Kalsi

💻 🎨

Pavan kalyan C

💻

Parth Bhavesh Shah

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

caucus's People

Contributors

allcontributors[bot] avatar boorah avatar chirag3003 avatar harrisonmayotte avatar iamdevvalecha avatar imgbot[bot] avatar jamesql avatar marufsharifi avatar mthakur7 avatar pavankalyan-codes avatar rishabh-malhotraa avatar swikars1 avatar taksuparth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

caucus's Issues

Restore code on refresh

If you have signed in using google/github/twitter and have coded some program currently if you refresh your code does not persist anywhere.
A nice feature to have would be to ask the user if her wants to restore the code he has previously typed.

Add a product Landing Page

Want to make the project a tad bit more professional and a product landing page seems like a good idea

SOME UI DESIGNS
image

image

Move Hosting from Heroku to GCP or DIgital Ocean

There deployment experience with Heroku hasn't been great at all, I am having bugs when I deploy it on the Heroku server and not on my localhost which is very annoying and difficult to debug, I either plan to dockerize the serve or switch to either GCP or Digital ocean.

Code duplication when joining

Hello! It's that guy you were talking to from DogeHouse. I didn't have time to tell you this but based on my knowledge of the Web socket protocol. I think the reason that this is happening is because when someone new joins a room, the server has to send the current state of the room to the new user, So it sends the whole thing across the websocket, but instead of sending the code to just that user, it broadcasts the packet to everyone in the room, duplicating the current code to all user in the room. I can't seem to duplicate this though so this might be a little difficult

Have a Light mode

Requirement

  • Have a light mode for the entire editor page. Currently, we only support changing the theme of the Codemirror editor instance, but no other components.

The theme palette I use is the following:- VS-dark

First, we need to decide which palette we would be using for the light theme and then implement this in a modular way.

This is a big issue, so before trying to fix this, let me know how you approach this in a maintainable way.

By maintainable, I mean you don't have to change CSS hex codes in every component but have it defined from a global theme.modules.css file, and all the components derive CSS from that file.

Ability to make a room public and anyone can join

I want to make a lobby in which you have the ability to make a room public and anyone can join that room just like doghouse
If you make your room public it will show in the lobby else it would not show in the lobby and only those people who have the link to your room can join then.

UI MOCK UP

image

Migrate Database from PostgresSQL (Heroku) to MonogoDB cloud or Firebase

Heroku free postgres is really slow and you cant use it outside heroku, as I was panning to make a public API for leetcode questions it is better to either switch to a cloud database provide which is faster and has more storage, currently heroku caps to 10000 entries which is an absolute bummer.
Choose any of the three:-

  1. MongoDB Cloud
  2. Firebase Storage
  3. DynamoDB from aws

Add basic Unit Tests

Requirement

  • Currently Caucus does not have any unit testing
  • Implement basic unit testing.

Support More Programming Languages

Currently, Caucus only supports 5 languages (C++ Java, Javascript, Python and Go) I plan to add some more programming languages in which code can be executed.

Following is the list of programming languages I can add(in order of priority), but I feel I don't want to add so many

  1. c
  2. rust
  3. typescript
  4. python2
  5. csharp
  6. php
  7. ruby
  8. kotlin
  9. scala

Add Zen mode to Caucus

Add a full sceen zen mode just like on algo expert

image

image

        position: 'fixed',
        top: 0,
        right: 0,
        bottom: 0,
        left: 0,
        zIndex: 999

It would also be good if you can have a toolbar for the editor which shows the current language

Login using providers is not working on local

Describe the bug
Login using providers is not working.

To Reproduce
Steps to reproduce the behavior:

  1. On the Login page click on Google or Github

Expected behavior

  • It should redirect to GitHub or Google's authentication.

Additional context
generated URL is incorrect. In caucus/src/pages/Login/Login.tsx handleLogin function is creating URL as ${backend_URL}/auth/${provider} but the provider is given as /google /github making incorrect request as ${backend_URL}/auth//google instead of ${backend_URL}/auth/google

Local Development Server crashing upon clicking `Run Code`

Describe the bug
A clear and concise description of what the bug is.

Add a code snippet in editor.

To Reproduce
Steps to reproduce the behavior:

  1. Join a public room on a local development server.
  2. Write a code snippet in the editor.
  3. Click run code.
  4. Notice the server is crashed and the loading continues in the output section.

Expected behavior
The app shouldn't crash and the program should compile successfully.

Screenshots
If applicable, add screenshots to help explain your problem.

Screenshot 2022-03-02 at 10 55 35 PM

Screenshot 2022-03-02 at 11 00 05 PM

Desktop (please complete the following information):

  • OS: [e.g. iOS] Mac os
  • Browser [e.g. chrome, safari] Brave
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Replace JDoodle with Piston

Jdoodle you are capped to 200 request per day, while piston is free and open source you can have your own docker container running or just use the public API for execution and the only limit is not more that 5 request per second 🚀.

There is no rush right now as we are not exceed more than 100 request per day, you can check the number of request left with the
http://caucus-app.herokuapp.com/api/credit-spent

https://github.com/engineer-man/piston
https://www.jdoodle.com/compiler-api

Add support for CSES Problem URL

Requirement

Currently, Caucus only supports codeforces and atcoder links, but it would be great to add support for CSES links.
example https://cses.fi/problemset/task/1068

  • Changes need to be made in the caucus server to add the functionality to scrape the CSES question from the get response.
    Also, some UI changes in the front-end, to tell the user that we support CSES links.

image

Files to be modified

Fix Users component on the right hand side

Describe the bug
Desgin flaw first I capped the room limit to 2 people but then later I increased it to 5, but I did not change this component, also I want to show random user icon images rather than just guest user icon, because then you cannot distinguish between users.

image

To fix :
Correct the socket-io code so it sends data of all the users in the room rather than the person who was last to join
files:

caucus-server/src/service/socket-io-service.ts

And manage the front end part too:

caucus/src/components/VoiceChat
caucus/src/pages/room/room.tsx

Add support for codechef Problem URL

Requirement

Currently, Caucus only supports codeforces and atcoder links, but it would be great to add support for CodeChef links.

  • Changes need to be made in the caucus server to add the functionality to scrape the CodeChef question from the get response.
    Also, some UI changes in the front-end, to tell the user that we support CodeChef links.

image

Files to be modified

Language changed by one user in the room isn't reflected to other users.

Describe the bug
If a user in a room changes the language, this change is not being reflected in other users.

To Reproduce
Steps to reproduce the behavior:

  1. Create a room.
  2. Join from another browser.
  3. Change language in one web client.
  4. This change is not sent to other web clients in the session.

Expected behavior
The language selected by one user should also be passed to other web clients in the room because when they run the code it might show compilation errors as their language selection is not the same...

Refactor Code for roomID extractions

Motivation

I want to adhere to the DRY concept in programming (Don't Repeat Yourself)

Description

In many files, I have resued the logic to extract the param id from the URL. Firstly I thought I wouldn't need it but then I have rewritten the same code in different files several times.

A better implementation would be to use context and store it as a part of the global state

import { useParams } from "react-router-dom";
const { id } = useParams<Record<string, string>>();

Problem in y-websocket connection

Describe the bug
I'm unable to code Syncing in Codemirror.
I'm getting a problem y-websocket connection
"y-websocket.js:91 WebSocket connection to 'wss://board.example.com:1234/public-room' failed:

in package.json
"crdt-server": "cd client && HOST=board.example.com PORT=1234 npx y-websocket",
so I'm getting
running at 'board.example.com' on port 1234

and
provider = new WebsocketProvider('wss://board.example.com:1234', roomID, ydoc); in CodeMirrorEditor.tsx
( AWS ports are open for : 1234,3090,5001)

REACT_APP_CLIENT_URL = https://board.example.com:3090 (localhost:3000)
REACT_APP_SERVER_URL = https://board.example.com:5001 (localhost:5000 reverse proxy by Nginx)

&

CLIENT_URL=https://board.example.com:3090
SERVER_URL=http://localhost:5000

socket.io is working fine,
I can see users' join and left notifications, language changes, etc the only issue is code Syncing.

Expected behavior
Code syncing should work in Codemirror.

Desktop (please complete the following information):

  • OS: MacOS
  • Browser Chrome Version 102.0.5005.115 (Official Build) (arm64)

Please provide your suggestions.

Add option to Format code like prettier does on VSCODE

I wish there could be a button on the toolbar, on which if you click it formats the document just like prettier does on vscode.

This needs further investigation as is it something which is even practical and should be pursued or no, because this can lead to some annoying bugs with cursors during collaboration D:

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.