-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reroll Epic Stack again, Experiments with Weather API (#76)
* re-roll epic-stack to remix 2.0 15Sept2023 release * Experimenting with Remix & weather API Co-authored-by: plocket <[email protected]> Co-authored-by: Gavin Kimball <[email protected]> Co-authored-by: Leopardfoot <[email protected]> --------- Co-authored-by: plocket <[email protected]> Co-authored-by: Gavin Kimball <[email protected]> Co-authored-by: Leopardfoot <[email protected]>
- Loading branch information
1 parent
0f8484b
commit 76c5687
Showing
206 changed files
with
14,661 additions
and
9,941 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,7 +111,16 @@ jobs: | |
uses: actions/cache@v3 | ||
with: | ||
path: prisma/data.db | ||
key: db-cache | ||
key: | ||
db-cache-schema_${{ hashFiles('./prisma/schema.prisma') | ||
}}-migrations_${{ hashFiles('./prisma/migrations/*/migration.sql') | ||
}} | ||
|
||
- name: 🌱 Seed Database | ||
if: steps.db-cache.outputs.cache-hit != 'true' | ||
run: npx prisma db seed | ||
env: | ||
MINIMAL_SEED: true | ||
|
||
- name: 🏗 Build | ||
run: npm run build | ||
|
@@ -153,20 +162,20 @@ jobs: | |
mv ./other/Dockerfile ./Dockerfile | ||
mv ./other/.dockerignore ./.dockerignore | ||
- name: 🎈 Setup Fly | ||
uses: superfly/flyctl-actions/[email protected] | ||
|
||
- name: 🚀 Deploy Staging | ||
if: ${{ github.ref == 'refs/heads/dev' }} | ||
uses: superfly/[email protected] | ||
with: | ||
args: | ||
'deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} --app | ||
${{ steps.app_name.outputs.value }}-staging' | ||
run: | ||
flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} | ||
--app ${{ steps.app_name.outputs.value }}-staging | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | ||
|
||
- name: 🚀 Deploy Production | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
uses: superfly/[email protected] | ||
with: | ||
args: 'deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }}' | ||
run: | ||
flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} | ||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
node_modules | ||
.DS_Store | ||
.DS_store | ||
|
||
/build | ||
/public/build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
{ | ||
"recommendations": [ | ||
"bradlc.vscode-tailwindcss", | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"prisma.prisma", | ||
"bradlc.vscode-tailwindcss" | ||
"qwtel.sqlite-viewer", | ||
"yoavbls.pretty-ts-errors", | ||
"github.vscode-github-actions" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import test from "@playwright/test"; | ||
import { json } from "@remix-run/node"; // or cloudflare/deno | ||
import { useLoaderData } from "@remix-run/react"; | ||
|
||
export async function loader() { | ||
const href = 'https://archive-api.open-meteo.com/v1/archive?latitude=52.52&longitude=13.41&daily=temperature_2m_max&timezone=America%2FNew_York&start_date=2022-01-01&end_date=2023-08-30&temperature_unit=fahrenheit'; | ||
const res = await fetch(href); | ||
return json(await res.json()); | ||
} | ||
|
||
export function WeatherExample() { | ||
|
||
const gists = useLoaderData<typeof loader>(); | ||
return ( | ||
<ul> | ||
{'5'} | ||
</ul> | ||
); | ||
} | ||
|
||
// import { useFetcher } from "@remix-run/react"; | ||
// import { useEffect } from "react"; | ||
|
||
// export function WeatherExample() { | ||
|
||
// // 2 separate routes - including one that doesn't load | ||
// // the python to avoid the long restart times. | ||
|
||
// /* | ||
// Historical archival records API: https://archive-api.open-meteo.com/v1/archive?latitude=52.52&longitude=13.41&daily=temperature_2m_max&timezone=America%2FNew_York&start_date=2022-01-01&end_date=2023-08-30&temperature_unit=fahrenheit | ||
// Current week forecast API: https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41&daily=temperature_2m_max&timezone=America%2FNew_York&past_days=5&forecast_days=1&temperature_unit=fahrenheit | ||
// */ | ||
// const fetcher = useFetcher(); | ||
// const href = 'https://archive-api.open-meteo.com/v1/archive?latitude=52.52&longitude=13.41&daily=temperature_2m_max&timezone=America%2FNew_York&start_date=2022-01-01&end_date=2023-08-30&temperature_unit=fahrenheit'; | ||
|
||
// // trigger the fetch with these | ||
// // <fetcher.Form method="GET" action="https://archive-api.open-meteo.com/v1/archive?latitude=52.52&longitude=13.41&daily=temperature_2m_max&timezone=America%2FNew_York&start_date=2022-01-01&end_date=2023-08-30&temperature_unit=fahrenheit" />; | ||
|
||
// // fetcher.load(href) | ||
|
||
// useEffect(() => { | ||
// // fetcher.submit(data, options); | ||
// fetcher.load(href); | ||
// }, []); | ||
|
||
// // // build UI with these | ||
// // fetcher.state; | ||
// // fetcher.formMethod; | ||
// // fetcher.formAction; | ||
// // fetcher.formData; | ||
// // fetcher.formEncType; | ||
// // fetcher.data; | ||
// return ( | ||
// <div>{ fetcher.data }</div> | ||
// ) | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { useEffect } from 'react' | ||
import { Toaster, toast as showToast } from 'sonner' | ||
import { type Toast } from '#app/utils/toast.server.ts' | ||
|
||
export function EpicToaster({ toast }: { toast?: Toast | null }) { | ||
return ( | ||
<> | ||
<Toaster closeButton position="top-center" /> | ||
{toast ? <ShowToast toast={toast} /> : null} | ||
</> | ||
) | ||
} | ||
|
||
function ShowToast({ toast }: { toast: Toast }) { | ||
const { id, type, title, description } = toast | ||
useEffect(() => { | ||
setTimeout(() => { | ||
showToast[type](title, { id, description }) | ||
}, 0) | ||
}, [description, id, title, type]) | ||
return null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.