Coder Social home page Coder Social logo

codeshare's Introduction

CodeShare is an open-source code sharing application, with similar features to other websites, such as Pastebin and Hastebin.

Usage

You can either visit The Official Instance, or host the website yourself!
Afterwards, click on Create a Document to write and share your code!

Self Hosting

  1. Clone the repository and install the dependencies
$ git clone https://github.com/BytesToBits/CodeShare.git
$ cd CodeShare
# Run one of the following but make sure to use the same package manager on step 3 as well!
$ npm install
# or
$ yarn
  1. Create a .env file and paste the following text, filling the variables with your settings
MONGO_URI=<your_mongo_uri>
  1. And you can now run the project!
$ npm run build
$ npm run start
# or
$ yarn build
$ yarn start

Preparing the Database

You can get a free 500MB Database from MongoDB Atlas. That will last for a really long time.

Head over to Atlas and create a new account. You will then be greeted with this panel. Panel View

Select the FREE one and give it a name. Follow these steps;

  • Go to Database Access section under the Security tab and click + ADD NEW USER. Give it Read and write to any database permissions so the bot can properly store the data. Give it a username and a secure password. Save the password only. New User
  • To allow the bot to actually access the database, you should whitelist all IP's. Go to Network Access section under the Security tab and click + ADD IP ADDRESS. Click the Allow Access From Everywhere and 0.0.0.0/0 should appear in the Whitelist Entry. If it doesn't, enter it manually. Lastly, click confirm. Whitelist All IP's
  • Time to connect to the Database! Go to Cluster under the DATA STORAGE tab. If your database is still setting up, please wait until it's done! Once it is, click the CONNECT button and Connect Your Application. Copy a link that looks like this; mongodb+srv://<username>:<password>@cluster0.r4nd0m.mongodb.net/myFirstDatabase?retryWrites=true&w=majority
  • Lastly, remove the myFirstDatabase?retryWrites=true&w=majority part and replace <username> with your user's name (sometimes it is already replaced in if there's only one user), and <password> with your saved password.
  • Your database is done!

Contributing

All contibutions are welcome!

codeshare's People

Contributors

nemika-haj avatar

Stargazers

 avatar  avatar  avatar  avatar

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.