Code Monkey home page Code Monkey logo

rustaceans-src's Introduction

rustaceans-src

This repository is the source code for rustaceans.org. To add or modify your data on the website, you want the rustaceans.org repo.

The code is in two parts - backend is hosted at www.ncameron.org. The entry point is rustaceans.js. This listens for a GitHub PR hook. It inspects the PR and merges it then adds the data to an SQLite database. There is also a RESTful API for getting information about rustaceans from the database. init.js is an alternate stating point which will rebuild the database from the rustaceans.org repo. This is all node.js stuff.

The rustaceans.org directory contains the frontend; index.html is the entry point. This is a React app and is entirely client-based. It uses the backend's API to get data.

License

All files in this repository are copyright 2014-2017 rustaceans.org developers.

Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. This file may not be copied, modified, or distributed except according to those terms.

rustaceans-src's People

Contributors

edunham avatar jaysonsantos avatar joshtriplett avatar kornelski avatar lambda-fairy avatar mrmonday avatar nrc avatar simonsapin avatar skade avatar tarcieri 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rustaceans-src's Issues

Image is loaded insecurely

Firefox warns that the connection to the site is insecure because of images. I believe this is caused by the Rust logo image, which is being loaded from http://www.rust-lang.org/logos/rust-logo-256x256-blk.png (note the protocol). This might be fixed by changing http to https in the image src.

It's not a big deal, but it would be nice if it were shown as secure :)

Originally opened at nrc/rustaceans.org#647.

Post error messages to the PR

The bot should post an error message to the PR if it cannot be merged, and an error or success message to confirm it was added to the db, or if not, why not. It should include a direct link to the rustaceans profile

Include a location field

I've noticed a few queries for countries ("germany", "portugal"). Most likely, these people are looking for Rustaceans nearby.

We can either:

  • Grab the location from the user's GitHub profile

  • Add a "location" field to the data file. This duplicates the info from GitHub -- but given that we duplicate the "website" field already, perhaps this isn't such a bad thing.

Unicode characters aren't allowed in fields.

According to the JSON standard, most Unicode characters such as "ล„" are allowed to be put into strings unescaped. The code in this repo seems to be parsing the strings as ascii instead of utf-8, which creates an error for any unescaped unicode character.

Rewrite the backend in Rust

crates.io's backend is written in Rust, and it works quite well. It would be nice if Rustaceans was too, especially as libraries like Hyper and Iron have cropped up in the mean time.

Accept multiple file changes

If a user modifies multiple files, we should try to accept legit changes and ignore the rest. It seems to be pretty easy to do this accidentally, rather than error-ing out.

Only merge changes on success

iirc, I changed the process for adding new users so that it tries to add to the db, then merge if it was successful. We should do the same thing with changes to existing users.

don't merge until we successfully populate the db

Currently we merge first, then read the merged file, then parse the JSON and populate the DB. Instead, we should read the JSON from the PR, try to put it into the DB and only merge if it is successful. Something to remember in this case is that the db will be ahead of the repo, so if we crash before merging we can't repopulate the db from the repo, we have to look at PRs too.

Have an easy to use way to input user details

We should have a way to create the initial entry for a user without them going through the fork and submit a PR dance.

The work flow should be something like - login using GitHub auth, fill out a form on rustaceans.org (username should be supplied from the auth), create a json file from the form details, submit a PR of this json file to the rustaceans repo using the user's credentials. I think this is all possible using the GitHub API, and we probably don't need to actually have a copy of the repo on the server, we ought to be able to synthesise the PR.

On success, the user should get notified and get a URL for themselves on rustaceans and a URL to their data entry in the repo, and a URL and instructions for how to submit a PR to change their details.

(I'm not too concerned about having an interface to edit a user's details, although that is hopefully possible too - the rate of change is very low, and doing a PR is not too hard).

Add discord usernames

Discord is an increasingly popular way for rustaceans to communicate, we should consider adding it. I'm happy to make a PR for this if it's desired.

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.