Skip to content

User interface #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 86 commits into from
Aug 26, 2016
Merged

User interface #12

merged 86 commits into from
Aug 26, 2016

Conversation

onur
Copy link
Member

@onur onur commented Jun 23, 2016

User interface of cratesfyi

Web based user interface. It is under heavy development and this branch is
usually live at: https://beta.docs.rs/ build is in progress, search and most starred crates may not work.

Database is frozen and cratesfyi is not building any more crates during development.

Development

You can download subset of database dump (~270MB uncompressed) and help development of user interface without the need of containers (only user interface will work). You can run cratesfyi's web interface with:

# first grab database dump
wget http://cratesfyi.mooo.com/cratesfyi-web-subset-20160722.sql.gz
# restore database dump (you need to create a database and user first)
gzip -dc cratesfyi-web-subset-20160722.sql.gz | psql cratesfyi -U cratesfyi
# get cratesfyi-prefix tarball crated for only web interface
wget http://cratesfyi.mooo.com/cratesfyi-web-prefix-20160722.tar.gz
# extract cratesfyi-prefix
tar xzfv cratesfyi-web-prefix-20160722.tar.gz

# enter project directory, clone repository and checkout web branch
cd cratesfyi
git clone https://github.com/onur/cratesfyi.git cratesfyi
cd cratesfyi
git checkout web

# you also need to compile style.scss with scss
# make sure style.css link is correct in cratesfyi-prefix/public_html directory
scss templates/style.scss > templates/style.css

# compile and start web interface
CRATESFYI_PREFIX=../cratesfyi-prefix CRATESFYI_DATABASE_URL=postgresql://cratesfyi@localhost cargo run -- start-web-server

TODO

  • Proper error handling among handlers (this is partially done, idea is to get rid of all unwraps).
  • Proper 404 page.
  • Releases:
    • Recent releases
    • Pagination in search results
    • Bring crate if I am feeling lucky button pressed in home page
    • Proper search result page when we can't find any create (currently returning 404)
    • Releases by authors
    • Most starred crates (github)
    • Author list and search (maybe in future)
    • Release activity with highcharts (similar to metacpan).
  • Crate details:
    • Need to show more data about crate, such as:
      • Homepage, original rustdoc link (original documentation link is not saved and not available in database :/)
      • License (looks like I forgot to save license fields)
      • Github fields (stars, forks, issue count, last commit date)
    • Proper padding for crate README.
    • <pre> tags looks ugly in crate README.
    • Dependency chain with graphviz. (maybe in future)
  • Source browser: /source/{crate}/{version}
    • highlightjs based syntax highlighting for rust source.
    • Show relative path of the file when user is browsing a file.
  • Proper colorization of build icon in builds tab.
  • Add favicon.
  • Add Rust menu to navigation to point users to official Rust channels.
src/web/releases.rs:        // TODO: Currently, there is no way to know we are on the last page.
src/web/mod.rs:        // TODO: Use DocBuilderOptions for paths
src/web/mod.rs:        // TODO: Add a custom 404 page
src/web/crate_details.rs:// TODO: Add target name and versions

Issues

  • Wrong grid size calculation for sm grid in builds.hbs
  • Padding of search input in navigation.
  • Link colors in crate README.
src/web/releases.rs:                // FIXME: There is no pagination
src/web/builds.rs:    // FIXME: getting builds.output may cause performance issues when release have tons of builds
src/web/mod.rs:        // FIXME: URGENT use correct path
src/web/mod.rs:        // FIXME: Need to sort versions with semver, database is not keeping them sorted
src/web/mod.rs:        // FIXME: This test is doing nothing
src/web/rustdoc.rs:    // FIXME: This is a bit inefficient but allowing us to use less code in general

Fixes: #1, #4
Successor of: #10

@steveklabnik
Copy link
Member

This is so cool!

@frewsxcv
Copy link
Member

This amazing work @onur, thanks a ton for the effort you put into this, it'll greatly help the Rust community :)

@onur
Copy link
Member Author

onur commented Jun 23, 2016

I am glad you liked it guys. It will be more awesome when I add stuff in TODO.

@onur onur changed the title Web User interface Jun 23, 2016
onur added 2 commits June 23, 2016 17:31
rustdoc is using search-input class for searches. Using search-input is
breaking rustdoc searches. Use search-input-nav instead of search-input
for search input in navigation.
Also remove padding of first header in README,
and remove some trailing whitespaces in style.scss
@sunng87
Copy link

sunng87 commented Jul 14, 2016

This looks fantastic!

And thank you for choosing handlebars(-iron). I'm the author of handlebars-iron, feel free to ping me (here or in handlebars/iron repo) if there is any issue.

@jonhoo
Copy link
Contributor

jonhoo commented Jul 21, 2016

Are you interested in PRs against the web branch with fixes for the TODOs you list above? Or would you like to finish building all the basics yourself first?

@jonhoo
Copy link
Contributor

jonhoo commented Jul 21, 2016

Also, it'd be really useful if you could release a database dump that is a subset of the full dataset. Access to all the crates isn't needed to build the UI :)

@onur
Copy link
Member Author

onur commented Jul 22, 2016

Thanks for your interest @jonhoo

Sure you can send PR's. A subset of database makes sense, I will prepare one.

This reverts commit 77c9e5a.

This commit caused some issues in rustdocs
@steveklabnik
Copy link
Member

Awesome!!!!

On Aug 22, 2016, 19:45 -0400, Onur Aslan [email protected], wrote:

Docs.rs finally finished building crates. I'll write a simple daemon tomorrow, and then I think we are ready to go.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (https://github.com/onur/docs.rs/pull/12#issuecomment-241585167), or mute the thread (https://github.com/notifications/unsubscribe-auth/AABsirUp6ImjUVgL56bXXR3Q-AfT_kTyks5qijSfgaJpZM4I80i-).

@onur
Copy link
Member Author

onur commented Aug 26, 2016

I've been monitoring daemon and it's working fine. I only saw one issue; failed to pull recent changes from crates-io.index for 10 minutes. Docs.rs is currently pulling changes twice in 3 minutes margin, IDK if github have some limits, maybe its better idea to increase delay between pulls.

onur added 6 commits August 26, 2016 11:58
This only got stuck once but I belive its more safer to increase
duration between pull requests
* Add report link for failed builds.
* Add email for contact.
@steveklabnik
Copy link
Member

steveklabnik commented Aug 26, 2016

@alexcrichton might have some opinions/comments about that ^

@alexcrichton
Copy link
Member

AFAIK Cargo's load on the index would likely be far higher than docs.rs's, so that rate of polling shouldn't be too bad in theory?

@onur onur merged commit 62fccee into master Aug 26, 2016
@steveklabnik
Copy link
Member

@alexcrichton sounds reasonable! Just wanted to make sure you knew!

@steveklabnik
Copy link
Member

@onur 🎊

does this mean we can talk about this publicly now?

@onur
Copy link
Member Author

onur commented Aug 26, 2016

Yes @steveklabnik docs.rs is finally live!

@onur onur deleted the web branch August 28, 2016 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aliasing latest
8 participants