GithubHelp home page GithubHelp logo

drewfenwick / flora-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from flora-pm/flora-server

0.0 0.0 0.0 2.66 MB

A package index for the Haskell ecosystem

Home Page: https://flora.pm/about

License: Other

Shell 0.98% JavaScript 1.49% Haskell 85.14% CSS 5.16% VCL 0.11% Nix 4.99% Makefile 1.12% PLpgSQL 0.60% Dockerfile 0.40%

flora-server's Introduction

Flora
A package index for the Haskell ecosystem

Logo

CI badge made with Haskell Matrix chatroom badge

Flora.pm
A read-only mirror of hackage.haskell.org with an improved and lightweight interface.

Flora Server
An alternative package index server for the Haskell ecosystem with mirroring capabilities.

Read More

Installation and Configuration

Read the Contribution Guide file to see what you will need.

For Nix users, a build system based on flakes is maintained on a “best-effort” basis. Improvements are very welcome.

Flora server

The configuration is handled through environment variables. They are all prefixed by FLORA_ to avoid conflict, and the server will tell you which ones are missing.

To start in the best of conditions, create a file called environment.local.sh with the following content:

source environment.sh

# export FLORA_SENTRY_DSN="" # Don't forget to add your Sentry DSN if you use it!
# export FLORA_PROMETHEUS_ENABLED="true"

This will get all the variables from environment.sh and allow you to override them.

You can then build the server with

# To start a tmux session with code reloading for frontend and backend:
$ make start-tmux
# To explore the other possible `make` rules:
$ make help

Database

The Flora server uses PostgreSQL 14.

To create the database and apply the migrations, type:

$ make db-setup # Implies db-create

you can also use db-create and db-drop to create and delete the database in the PostgreSQL instance.

Docker Workflow

A docker-based workflow is provided. The idea is to develop from within a container that brings with it all dependencies, and communicates with another container for the PostgreSQL database.

# You need to build the container first. It's gonna take around 13 minutes the first time you build
$ make docker-build
# Start the container.
$ make docker-start
# Once the containers are running, you can enter the development environment and start hacking
$ make docker-enter
# You'll be in the docker container. Environment variables are automatically set 
# so you should be able to start Flora
(docker)$ make start-tmux
# You'll be in a tmux session, everything should be launched
# Visit localhost:8084 from your web browser to see if it all works.

# To provision the development database, type:
$ make docker-enter
(docker)$ source environment.docker.sh
(docker)$ make db-drop  # password is 'postgres' by default
(docker)$ make db-setup # password is 'postgres' by default
(docker)$ make db-provision
# And you should be good!

Importing everything from Hackage

  1. Download the archive containing all packages here
  2. Extract it in Flora's root directory. You should now have a 01-index folder
  3. Run make import-from-hackage

You can explore the Makefile rules by typing make in your shell.

flora-server's People

Contributors

tchoutri avatar gbogard avatar mergify[bot] avatar jappeace avatar gabriella439 avatar taneb avatar dependabot[bot] avatar alexandretunstall avatar noughtmare avatar kristianbalaj avatar morrowm avatar theophile-scrive avatar silky 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.