Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucas-aragno/sinatra-graphql
Trailblazer + Sequel + Sinatra + GraphQL + React + PostCSS
https://github.com/lucas-aragno/sinatra-graphql
Last synced: 1 day ago
JSON representation
Trailblazer + Sequel + Sinatra + GraphQL + React + PostCSS
- Host: GitHub
- URL: https://github.com/lucas-aragno/sinatra-graphql
- Owner: lucas-aragno
- Created: 2017-07-30T21:10:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-19T19:56:47.000Z (about 7 years ago)
- Last Synced: 2024-08-01T22:49:30.557Z (3 months ago)
- Language: Ruby
- Homepage:
- Size: 45.9 KB
- Stars: 69
- Watchers: 8
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sinatra-graphql starter kit
This is an **opinionated** skeleton app that uses [Sinatra](https://github.com/sinatra/sinatra), [Trailblazer](http://trailblazer.to), [Apollo](dev.apollodata.com/react/) as a [GraphQL](http://graphql.org/learn/) client and of course [React](https://facebook.github.io/react)
# How to run it
Install the ruby dependencies:
```bash
bundle
```Install the JS dependencies
```bash
npm install
```
or```bash
yarn install
```or
```bash
pnpm install
```or whatever floats your boat.
Then set up the ENV vars
```bash
cp .env.sample .env
```and change the sample to what applies to your project/machine
```bash
GRAPHQL_URL="http://localhost:5000/graphql"
DATABASE_NAME="todo-sinatra"
DATABASE_USER="lucas"
DATABASE_PASSWORD="security"
DATABASE_HOST="localhost"
DATABASE_PORT="5432"
```once all the dependencies are installed you can either run
```bash
./bin/server
```if you have [foreman](https://github.com/ddollar/foreman) installed, otherwise you can open 2 terminals and run:
```bash
bundle exec unicorn -p 5000 -E "development" -c config/unicorn.rb
```and
```bash
npm run webpack:dev
```on each one.