Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/CaptainFact/captain-fact-api
π CaptainFact - API. The one that serves and process all the data for https://captainfact.io
https://github.com/CaptainFact/captain-fact-api
absinthe elixir graphql hacktoberfest phoenix
Last synced: 8 days ago
JSON representation
π CaptainFact - API. The one that serves and process all the data for https://captainfact.io
- Host: GitHub
- URL: https://github.com/CaptainFact/captain-fact-api
- Owner: CaptainFact
- License: agpl-3.0
- Created: 2018-08-22T13:52:31.000Z (about 6 years ago)
- Default Branch: staging
- Last Pushed: 2024-10-16T06:00:51.000Z (24 days ago)
- Last Synced: 2024-10-30T05:43:05.684Z (10 days ago)
- Topics: absinthe, elixir, graphql, hacktoberfest, phoenix
- Language: Elixir
- Homepage:
- Size: 4.22 MB
- Stars: 188
- Watchers: 10
- Forks: 26
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - A collaborative, real-time video fact-checking platform. ([Docs](https://captainfact.io/)). (Applications)
- fucking-awesome-elixir - CaptainFact - A collaborative, real-time video fact-checking platform. ([Docs](https://captainfact.io/)). (Applications)
- awesome-elixir - CaptainFact - A collaborative, real-time video fact-checking platform. ([Docs](https://captainfact.io/)). (Applications)
README
CaptainFact.io
# Install & Run
## Prerequisites
You need to install Elixir. We recommand using [asdf-vm](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 PostgreSQL instance on your local machine. If you have
Docker installed, you can use the pre-Seed PostgreSQL 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.create` --> Create DB
- `mix ecto.migrate` --> Migrate DB
- `iex -S mix` --> Start projectFollowing services will be started:
- [localhost:4000](http://localhost:4000) - REST API
- [localhost:4001](https://localhost:4001) - REST API (HTTPS)
- [localhost:4002](http://localhost:4002) - GraphQL API
- [localhost:4003](https://localhost:4003) - GraphQL API (HTTPS)
- [localhost:4004](http://localhost:4004) - Atom feedYou 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](https://elixir-lang.org/getting-started/mix-otp/dependencies-and-umbrella-apps.html) 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
- [Community discussions and documentation](https://github.com/CaptainFact/captain-fact/)
- [Front-end](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)