Skip to content
πŸ”Ž CaptainFact - API. The one that serves and process all the data for https://captainfact.io
Branch: staging
Clone or download
Betree and dependabot-bot chore(deps-dev): bump excoveralls from 0.10.3 to 0.10.6 (#154)
chore(deps-dev): bump excoveralls from 0.10.3 to 0.10.6

Co-authored-by: Dependabot <support@dependabot.com>
Latest commit 62ba4cf Apr 27, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
apps rel: Bump version to 1.0.3 Apr 13, 2019
config
rel fix(RuntimeConfig): Basic auth password Mar 29, 2019
.dockerignore Removed weave entirely Nov 5, 2018
.formatter.exs format formatter config Jul 31, 2018
.gitignore chore(Notifications): MarkAsSeen and refactors Mar 16, 2019
.tool-versions Properly delete actions for deleted videos in migration Sep 24, 2018
.travis.yml
CHANGELOG.md feat(Changelog): Create initial CHANGELOG.md Apr 12, 2019
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md Aug 27, 2018
Dockerfile Move :cf_utils to main :cf lib Nov 5, 2018
LICENSE Add AGPL3 license Aug 22, 2018
README.md dev(Emails): Make the procedure clearer Dec 24, 2018
mix.exs chore(deps-dev): bump credo from 0.10.0 to 1.0.0 Jan 1, 2019
mix.lock

README.md

CaptainFact.io

Discord AGPL3 Coverage Status




Install & Run

Prerequisites

You need to install Elixir. We recommand using asdf. 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

  • mix deps.get --> Get dependencies
  • mix ecto.migrate --> Migrate DB
  • iex -S mix --> Start project

Following services will be started:

You can also see all the mail sent by going to http://localhost:4000/_dev/mail

Other useful commands

  • mix test --> Run tests
  • mix test.watch --> Run tests watcher
  • mix format --> Format code
  • mix ecto.gen.migration [migration_name] --> Generate migration

Project architecture

This application is organized as an umbrella project which allows us to divide CaptainFact API into small apps.

.
β”œβ”€β”€ apps
β”‚Β Β  β”œβ”€β”€ cf => Core functions as a library. **Not deployed**
β”‚Β Β  β”œβ”€β”€ cf_atom_feed => Atom feed.
β”‚Β Β  β”œβ”€β”€ cf_graphql => GraphQL API (public).
β”‚Β Β  β”œβ”€β”€ cf_jobs => Jobs.
β”‚Β Β  β”œβ”€β”€ cf_opengraph => An app that generate opengraph tags.
β”‚Β Β  β”œβ”€β”€ cf_rest_api => REST/WS API (private).
β”‚Β Β  └── db => DB repository and schemas **Not deployed**
β”‚Β Β      β”œβ”€β”€ lib
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ db
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ db_schema => Contains all the schemas (Video, Speaker, Comment...etc)
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ db_type => Special types (SpeakerPicture...etc)
β”‚Β Β      β”‚Β Β  └── db_utils => Some utils functions
β”‚Β Β      └── priv
β”‚Β Β       Β Β  └── repo/migrations => All DB migrations files
β”œβ”€β”€ README.md => You're reading it right now. Are you?
β”œβ”€β”€ rel => Release configs & tools
β”‚Β Β  β”œβ”€β”€ commands => Commands that will be available to run on the release (seed DB...etc)
β”‚Β Β  β”œβ”€β”€ hooks => Some hooks for automatically run commands when release run.
β”‚Β Β  β”œβ”€β”€ runtime_config => Runtime configurations for all apps.
β”‚Β Β  └── config.exs => Releases configuration.

Linked projects

You can’t perform that action at this time.