Skip to content

Commit 8632452

Browse files
author
Matthieu Segret
committed
Write readme
1 parent 0802f3f commit 8632452

File tree

2 files changed

+129
-13
lines changed

2 files changed

+129
-13
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Matthieu Segret
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 108 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,119 @@
1-
# README
1+
# GraphQL Rails Blog
22

3-
This README would normally document whatever steps are necessary to get the
4-
application up and running.
3+
This application can be used as **starter kit** if you want to get started building an app with **Rails**, **React**, and **GraphQL**.
4+
This is a simple blog engine using ordinary features which can be found in most web applications.
55

6-
Things you may want to cover:
6+
## Technologies
77

8-
* Ruby version
8+
### Frontend
99

10-
* System dependencies
10+
- [React](https://facebook.github.io/react) - A JavaScript library for building user interfaces. It introduces many great concepts, such as, Virtual DOM, Data flow, etc.
11+
- [Babel](https://babeljs.io) - Babel is a JavaScript compiler which allows you to use next generation, ES6/ES7, JavaScript... today.
12+
- [Sass](http://sass-lang.com) - Sass is an extension of CSS, adding nested rules, variables, mixins, selector inheritance, and more.
13+
- [Redux](https://github.com/reactjs/redux) - Redux is a predictable state container for JavaScript apps
14+
- [Redux Form](http://redux-form.com/) - A Higher Order Component using react-redux to keep form state in a Redux store.
15+
- [Apollo](http://dev.apollodata.com/) - A flexible, fully-featured GraphQL client for every platform.
16+
- [Webpack 2 (with hot reloading)](https://webpack.js.org/) - webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser. Yet it is also capable of transforming, bundling, or packaging just about any resource or asset.
17+
- [ESlint](http://eslint.org/) - ESlint is a pluggable linting utility for JavaScript, and JSX.
1118

12-
* Configuration
19+
### Backend
1320

14-
* Database creation
21+
- Ruby 2.3
22+
- Rails 5
23+
- [Devise](https://github.com/plataformatec/devise) - Devise is a flexible authentication solution for Rails based on [Warden](https://github.com/hassox/warden).
24+
- [Active admin](http://activeadmin.info/) - Active Admin is a Ruby on Rails plugin for generating administration style interfaces.
25+
- [GraphQL-Ruby](https://github.com/rmosolgo/graphql-ruby) - GraphQL-Ruby is a Ruby implementation of [GraphQL](http://graphql.org).
26+
- [GraphQL-batch](https://github.com/Shopify/graphql-batch) - GraphQL-batch is a query batching executor for the graphql gem.
27+
- [Graphiql](https://github.com/graphql/graphiql) - Graphiql is an in-browser IDE for exploring GraphQL.
28+
- [Rack CORS](https://github.com/cyu/rack-cors) - Rack Middleware for handling Cross-Origin Resource Sharing (CORS), which makes cross-origin AJAX possible.
29+
- [Optics Agent](http://www.apollodata.com/optics) - Optics Agent for GraphQL Monitoring
30+
- SQLite3 for development and PostgreSQL for production.
1531

16-
* Database initialization
32+
## Features
1733

18-
* How to run the test suite
34+
- CRUD (create / read / update / delete) on posts
35+
- Creating comments on post page
36+
- Pagination on posts listing
37+
- Searching on posts
38+
- Authentication with Devise and authorizations (visitors, users, admins)
39+
- Creating user account
40+
- Update user profile and changing password
41+
- Setup dev tools
42+
- Application ready for production
1943

20-
* Services (job queues, cache servers, search engines, etc.)
44+
## GraphQL Using
2145

22-
* Deployment instructions
46+
- Queries et mutations
47+
- FetchMore for pagination
48+
- Integrating with Redux and updating store
49+
- Optimistic UI
50+
- Colocate data / component with fragments
51+
- Validation management and integration with Redux Form
52+
- Authentication and authorizations
53+
- Protect queries and mutations on GraphQL API
54+
- Batching of SQL queries side backend
2355

24-
* ...
56+
## Prerequisites
57+
58+
- Ruby 2.3
59+
- [Node.js](https://nodejs.org) v6 or newer + [Yarn](https://yarnpkg.com) package manager
60+
- SQLite3
61+
62+
## Getting Started
63+
64+
- Install Bundler
65+
66+
$ gem install bundler
67+
68+
- Checkout the graphql-rails-blog git tree from Github
69+
70+
$ git clone https://github.com/MatthieuSegret/graphql-rails-blog.git
71+
$ cd graphql-rails-blog
72+
graphql-rails-blog$
73+
74+
- Run Bundler to install/bundle gems needed by the project:
75+
76+
graphql-rails-blog$ bundle
77+
78+
- Create the database:
79+
80+
graphql-rails-blog$ rails db:migrate
81+
82+
- Load sample records:
83+
84+
graphql-rails-blog$ rails db:seed
85+
86+
- Run the Rails server in development mode
87+
88+
graphql-rails-blog$ rails server
89+
90+
- Run Yarn to install javascript package in other terminal:
91+
92+
graphql-rails-blog$ cd client
93+
graphql-rails-blog/client$ yarn
94+
95+
- Start client in development mode. You should be able to go to
96+
`http://localhost:8080` :
97+
98+
graphql-rails-blog/client$ npm start
99+
100+
## Next step
101+
102+
- [ ] Upgrade to last version of Apollo. Until now I had to downgrade to version 0.5.21 because of a bug on *updatequeries* ([https://github.com/apollographql/apollo-client/issues/1129](https://github.com/apollographql/apollo-client/issues/1129))
103+
- [ ] Use [query batching in Apollo](https://dev-blog.apollodata.com/query-batching-in-apollo-63acfd859862#.dusr3dyde). Until now GraphQL-Ruby does not support this functionality in a simple way
104+
- [ ] Parallelism in GraphQL-Ruby
105+
106+
## Screens
107+
108+
#### Listing posts
109+
<img alt="Listing posts" src="https://d17oy1vhnax1f7.cloudfront.net/items/463k3o2E2l1Z3N1J3230/listing-posts.png?v=b0949e51" width="500">
110+
111+
#### Creating comments
112+
<img alt="Creating comments" src="https://d3uepj124s5rcx.cloudfront.net/items/152S143C2l1a2r0N2n37/creating-comments.png?v=b8dfc71e" width="500">
113+
114+
#### Post page
115+
<img alt="Post page" src="https://d17oy1vhnax1f7.cloudfront.net/items/0G2h1l1v2b0I2y1t0j3F/get-post.png?v=6ae0993c" width="500">
116+
117+
## License
118+
119+
MIT © [Matthieu Segret](http://matthieusegret.com)

0 commit comments

Comments
 (0)