Coder Social home page Coder Social logo

repl-gallery's Introduction

REPL Gallery

This is a handy starter point for generating a gallery of student's repls from replit.

You can download it to get started up the top there ^.

Getting setup

You'll need to be a little bit comfortable with a terminal to use this. You'll also need python3 and npm.

You can get python on the official website.

NPM comes with NodeJS, you can install it from their website.

Open your terminal and navigate to this directory. Start by installing dependencies:

$ npm install

You can then run the website locally with:

$ npm run dev

Visit http://localhost:8000 to view it. It should just be a blank gallery.

Adding your data

To add your data you'll first need to export it to a csv like data.csv. You can store it anywhere but this directory is easy. If you're using Excel or Google Sheets there should be an export option for CSV. It should "just work".

Your data should have a column with replit project URLs. This is just the URL the user works on. If you call this column url it will make the next step easier. This is also the only column required in the data.

$ npm run scrape

This will show the help text for the scrape action. You can start scraping with:

$ npm run scrape data.csv

If you haven't specified a URL column it will ask for it. The script will then go through retrieving these URLs and getting the appropriate data. It will save the data in src/_data/projects.json when it finishes.

Follow the output to see if there are any errors, it will do its best not to crash.

Once that's done you can use

$ npm run dev

to see the gallery.

Customising the website

The website is built using Eleventy, Tailwind and TypeScript. Eleventy generates the website, Tailwind is used for styling it and Typescript is for the extra search and random functionality.

You can change the colours by editing the classes like blue to be, for example green. You can also add your own HTML or change the header. Follow the instructions on the Eleventy and Tailwind websites for more features.

Hosting the website

You can run build to get a static version of the website:

$ npm run build

The static version is saved in the dist folder.

An easy option for hosting is Google Firebase. It will cost a little bit of money, but I find it's usually at most a few cents per month. Once you've set up an account download the firebase CLI and follow the instructions.

$ firebase init .

(. means the current directory)

Once you've finished setting that up you can deploy it with:

$ firebase deploy

That should give you a URL for your gallery!

If you want to update it just follow those two steps again:

$ npm run build
$ firebase deploy

If you've updated your data.csv you'll also need to run the scrape script first:

$ npm run scrape data.csv

Good luck!

repl-gallery's People

Contributors

taybenlor avatar

Stargazers

Zach Wingrave avatar Kirill Lastovirya avatar

Watchers

 avatar James Cloos 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.