Skip to content

Commit

Permalink
Merge pull request #62 from CaptainFact/chore/delete-dev-scripts
Browse files Browse the repository at this point in the history
Delete docker dev scripts
  • Loading branch information
Betree committed Dec 9, 2018
2 parents 2b57e8f + 58add13 commit 9c80ec8
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 243 deletions.
53 changes: 20 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,26 @@
<hr/>
<br/>

## Install & Run
# Install & Run

### Start DB
## Prerequisites

You need to install Elixir. We recommand using [asdf](https://github.com/asdf-vm/asdf#setup).
Check their documentation on how to install it, then run `asdf install` from
root `captain-fact-api` folder.

## Start DB

Create / launch a postgres instance on your local machine. If you have
docker installed, you can use the pre-seed postgres docker image:

`docker run -d --name cf_dev_db -p 5432:5432 captainfact/dev-db:latest`

### Start API services

- Without Docker (recommended if you want to make changes in the API)
## Start API

- `mix deps.get`
- `mix ecto.migrate`
- `iex -S mix`

- With Docker
- Download project's dependencies with `./dev/get_dependencies.sh`
- Migrate your database with `./dev/db_migrate.sh`
- Start server with `./dev/start_server.sh`
- `mix deps.get` --> Get dependencies
- `mix ecto.migrate` --> Migrate DB
- `iex -S mix` --> Start project

Following services will be started:

Expand All @@ -46,16 +45,16 @@ Following services will be started:
- [localhost:4003](https://localhost:4003) - GraphQL API (https)
- [localhost:4004](http://localhost:4004) - Atom feed

You can run tests with `./dev/test.sh`. You can filter which tests to run by
running something like `./dev/test.sh test/your_test_subpath`.
Check `./dev/test.sh` script comments for details.
## Other useful commands

## Project architecture
- `mix test` --> Run tests
- `mix test.watch` --> Run tests watcher
- `mix format` --> Format code
- `mix ecto.gen.migration [migration_name]` --> Generate migration

Elixir offers very nice ways to separate concerns and work with microservices.
This application is organized as an [umbrella project](https://elixir-lang.org/getting-started/mix-otp/dependencies-and-umbrella-apps.html) which allows us to divide CaptainFact API into small apps.
# Project architecture

### File structure
This application is organized as an [umbrella project](https://elixir-lang.org/getting-started/mix-otp/dependencies-and-umbrella-apps.html) which allows us to divide CaptainFact API into small apps.

```
.
Expand All @@ -82,21 +81,9 @@ This application is organized as an [umbrella project](https://elixir-lang.org/g
│   └── config.exs => Releases configuration.
```

## Styling

Code should follow [Elixy Style Guide](https://github.com/christopheradams/elixir_style_guide)
and [Credo style guide](https://github.com/rrrene/elixir-style-guide)
as much as possible.

Avoid lines longer than 80 characters, **never** go beyond 110 characters.

## Linked projects
# Linked projects

- [Community discussions and documentation](https://github.com/CaptainFact/captain-fact/)
- [Frontend](https://github.com/CaptainFact/captain-fact-frontend)
- [Extension](https://github.com/CaptainFact/captain-fact-extension)
- [Overlay injector](https://github.com/CaptainFact/captain-fact-overlay-injector)

# Feature requests

[![Feature Requests](http://feathub.com/CaptainFact/captain-fact?format=svg)](http://feathub.com/CaptainFact/captain-fact)
2 changes: 0 additions & 2 deletions dev/_common.sh

This file was deleted.

23 changes: 0 additions & 23 deletions dev/check_gitlab_ci.sh

This file was deleted.

44 changes: 0 additions & 44 deletions dev/check_release.sh

This file was deleted.

12 changes: 0 additions & 12 deletions dev/code_style.sh

This file was deleted.

13 changes: 0 additions & 13 deletions dev/db_gen_migration.sh

This file was deleted.

12 changes: 0 additions & 12 deletions dev/db_migrate.sh

This file was deleted.

3 changes: 0 additions & 3 deletions dev/docker_recreate_db.sh

This file was deleted.

11 changes: 0 additions & 11 deletions dev/get_dependencies.sh

This file was deleted.

27 changes: 0 additions & 27 deletions dev/run_command.sh

This file was deleted.

17 changes: 0 additions & 17 deletions dev/start_server.sh

This file was deleted.

23 changes: 0 additions & 23 deletions dev/test.sh

This file was deleted.

23 changes: 0 additions & 23 deletions dev/watch_test.sh

This file was deleted.

0 comments on commit 9c80ec8

Please sign in to comment.