GraphQL-Medium-Clone icon indicating copy to clipboard operation
GraphQL-Medium-Clone copied to clipboard

GraphQL API of a Medium clone. Ready to use in your front end application :star:

project_logo

Build Status Conventional Commits

A project to learn a lot of tecnologies and build something awesome and great inspired on Medium.

You can use this API to create your own front end to study new frameworks of stacks.

Getting Started

The easy way to start is to clone this repo, read the prerequisites and then get a Ruby package manager to install everything. We recommend rbenv or RVM to handler this task.

Prerequisites

  • Ruby v2.4.2
  • Gem v2.6.14+
  • Bundler v1.16.1+

Installing

Get only one package manager and install Ruby depending of your choice

$ rbenv install 2.4.2
$ rvm install 2.4.2

Then follow the next instrucctions:

  1. Integrate bundler :
$ gem install bundler
  1. Go to the Project's directory and install all the dependencies with:
$ bundle install
  1. Configurate the Data Base with:
$ rails db:schema:load && rails db:seed

Docker Compose

Resource: https://www.digitalocean.com/community/tutorials/containerizing-a-ruby-on-rails-application-for-development-with-docker-compose

$ docker-compose up -d
$ docker-compose exec app bundle exec rake db:setup db:migrate db:seed

How to build the Dockerfile without Docker Compose

$ docker run --name database_for_ruby -e POSTGRES_DB=medium_graphql -e POSTGRES_PASSWORD=password -p 5432:5432 -d postgres:9.4
$ docker build . -t ruby && docker run --env-file ./.env -p 3000:3000 --link database_for_ruby ruby -t ruby_graphql_backend

Check http://localhost:3000/graphiql

Built With

  • Ruby on Rails
  • Graphql - Query language for APIs
  • JWT

You can build your own front end, some ideas:

  • React - JavaScript library for building user interfaces
  • Apollo - Get everything you need from Graphql.
  • React Native - Cross platform mobile framework
  • Angular
  • Svelte
  • Electron

Project Status

Backend ready to use, tested. But you can improve this, some ideas:

  • Cache Strategies
  • Send emails for events like register, recover password.