{"id":16309715,"url":"https://github.com/pytal/sapi","last_synced_at":"2025-10-09T11:41:58.381Z","repository":{"id":104148451,"uuid":"282088158","full_name":"Pytal/Sapi","owner":"Pytal","description":"Meet your food buddy 😋","archived":false,"fork":false,"pushed_at":"2020-07-24T01:03:51.000Z","size":16509,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T18:54:47.209Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pytal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-24T00:52:46.000Z","updated_at":"2020-11-02T20:17:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"0e9ed8a6-9731-46e7-a8d2-192337415fc5","html_url":"https://github.com/Pytal/Sapi","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"cf2170b251df0e39282f432d8838c8995a75a2cf"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pytal/Sapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pytal%2FSapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pytal%2FSapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pytal%2FSapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pytal%2FSapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pytal","download_url":"https://codeload.github.com/Pytal/Sapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pytal%2FSapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001300,"owners_count":26083059,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T21:22:20.239Z","updated_at":"2025-10-09T11:41:58.364Z","avatar_url":"https://github.com/Pytal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align='center'\u003e\n  \u003ca href='https://sapi-app.now.sh'\u003e\n    \u003cimg alt='Sapi Logo' src='client/public/assets/sapi-logo-180x180.png' width='120'/\u003e\n    \u003ch3 align='center'\u003eSapi\u003c/h3\u003e\n  \u003c/a\u003e\n  \u003cp align='center'\u003eMeet your food buddy 😋\u003c/p\u003e\n\u003c/p\u003e\n\n\n\n## Features\nSapi 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!\n\n- 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\n- Find restaurants to meet up with your food buddies and have a great conversation\n- Carry on your conversations on the app then check out your incoming spoons and send back some re-spoons\n- Add details about yourself to your profile including a bio, favourite foods, and eating styles\n\n\n\n## Documentation\n- [Codebase Overview](#codebase-overview)\n- [Tech Decisions](#tech-decisions)\n- [How to Develop](#how-to-develop)\n- [Screenshots](#screenshots)\n- [FAQ](#faq)\n\n\n\n## Codebase Overview\nThis section gives an overview of the codebase structure.\n\n### Top-level folders\n- [`server`](server/) backend deployment and configuration files\n- [`client`](client/) frontend codebase and serverless functions\n\n### [`server`](server/) folder\n- [`docker-compose.yaml`](server/docker-compose.yaml) orchestration of GraphQL-Engine and Caddy containers\n- [`Caddyfile`](server/Caddyfile) Caddy config file to make the GraphQL endpoint available over HTTPS\n- [`.env.template`](server/.env.template), [`.env.graphql-engine.template`](server/.env.graphql-engine.template), [`.env.caddy.template`](server/.env.caddy.template) environment variable template files for Docker containers\n- [`migrate/`](server/migrate/) folder containing PostgreSQL migrations and GraphQL-Engine metadata\n- [`auth0/`](server/auth0/) folder containing Auth0 Rules for connecting Auth0 to Hasura GraphQL-Engine\n\n### [`client`](client/) folder\n- [`src/`](client/src/) folder containing Next.js codebase\n- [`codegen.yaml`](client/codegen.yaml), [`schemagen.yaml`](client/schemagen.yaml), [`allowlistgen.yaml`](client/allowlistgen.yaml) config files for GraphQL Code Generator\n- [`apollo.config.js`](client/apollo.config.js) config file for the [Apollo GraphQL extension](https://marketplace.visualstudio.com/items?itemName=apollographql.vscode-apollo) for vscode to provide intellisense for GraphQL queries\n- [`next.config.js`](client/next.config.js) Next.js config file\n- [`package.json`](client/package.json) project dependencies, scripts, babel config, et cetera\n\n\n\n## Tech Decisions\nThis section details the decisions behind the tech stack.\n\n### Backend\n- [Hasura GraphQL-Engine](https://github.com/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\n- [Caddy](https://github.com/caddyserver/caddy) minimal-config reverse proxy server with Automatic HTTPS\n- [Auth0](https://auth0.com/) secure authentication service that comes with integration with Hasura and Next.js\n\n### Frontend\n- [Next.js](https://nextjs.org) 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:\n  - [`@auth0/nextjs-auth0`](https://github.com/auth0/nextjs-auth0) interoperability between Auth0 and Next.js\n  - [`framer-motion`](https://github.com/framer/motion) animation library with intuitive API and physics-based animations\n  - [`linaria`](https://github.com/callstack/linaria) CSS-in-JS library with a familiar Styled Components / Emotion API plus static CSS extraction\n  - [`recoil`](https://github.com/facebookexperimental/Recoil) highly flexible React state management system\n  - [`urql`](https://github.com/FormidableLabs/urql) lightweight React hooks based GraphQL client\n\n- Development Tools\n  - [GraphQL Code Generator](https://github.com/dotansimha/graphql-code-generator) utility for generating typed GraphQL queries / mutations / subscriptions\n\n\n\n## How to Develop\nThis section will guide you through setting up a development environment.\n\n### Development Prerequisites\n1. Yelp API Key [Instructions](https://www.yelp.com/developers/documentation/v3/authentication)\n2. Google Maps API Key [Instructions](https://developers.google.com/maps/documentation/embed/get-api-key#get-the-api-key)\n3. Auth0 Application Setup [Instructions](https://github.com/auth0/nextjs-auth0#getting-started)\n4. Auth0 + Hasura GraphQL-Engine Integration [Instructions](https://hasura.io/docs/1.0/graphql/manual/guides/integrations/auth0-jwt.html)\n5. Environment Variables entered into `.env-cmdrc.json` using [`.env-cmdrc.template.json`](client/.env-cmdrc.template.json) as a starting point (remember to remove `.template` from the filename) containing the following key value pairs 👇\n\n#### Env Template\n``` json\n{\n  \"dev\": {\n    \"AUTH0_DOMAIN\": \"[Auth0 Domain]\",\n    \"AUTH0_CLIENT_ID\": \"[Auth0 Client ID]\",\n    \"AUTH0_CLIENT_SECRET\": \"[Auth0 Client Secret]\",\n    \"AUTH0_SCOPE\": \"[Auth0 Scope]\",\n    \"AUTH0_REDIRECT\": \"[Post-login URL redirect]\",\n    \"AUTH0_LOGOUT_REDIRECT\": \"Post-logout URL redirect\",\n    \"AUTH0_SESSION_COOKIE_SECRET\": \"[Secret used to encrypt the session cookie]\",\n    \"NEXT_PUBLIC_GOOGLE_MAPS_APIKEY\": \"[Google Maps API Key]\",\n    \"NEXT_PUBLIC_GRAPHQL_ENDPOINT\": \"[GraphQL server endpoint]\"\n  },\n  \"graphql\": {\n    \"NEXT_PUBLIC_GRAPHQL_ENDPOINT\": \"[GraphQL server endpoint]\",\n    \"GRAPHQL_ENDPOINT_HEADER_NAME\": \"X-Hasura-Admin-Secret\",\n    \"GRAPHQL_ENDPOINT_HEADER_VALUE\": \"[Hasura Admin Secret]\"\n  }\n}\n```\n\n### Development Setup\nThis project uses [`pnpm`](https://github.com/pnpm/pnpm) although you may use your preferred package manager ([`npm`](https://github.com/npm/cli) / [`yarn`](https://github.com/yarnpkg/yarn))\n\nFollow these steps to setup a development environment:\n\n#### Backend\n1. Register a domain name which will point to your GraphQL server\n2. Deploy a PostgreSQL instance on AWS RDS [Instructions](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_GettingStarted.CreatingConnecting.PostgreSQL.html#CHAP_GettingStarted.Creating.PostgreSQL)\n3. Deploy a Linux instance on AWS EC2 [Instructions](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html#ec2-launch-instance)\n4. Ensure that your RDS and EC2 instances are on the same [VPC](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.Scenarios.html#USER_VPC.Scenario1) to allow communication between them\n5. SSH into your EC2 instance [Instructions](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html)\n6. Clone this repo\n7. In the [`server`](server/) folder remove the `.template` suffix from the [`.env.template`](server/.env.template), [`.env.graphql-engine.template`](server/.env.graphql-engine.template), and [`.env.caddy.template`](server/.env.caddy.template) files and add your environment variables\n8. Run `sudo docker-compose up` to start the GraphQL-Engine and Caddy containers\n9. In the [`migrate`](server/migrate/) folder remove the `.template` suffix from the [`.env.template`](server/migrate/.env.template) file and add your environment variables\n10. Install the Hasura CLI `npm add -g hasura-cli` then run `hasura migrate apply` and `hasura metadata apply`\n\n#### Frontend\n11. `npm run gen:s` generate a local copy of the GraphQL schema\n12. `npm run gen` generate the GraphQL Operation files into [`client/src/operations`](client/src/operations)\n13. `npm run dev` start a local Next.js development server\n\n\n\n## Screenshots\n\n### Home\n\u003cdiv style='display:flex;'\u003e\n  \u003cimg alt='Home Page' src='client/screenshots/home/home.png' width='300'/\u003e\n  \u003cimg alt='Search' src='client/screenshots/home/search.png' width='300'/\u003e\n  \u003cimg alt='Search Results' src='client/screenshots/home/search-results.png' width='300'/\u003e\n  \u003cimg alt='Share Widget' src='client/screenshots/home/share.png' width='300'/\u003e\n  \u003cimg alt='Restaurant Page' src='client/screenshots/home/restaurant.png' width='300'/\u003e\n\u003c/div\u003e\n\n### Nearby\n\u003cdiv style='display:flex;'\u003e\n  \u003cimg alt='Nearby Page' src='client/screenshots/nearby/nearby.png' width='300'/\u003e\n  \u003cimg alt=\"Jessica's Profile\" src='client/screenshots/nearby/jessica-profile.png' width='300'/\u003e\n  \u003cimg alt=\"Tommy's Profile\" src='client/screenshots/nearby/tommy-profile.png' width='300'/\u003e\n\u003c/div\u003e\n\n### Conversations\n\u003cdiv style='display:flex;'\u003e\n  \u003cimg alt='Conversations Page' src='client/screenshots/conversations/conversations.png' width='300'/\u003e\n  \u003cimg alt='Chat with Sarah' src='client/screenshots/conversations/sarah-chat.png' width='300'/\u003e \n  \u003cimg alt='Spoons Section' src='client/screenshots/conversations/spoons.png' width='300'/\u003e\n\u003c/div\u003e\n\n### Profile\n\u003cdiv style='display:flex;'\u003e\n  \u003cimg alt='My Profile Page' src='client/screenshots/profile/profile.png' width='300'/\u003e\n\u003c/div\u003e\n\n\n\n## FAQ\n- *Q: Why is it called Sapi?*\n  - *A:* The name, *Sapi*, is derived from the Latin word, *sapidus*, meaning *tasty*.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpytal%2Fsapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpytal%2Fsapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpytal%2Fsapi/lists"}