Go to line 1
# Hexpm
Go to line 3
[](https://github.com/hexpm/hexpm/actions?query=workflow%3ACI)
Go to line 5
## Contributing
Go to line 7
To contribute to Hexpm you need to properly set up your development environment.
Go to line 9
Also see the client repository: [hex](https://github.com/hexpm/hex). The client uses `hexpm` for integration tests, so `hexpm` needs to support all versions the client supports. Travis tests ensures that tests are run on all supported versions.
Go to line 11
### Setup
Go to line 13
1. Run `mix setup` to install dependencies, create and seed database etc
Incorrect list-item indent: add 1 space
Go to line 14
2. Run `mix test`
Incorrect list-item indent: add 1 space
Go to line 15
3. Run `iex -S mix phx.server` and visit [http://localhost:4000/](http://localhost:4000/)
Incorrect list-item indent: add 1 space
Go to line 17
After this succeeds you should be good to go!
Go to line 19
See [`setup` alias in mix.exs](./mix.exs) and sections below for more information or when you run into issues.
Go to line 21
### PostgreSQL Modules And Version
Go to line 23
PostgreSQL version should be >= 9.4, as Hexpm uses the `jsonb` type, that is available from PostgreSQL 9.4 onward.
Go to line 25
Hexpm requires the PostgreSQL modules [pg_trgm](http://www.postgresql.org/docs/9.4/static/pgtrgm.html) and [pgcrypto](http://www.postgresql.org/docs/9.4/static/pgcrypto.html) to be available.
Go to line 27
This is located in the "postgresql-contrib" package, however the package name can vary depending on your operating system. If the module is not installed the ecto migrations will fail.
Go to line 29
### Database
Go to line 31
By default, Hexpm connects to a localhost PostgreSQL database `hexpm_dev` using the username `postgres` with the password `postgres`.
Go to line 33
Create the database and user 'postgres' if not already done:
Go to line 35
```sh
Go to line 36
docker-compose up -d db
Go to line 37
```
Go to line 39
Now you are fine to create the `hexpm_dev` database and run the ecto migrations:
Go to line 41
```shell
Go to line 42
mix do ecto.create, ecto.migrate
Go to line 43
```
Go to line 45
### Sample Data
Go to line 47
Using the following command you can seed your local Hexpm instance with some sample data:
Go to line 49
```shell
Go to line 50
mix run priv/repo/seeds.exs
Go to line 51
```
Go to line 53
### Node Dependencies
Go to line 55
For assets compilation we need to install Node dependencies:
Go to line 57
```shell
Go to line 58
cd assets && yarn install
Go to line 59
```
Go to line 61
If you don't have yarn installed, `cd assets && npm install` will work too.
Go to line 63
### Running Hexpm
Go to line 65
Once the database is set up you can start Hexpm:
Go to line 67
```shell
Go to line 68
# with console
Go to line 69
iex -S mix phx.server
Go to line 71
# without console
Go to line 72
mix phx.server
Go to line 73
```
Go to line 75
Hexpm will be available at [http://localhost:4000/](http://localhost:4000/).
Go to line 77
## License
Go to line 79
Copyright 2015 Six Colors AB
Go to line 81
Licensed under the Apache License, Version 2.0 (the "License");
Go to line 82
you may not use this file except in compliance with the License.
Go to line 83
You may obtain a copy of the License at
Go to line 85
http://www.apache.org/licenses/LICENSE-2.0
Go to line 87
Unless required by applicable law or agreed to in writing, software
Go to line 88
distributed under the License is distributed on an "AS IS" BASIS,
Go to line 89
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Go to line 90
See the License for the specific language governing permissions and
Go to line 91
limitations under the License.