Skip to content

Commit

Permalink
improve readme and config
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-aurele-besner committed Sep 1, 2024
1 parent ad3f28e commit f3db76e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 6 deletions.
53 changes: 48 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,53 @@
# Fileonchain

To start the server:
Fileonchain is a secure file storage solution that allows anyone to upload small and large files to any substrate network, making them permanently available on-chain ⛓️.

* Run `docker compose up` in one terminal window to start Postgres and Hasura
* Run `mix setup` to install and setup dependencies
* Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`
## Official Links

- Website: [https://fileonchain.org](https://fileonchain.org)
- Twitter/X: [@fileonchain](https://twitter.com/fileonchain)

## Getting Started

### Using Docker Compose

1. Ensure you have Docker and Docker Compose installed on your system.

2. Clone the repository and navigate to the project directory.

3. Create a `.env` file in the root directory with the following environment variables:
```
DB_PASSWORD=your_db_password
DB_PORT=5432
DB_USER=your_db_user
HASURA_GRAPHQL_ADMIN_SECRET=your_hasura_admin_secret
DATABASE_URL=postgres://your_db_user:your_db_password@db:5432/fileonchain
SECRET_KEY_BASE=your_secret_key_base
PHX_HOST=localhost
```

4. Run the following command to start all services:
```
docker compose up
```

5. Once all containers are up and running, you can access:
- The Phoenix application at [`http://localhost:4000`](http://localhost:4000)
- The Hasura GraphQL engine at [`http://localhost:8080`](http://localhost:8080)

### Manual Setup (for development)

If you prefer to run the services separately:

1. Run `docker compose up db graphql-engine` to start Postgres and Hasura.
2. Run `mix setup` to install and setup dependencies.
3. Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`.

Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.

Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html).
## Live Demo

You can try out the live demo of Fileonchain at [https://staging.fileonchain.org/](https://staging.fileonchain.org/).

## Learn more

Expand All @@ -17,3 +56,7 @@ Ready to run in production? Please [check our deployment guides](https://hexdocs
* Docs: https://hexdocs.pm/phoenix
* Forum: https://elixirforum.com/c/phoenix-forum
* Source: https://github.com/phoenixframework/phoenix

## Deployment

Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html).
1 change: 0 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ config :fileonchain,
# Configures the endpoint
config :fileonchain, FileonchainWeb.Endpoint,
url: [host: System.get_env("PHX_HOST") || "localhost"],
check_origin: [System.get_env("PHX_HOST") || "localhost"],
adapter: Bandit.PhoenixAdapter,
render_errors: [
formats: [html: FileonchainWeb.ErrorHTML, json: FileonchainWeb.ErrorJSON],
Expand Down

0 comments on commit f3db76e

Please sign in to comment.