└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # GREAT ⭑ BEAR 2 | Food delivery sample application metarepo (PostgreSQL / GraphQL / React). 3 | 4 | ### Repositories 5 | * React + Apollo Frontend: https://github.com/sastraxi/great-bear-frontend 6 | * [Hasura GraphQL Engine](https://github.com/hasura/graphql-engine) backend: https://github.com/sastraxi/great-bear-hasura 7 | * [PostGraphile](https://postgraphile.org) backend: https://github.com/sastraxi/great-bear-postgraphile 8 | 9 | The docs in each repository will guide you through setup. 10 | 11 | ### Tools used 12 | * VSCode + Plugins 13 | * [GraphQL Playground](https://github.com/prisma/graphql-playground) 14 | * [pgsh](https://github.com/sastraxi/pgsh) 15 | 16 | --- 17 | 18 | ### Work-in-progress presentation 19 | * https://docs.google.com/presentation/d/11cpgG0O2LA16ewefyFsgJNcP6aQKR8K9pOURGPAU36s/edit?usp=sharing 20 | 21 | ### Outline 22 | * attempt at a fair comparison between Hasura and PostGraphile 23 | * why these 2 technologies (why graphql)? 24 | * why is a food delivery website the best app to build? 25 | * event triggers ("microservices") 26 | * subscriptions ("push notifications") 27 | * methodology? 28 | * stay as close to technology-specific best practices 29 | * what are you measuring? 30 | * nloc (sql, ts) 31 | * keep best practices wrt security, frontend tech 32 | * cookies 33 | * react hooks (not everything yet) 34 | * styled-components - keeps css near the js 35 | * postgresql 36 | * denormalized database - don't prematurely optimise 37 | * camel_case vs snakeCase 38 | * auditability 39 | * security, speed, etc. etc. its a good database mmmmkay? 40 | * aim for the absolute bare minimum of backend boilerplate 41 | * event system 42 | * hasura: built-in, console helps hugely with debugging 43 | * postgraphile: pg-pubsub, capture + subscribe to events ourselves 44 | * developer experience 45 | * hasura: docker not shutting down cleanly, no js extensibility 46 | * postgraphile: lots of setup, lots of power. well thought-out APIs. 47 | * differences in approach 48 | * hasura: external "appliance", column security + public schema 49 | * postgraphile: external or library, RLS, different schemas (no col. security) 50 | * takeaways 51 | * order of work: hasura, then postgraphile 52 | 53 | ### Navigation idea 54 | * first section is the "article", second section is technical detail 55 | * after first section, link to next repo ("next page in the article") 56 | 57 | ### What's left to do 58 | * build a test harness to run performance / integration tests 59 | * we can use https://www.postgresql.org/docs/11/pgstatstatements.html to get queries / stats 60 | * compare some generated SQL in the presentation 61 | --------------------------------------------------------------------------------