Skip to content

Commit c73ba68

Browse files
authored
Merge pull request #455 from charlieegan3/master
Readme update for clarity
2 parents d5060f9 + 7dfef43 commit c73ba68

File tree

1 file changed

+55
-53
lines changed

1 file changed

+55
-53
lines changed

README.md

Lines changed: 55 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,79 @@
11
# crates.io
22

3-
Source code for the default registry for Cargo users. Can be found online at
4-
[crates.io][crates-io]
3+
Source code for the default [Cargo](http://doc.crates.io) registry. Viewable
4+
online at [crates.io](https://crates.io).
55

6-
[crates-io]: https://crates.io
6+
This project is built on ember-cli and cargo, visit
7+
[iamstef.net/ember-cli](http://ember-cli.com/) or
8+
[doc.crates.io](http://doc.crates.io/) respectively for more information.
79

8-
## Development Setup
10+
## Working on the Frontend
911

10-
* `git clone` this repository
11-
* `npm install`
12-
* `npm install -g ember-cli`
13-
* `npm install -g bower && bower install`
14-
15-
## Making UI tweaks or changes
12+
```
13+
git clone https://github.com/rust-lang/crates.io.git
14+
cd crates.io/
15+
npm install
16+
npm install -g ember-cli bower
17+
bower install
18+
```
1619

17-
This website is built using [Ember.js](http://emberjs.com/) for the frontend,
18-
which enables tweaking the UI of the site without actually having the server
19-
running locally. To get up and running with just the UI, run:
20+
The website's frontend is built with [Ember.js](http://emberjs.com/). This
21+
makes it possible to work on the frontend without running a local backend.
22+
To start the frontend run:
2023

21-
```
24+
```bash
2225
npm run start:staging
2326
```
2427

25-
This will give you a local server to browse while using the staging backend
26-
(hosted on heroku at https://staging-crates-io.herokuapp.com).
28+
This will run a local frontend using the staging backend (hosted on Heroku at
29+
[staging-crates-io.herokuapp.com](https://staging-crates-io.herokuapp.com)).
2730

28-
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:
31+
If you'd like to run the frontend with a specific backend endpoint, you can
32+
specify arguments to `npm start`. For example you can set the proxy to
33+
`https://crates.io/` to use the production version.
2934

30-
```
35+
**Note: it is also possible to make changes to the production data**
36+
37+
To do this, run:
38+
39+
```bash
3140
npm start -- --proxy https://crates.io
41+
# or
42+
npm run start:live
3243
```
3344

34-
The same is also available as:
45+
**Note**: This requires npm 2.
46+
47+
### Running Tests
48+
49+
Install [phantomjs](http://phantomjs.org/), typically: `npm install
50+
phantomjs-prebuilt`.
51+
52+
Then run the tests with:
3553

3654
```
37-
npm run start:live
55+
ember test
56+
ember test --server
3857
```
3958

40-
This requires NPM 2.0.
59+
## Working on the Backend
4160

42-
## Working on the backend
43-
44-
If you'd like to change the API server (the Rust backend), then the setup is a
45-
little more complicated.
61+
After cloning the repo, steps for setting up the backend API server are as
62+
follows:
4663

4764
1. Copy the `.env.sample` file to `.env` and change any applicable values as
4865
directed by the comments in the file. Make sure the values in your new
4966
`.env` are exported in the shell you use for the following commands.
5067

51-
2. Set up the git index
68+
2. Set up the git index:
5269

5370
```
5471
./script/init-local-index.sh
5572
```
5673
5774
But *do not* modify your `~/.cargo/config` yet. Do that after step 3.
5875
59-
3. Build the server.
76+
3. Build the server:
6077
6178
```
6279
cargo build
@@ -65,23 +82,25 @@ little more complicated.
6582
On OS X 10.11, you will need to install the openssl headers first, and tell
6683
cargo where to find them. See https://github.com/sfackler/rust-openssl#osx.
6784
68-
4. Run the migrations
85+
4. Run the migrations:
6986
7087
```
7188
./target/debug/migrate
7289
```
7390
74-
5. Run the servers
91+
5. Start the backend server:
7592
7693
```
77-
# In one window, run the api server
7894
./target/debug/server
95+
```
96+
97+
6. **Optionally** start a local frontend:
7998
80-
# In another window run the ember-cli server
99+
```
81100
npm run start:local
82101
```
83102
84-
## Running Tests
103+
### Running Tests
85104
86105
1. Configure the location of the test database. Note that this should just be a
87106
blank database, the test harness will ensure that migrations are run.
@@ -99,30 +118,13 @@ little more complicated.
99118
export S3_BUCKET=alexcrichton-test
100119
```
101120
102-
3. Run the API server tests
121+
3. Run the backend API server tests:
103122
104123
```
105124
cargo test
106125
```
107126
108-
4. Install [phantomjs](http://phantomjs.org/)
109-
110-
5. Run frontend tests
111-
112-
```
113-
ember test
114-
ember test --server
115-
```
116-
117-
## Tools
118-
119-
For more information on using ember-cli, visit
120-
[http://iamstef.net/ember-cli/](http://ember-cli.com/).
121-
122-
For more information on using cargo, visit
123-
[doc.crates.io](http://doc.crates.io/).
124-
125-
## Deploying a Mirror
127+
## Deploying & Using a Mirror
126128
127129
**DISCLAIMER: The process of setting up a mirror is a work-in-progress and is
128130
likely to change. It is not currently recommended for mission-critical
@@ -156,7 +158,7 @@ The only config variable you need to set is `GIT_REPO_URL`, which should be the
156158
git URL of your crates index repository; see the next section for setup
157159
instructions for that.
158160
159-
### Index mirror setup
161+
### Index Mirror Setup
160162
161163
You also need a mirror of the crates.io git index, and your index needs to point
162164
to your API server.
@@ -178,7 +180,7 @@ to your API server.
178180
official index. How to do this depends on how you are hosting your index,
179181
but could be done through `cron` or a scheduled CI job, for example.
180182
181-
### Cargo setup
183+
### Local Cargo Setup
182184
183185
**NOTE: The following configuration requires a cargo version newer than
184186
0.13.0-nightly (f09ef68 2016-08-02). The version of cargo that comes with rust

0 commit comments

Comments
 (0)