Project Awesome project awesome

CaptainFact

A collaborative, real-time video fact-checking platform. (Docs).

Package 189 stars GitHub

CaptainFact.io

Discord

AGPL3 GitHub release CI Status Coverage Status




Install & Run

Prerequisites

You need to install Elixir. We recommand using asdf-vm. Check their documentation on how to install it, then run asdf install from root captain-fact-api folder.

Start DB

Create or launch a PostgreSQL instance (e.g. local install or Docker). With Docker:

docker run -d --name cf_dev_db -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust -e POSTGRES_DB=captain_fact_dev postgres:16

Start API

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

Following services will be started:

You can also see all e-mail sent, by going to http://localhost:4000/\_dev/mail

Other useful commands

  • mix test --> Run tests
  • mix test.watch --> Run test 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_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 utility 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 => Release configuration.

Linked projects

Back to Elixir