Coder Social home page Coder Social logo

rminderhoud / crates.io Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rust-lang/crates.io

0.0 3.0 0.0 2.01 MB

Source code for crates.io

Home Page: https://crates.io

License: Apache License 2.0

JavaScript 20.96% HTML 8.78% CSS 4.59% Shell 0.19% Rust 65.48%

crates.io's Introduction

crates.io

Source code for the default registry for Cargo users. Can be found online at crates.io

Installation

  • git clone this repository
  • npm install
  • npm install -g ember-cli
  • npm install -g bower && bower install

Making UI tweaks or changes

This website is built using Ember.js for the frontend, which enables tweaking the UI of the site without actually having the server running locally. To get up and running with just the UI, run:

npm run start:staging

This will give you a local server to browse while using the staging backend (hosted on heroku at https://staging-crates-io.herokuapp.com).

If you'd like to run the server with a specific different backend, you can specify specific arguments to npm start. For example you can set the proxy to https://crates.io/ to use the live instance, but do be aware that any modifications made here will be permanent! To do this, run:

npm start -- --proxy https://crates.io

The same is also available as:

npm run start:live

This requires NPM 2.0.

Working on the backend

If you'd like to change the API server (the Rust backend), then the setup is a little more complicated.

  1. Copy the .env.sample file to .env and change any applicable values as directed by the comments in the file.

  2. Set up the git index

    ./script/init-local-index.sh
    
  3. Build the server

    cargo build
    
  4. Run the migrations

    ./target/debug/migrate
    
  5. Run the servers

    # In one window, run the api server
    ./target/debug/server
    
    # In another window run the ember-cli server
    npm run start:local
    

Running Tests

  1. Configure the location of the test database. Note that this should just be a blank database, the test harness will ensure that migrations are run.

    export TEST_DATABASE_URL=...
    
  2. Set the s3 bucket to alexcrichton-test. No actual requests to s3 will be made; the requests and responses are recorded in files in tests/http-data and the s3 bucket name needs to match the requests in the files.

    export S3_BUCKET=alexcrichton-test
    
  3. Run the API server tests

    cargo test
    
  4. Install phantomjs

  5. Run frontend tests

    ember test
    ember test --server
    

Tools

For more information on using ember-cli, visit http://iamstef.net/ember-cli/.

For more information on using cargo, visit doc.crates.io.

crates.io's People

Contributors

alexcrichton avatar birkenfeld avatar blakewilliams avatar bluss avatar brson avatar carols10cents avatar derkyjadex avatar dirk avatar durka avatar frewsxcv avatar gankra avatar greenkeeperio-bot avatar huonw avatar markberger avatar mbrubeck avatar mdinger avatar octplane avatar panicbit avatar pimterry avatar ralph avatar rminderhoud avatar sfackler avatar sgrif avatar stebalien avatar stefanpenner avatar steveklabnik avatar tari avatar turbo87 avatar withoutboats avatar wycats avatar

Watchers

 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.