Skip to content
API server and website for Hex
Elixir HTML CSS Other
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets Move billing checkout callback Aug 12, 2019
config Upgrade to phoenix 1.4 and webpack (#812) Aug 10, 2019
lib Move billing checkout callback Aug 12, 2019
priv Split registry building (#838) Aug 10, 2019
rel Replace Distillery with Elixir releases (#801) May 28, 2019
test Split registry building (#838) Aug 10, 2019
.credo.exs Rename repository to organization (#691) Jun 15, 2018
.dockerignore Add docker build Sep 27, 2018
.ebert.yml Upgrade to phoenix 1.4 and webpack (#812) Aug 10, 2019
.eslintrc.js Fix more linter warnings Dec 16, 2016
.formatter.exs Support service key creation for hexdocs service (#699) Jul 31, 2018
.gitignore Use hex_registry (#647) Mar 19, 2018
.scss-lint.yml Add ebert configuration Dec 15, 2016
.travis.yml Use Elixir v1.9.0 and OTP 22 in .travis.yml Jul 2, 2019
Dockerfile Update dependencies (#840) Aug 10, 2019
README.md
cloudbuild.yaml Add docker build Sep 27, 2018
mix.exs Update dependencies (#840) Aug 10, 2019
mix.lock Update dependencies (#840) Aug 10, 2019

README.md

Hexpm

Build Status

Contributing

To contribute to Hexpm you need to properly set up your development environment.

Also see the client repository: 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.

Setup

  1. Run mix setup to install dependencies, create and seed database etc
  2. Run mix test
  3. Run iex -S mix phx.server and visit http://localhost:4000/

After this succeeds you should be good to go!

See setup alias in mix.exs and sections below for more information or when you run into issues.

PostgreSQL Modules And Version

PostgreSQL version should be >= 9.4, as Hexpm uses the jsonb type, that is available from PostgreSQL 9.4 onward.

Hexpm requires the PostgreSQL modules pg_trgm and pgcrypto to be available.

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.

Database

By default, Hexpm connects to a localhost PostgreSQL database hexpm_dev using the username postgres with the password postgres.

Create the database and user 'postgres' if not already done:

CREATE USER postgres;
ALTER USER postgres PASSWORD 'postgres';
CREATE DATABASE hexpm_dev;
GRANT ALL PRIVILEGES ON DATABASE hexpm_dev TO postgres;
ALTER USER postgres WITH SUPERUSER;

-- if you also want to setup the test database
CREATE DATABASE hexpm_test;
GRANT ALL PRIVILEGES ON DATABASE hexpm_test TO postgres;

Now you are fine to run the ecto migrations:

mix ecto.migrate

Sample Data

Using the following command you can seed your local Hexpm instance with some sample data:

mix run priv/repo/seeds.exs

Node Dependencies

For assets compilation we need to install Node dependencies:

cd assets && yarn install

If you don't have yarn installed, cd assets && npm install will work too.

Running Hexpm

Once the database is set up you can start Hexpm:

# with console
iex -S mix phx.server

# without console
mix phx.server

Hexpm will be available at http://localhost:4000/.

License

Copyright 2015 Six Colors AB

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You can’t perform that action at this time.