Giter VIP home page Giter VIP logo

captain-fact-api's Introduction

Discord AGPL3 Coverage Status




Install & Run

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)

    • 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

Following services will be started:

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.

Project architecture

Elixir offers very nice ways to separate concerns and work with microservices. This application is organized as an umbrella project which allows us to divide CaptainFact API into small apps.

File structure

.
โ”œโ”€โ”€ 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.

Styling

Code should follow Elixy Style Guide and Credo style guide as much as possible.

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

Linked projects

Feature requests

Feature Requests

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.