Skip to content

civis-vote/civis-api

Repository files navigation

Civis API

This repository contains the codebase for the Civis API. Civis is a bridge between citizens and Governments, to ensure that people's voice isn't just heard but acknowledged and acted upon by those in power. More information about Civis can be found here.


Platform Architecture

  • The platform implements a public GraphQL API.
  • Authentication is managed via an access_token which is sent as an Authorization Header.
  • User Interfaces consume the GraphQL API (including the primary interface i.e www.civis.vote)
  • The ERD of the platform can be found here.

image-20200429202910834


Tech Stack

  • Ruby on Rails

System Requirements


Third Party Tools


Deployment

  • The deployment is triggered via Travis configured via the travis.yml file.
  • Upon building the app, a Cloud66 webhook is triggered which finally pushes the code to the server.
  • Servers are hosted on Google Cloud and managed by Cloud66.

Credentials

  • Postmark API Key
  • AWS Access Key & Secret
  • Sentry DSN link
  • Google Client ID and Secret
  • Facebook App ID and Secret

Environment Variables

  • CLIENT_HOST
  • HOST
  • RAILS_MASTER_KEY

Running locally

  • To run this project in localhost, do the following:
    • bundle install
    • rails db:setup
    • rails s
  • To seed the database run rails db:seed

Notes

  • The project uses a few scripts to import data, the commands are -
    • rails import_records_from_csv:ministry_categories
    • rails import_records_from_csv:ministries
    • rails import_records_from_csv:locations
    • rails import_records_from_csv:consultations
    • rails import_records_from_csv:point_scale
  • The API is based on GraphQL and hosted on BASE_URL/graphql
  • If you encountered active storage attachment errors
    • PG::UndefinedTable - ERROR: relation "active_storage_attachments" does not exist
    • run rails active_storage:install and migrate

About

No description, website, or topics provided.

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
License.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published