Meet your food buddy π
Sapi is an app for finding food buddies. Think of it as a cross between Tinder and Yelp, you'll have both great conversations and tasty food on Sapi!
- Meet new people nearby, check out their favourite foods, and send a spoon π₯ (you can think of it as a like π) then start up a new conversation
- Find restaurants to meet up with your food buddies and have a great conversation
- Carry on your conversations on the app then check out your incoming spoons and send back some re-spoons
- Add details about yourself to your profile including a bio, favourite foods, and eating styles
This section gives an overview of the codebase structure.
server folder
- docker-compose.yamlorchestration of GraphQL-Engine and Caddy containers
- CaddyfileCaddy config file to make the GraphQL endpoint available over HTTPS
- .env.template,- .env.graphql-engine.template,- .env.caddy.templateenvironment variable template files for Docker containers
- migrate/folder containing PostgreSQL migrations and GraphQL-Engine metadata
- auth0/folder containing Auth0 Rules for connecting Auth0 to Hasura GraphQL-Engine
client folder
- src/folder containing Next.js codebase
- codegen.yaml,- schemagen.yaml,- allowlistgen.yamlconfig files for GraphQL Code Generator
- apollo.config.jsconfig file for the Apollo GraphQL extension for vscode to provide intellisense for GraphQL queries
- next.config.jsNext.js config file
- package.jsonproject dependencies, scripts, babel config, et cetera
This section details the decisions behind the tech stack.
- Hasura GraphQL-Engine was chosen due to the robust set of features, extensive configuration, and instant zero-config GraphQL API provided ontop of a PostgreSQL database
- Caddy minimal-config reverse proxy server with Automatic HTTPS
- Auth0 secure authentication service that comes with integration with Hasura and Next.js
- 
Next.js was chosen as the frontend React-based framework due to the included flexible routing system and static-site generation. The following packages are used client-side: - @auth0/nextjs-auth0interoperability between Auth0 and Next.js
- framer-motionanimation library with intuitive API and physics-based animations
- linariaCSS-in-JS library with a familiar Styled Components / Emotion API plus static CSS extraction
- recoilhighly flexible React state management system
- urqllightweight React hooks based GraphQL client
 
- 
Development Tools - GraphQL Code Generator utility for generating typed GraphQL queries / mutations / subscriptions
 
This section will guide you through setting up a development environment.
- Yelp API Key Instructions
- Google Maps API Key Instructions
- Auth0 Application Setup Instructions
- Auth0 + Hasura GraphQL-Engine Integration Instructions
- Environment Variables entered into .env-cmdrc.jsonusing.env-cmdrc.template.jsonas a starting point (remember to remove.templatefrom the filename) containing the following key value pairs π
{
  "dev": {
    "AUTH0_DOMAIN": "[Auth0 Domain]",
    "AUTH0_CLIENT_ID": "[Auth0 Client ID]",
    "AUTH0_CLIENT_SECRET": "[Auth0 Client Secret]",
    "AUTH0_SCOPE": "[Auth0 Scope]",
    "AUTH0_REDIRECT": "[Post-login URL redirect]",
    "AUTH0_LOGOUT_REDIRECT": "Post-logout URL redirect",
    "AUTH0_SESSION_COOKIE_SECRET": "[Secret used to encrypt the session cookie]",
    "NEXT_PUBLIC_GOOGLE_MAPS_APIKEY": "[Google Maps API Key]",
    "NEXT_PUBLIC_GRAPHQL_ENDPOINT": "[GraphQL server endpoint]"
  },
  "graphql": {
    "NEXT_PUBLIC_GRAPHQL_ENDPOINT": "[GraphQL server endpoint]",
    "GRAPHQL_ENDPOINT_HEADER_NAME": "X-Hasura-Admin-Secret",
    "GRAPHQL_ENDPOINT_HEADER_VALUE": "[Hasura Admin Secret]"
  }
}This project uses pnpm although you may use your preferred package manager (npm / yarn)
Follow these steps to setup a development environment:
- Register a domain name which will point to your GraphQL server
- Deploy a PostgreSQL instance on AWS RDS Instructions
- Deploy a Linux instance on AWS EC2 Instructions
- Ensure that your RDS and EC2 instances are on the same VPC to allow communication between them
- SSH into your EC2 instance Instructions
- Clone this repo
- In the serverfolder remove the.templatesuffix from the.env.template,.env.graphql-engine.template, and.env.caddy.templatefiles and add your environment variables
- Run sudo docker-compose upto start the GraphQL-Engine and Caddy containers
- In the migratefolder remove the.templatesuffix from the.env.templatefile and add your environment variables
- Install the Hasura CLI npm add -g hasura-clithen runhasura migrate applyandhasura metadata apply
- npm run gen:sgenerate a local copy of the GraphQL schema
- npm run gengenerate the GraphQL Operation files into- client/src/operations
- npm run devstart a local Next.js development server
- Q: Why is it called Sapi?
- A: The name, Sapi, is derived from the Latin word, sapidus, meaning tasty.
 
 
    










