Giter VIP home page Giter VIP logo

trycode's Introduction

TryCode logo

Is an open-source realtime collaborative code editor with syntax highlighting. Perfect for: remote coding interviews and learning code for friends.

The server part is developed on NodeJS and using Socket.io libraries under the hood to support websockets for realtime collaboration. The client side use AngularJS v1.4.8, ACE and dollardom.js.

Join to Gitter TryCode if you have any questions. Join the chat at https://gitter.im/trycode-gitter/chat

Demo

Try out for yourself on the demo site here in Heroku: http://trycode.herokuapp.com/

TryCode in Safari

Installation

Clone the repository from Github

$ git clone https://github.com/Archakov06/trycode.git

To get your own TryCode running on Heroku, click the button below:

Deploy

Configuration

Before you run the application, you need to configure access to the database by writing setting in src/server/config.js and set OPTIONS.DEV (true / false. Developer mode is not finished.)

db = require('knex')({
	client: 'mysql',
	connection: {
		host       : options.DEV ? 'localhost' : 'eu-cdbr-west-01.cleardb.com',
		user       : options.DEV ? 'root' : 'cleardb_user',
		password   : options.DEV ? 'password' : 'cleardb_pass',
		database   : options.DEV ? 'trycode_db' : 'cleardb_dbname',
		socketPath : options.DEV ? '/Applications/MAMP/tmp/mysql/mysql.sock' : '', // I have OSX and need mysql.sock
		charset    : 'utf8',
	}
});

NPM Scripts

"scripts": {
    "start": "node ./dist/run.js",
    "build": "babel ./src/server -d ./dist",
    "run": "node ./dist/run.js",
    "build-run": "babel ./src/server -d ./dist && node ./dist/run.js",
    "sprite": "svg-sprite-generate -d public/img/svg -o public/img/sprites.svg"
  }

How to report bugs

Bugs should be files as issues on the github issue tracker at https://github.com/Archakov06/trycode/issues. Contact me via GitHub if you have issues, suggestions or need any help regarding this app. Note that the code is beta quality.

What for?

With the passage of the interview in one of the companies, I was offered to write code in collabedit.com. After using this online editor, I noticed that it works very badly and has a very sucks editor (it's uses "long polling" 🤦). Then I got the idea to realize a simple and convenient at the same time online code editor on the WebSockets.

P.S: Sorry for my lousy English :)

License

MIT License

Copyright (c) 2017 Archakov Dennis

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contributing

Comming soon...

trycode's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

trycode's Issues

unexpected token

I am not sure if i did correct in config.js: (just a question if its correct)
host : options.DEV ? 'localhost' : 'localhost', user : options.DEV ? 'root' : 'root', password : options.DEV ? '' : '', database : options.DEV ? 'trycode' : 'trycode',

And Im getting this error aswell:
image

💡Feature Request

Привет!

Не имеется live-preview, хотел уточнить принимаете пулл реквесты?

Хотел создать sandbox на react, vue и angular, примерно так.

Database schema?

Is there documentation on how to create the database tables required by Trycode? Currently getting this stack trace when trying to run the application:

> [email protected] start /home/kiwi/Downloads/trycode
> node ./dist/run.js

✅  Сервер запущен по адресу: http://localhost:5000
✅  Сокеты запущены!
Unhandled rejection Error: ER_NO_SUCH_TABLE: Table 'trycode.trycode' doesn't exist
    at Query.Sequence._packetToError (/home/kiwi/Downloads/trycode/node_modules/mysql/lib/protocol/sequences/Sequence.js:52:14)
    at Query.ErrorPacket (/home/kiwi/Downloads/trycode/node_modules/mysql/lib/protocol/sequences/Query.js:83:18)
    at Protocol._parsePacket (/home/kiwi/Downloads/trycode/node_modules/mysql/lib/protocol/Protocol.js:280:23)
    at Parser.write (/home/kiwi/Downloads/trycode/node_modules/mysql/lib/protocol/Parser.js:74:12)
    at Protocol.write (/home/kiwi/Downloads/trycode/node_modules/mysql/lib/protocol/Protocol.js:39:16)
    at Socket.<anonymous> (/home/kiwi/Downloads/trycode/node_modules/mysql/lib/Connection.js:109:28)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at Pipe.onread (net.js:548:20)
    --------------------
    at Protocol._enqueue (/home/kiwi/Downloads/trycode/node_modules/mysql/lib/protocol/Protocol.js:141:48)
    at Connection.query (/home/kiwi/Downloads/trycode/node_modules/mysql/lib/Connection.js:214:25)
    at /home/kiwi/Downloads/trycode/node_modules/knex/lib/dialects/mysql/index.js:152:18
    at Promise._execute (/home/kiwi/Downloads/trycode/node_modules/bluebird/js/release/debuggability.js:299:9)
    at Promise._resolveFromExecutor (/home/kiwi/Downloads/trycode/node_modules/bluebird/js/release/promise.js:481:18)
    at new Promise (/home/kiwi/Downloads/trycode/node_modules/bluebird/js/release/promise.js:77:14)
    at Client_MySQL._query (/home/kiwi/Downloads/trycode/node_modules/knex/lib/dialects/mysql/index.js:146:12)
    at Client_MySQL.query (/home/kiwi/Downloads/trycode/node_modules/knex/lib/client.js:189:17)
    at Runner.<anonymous> (/home/kiwi/Downloads/trycode/node_modules/knex/lib/runner.js:138:36)
    at Runner.tryCatcher (/home/kiwi/Downloads/trycode/node_modules/bluebird/js/release/util.js:16:23)
    at Runner.query (/home/kiwi/Downloads/trycode/node_modules/bluebird/js/release/method.js:15:34)
    at /home/kiwi/Downloads/trycode/node_modules/knex/lib/runner.js:61:21
    at tryCatcher (/home/kiwi/Downloads/trycode/node_modules/bluebird/js/release/util.js:16:23)
    at /home/kiwi/Downloads/trycode/node_modules/bluebird/js/release/using.js:185:26
    at bound (domain.js:280:14)
    at runBound (domain.js:293:12)

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.