-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
377 changed files
with
517,408 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { createSupabaseDirectClient } from 'shared/supabase/init' | ||
import { APIHandler } from './helpers/endpoint' | ||
|
||
export const createStonkImage: APIHandler<'create-stonk-image'> = async ( | ||
props, | ||
_auth | ||
) => { | ||
const { contractId, imageUrl } = props | ||
|
||
const pg = createSupabaseDirectClient() | ||
|
||
const image = await pg.oneOrNone( | ||
`insert into stonk_images (contract_id, image_url) | ||
values ($1, $2) returning *`, | ||
[contractId, imageUrl] | ||
) | ||
|
||
return { success: true } | ||
} |
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,25 @@ | ||
import { StonkImage } from 'common/stonk-images' | ||
import { createSupabaseDirectClient } from 'shared/supabase/init' | ||
import { APIHandler } from './helpers/endpoint' | ||
|
||
export const getStonkImages: APIHandler<'get-stonk-images'> = async ({ | ||
contracts, | ||
}) => { | ||
const pg = createSupabaseDirectClient() | ||
|
||
const images = await pg.manyOrNone<{ | ||
contract_id: string | ||
image_url: string | ||
}>( | ||
`select * from stonk_images where contract_id in (${contracts | ||
.map((id) => `'${id}'`) | ||
.join(',')})` | ||
) | ||
|
||
return { | ||
images: images.map((i) => ({ | ||
contractId: i.contract_id, | ||
imageUrl: i.image_url, | ||
})), | ||
} | ||
} |
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,4 @@ | ||
export type StonkImage = { | ||
contractId: string | ||
imageUrl: string | ||
} |
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,34 @@ | ||
#!/bin/bash | ||
|
||
ENV=${1:-dev} | ||
DEBUG=${2:-false} | ||
|
||
case $ENV in | ||
dev) | ||
FIREBASE_PROJECT=dev | ||
NEXT_ENV=DEV ;; | ||
prod) | ||
FIREBASE_PROJECT=prod | ||
NEXT_ENV=PROD ;; | ||
*) | ||
echo "Invalid environment; must be dev or prod." | ||
exit 1 | ||
esac | ||
|
||
firebase use $FIREBASE_PROJECT | ||
|
||
API_COMMAND="dev" | ||
if [ "$DEBUG" = "true" ]; then | ||
API_COMMAND="debug" | ||
fi | ||
|
||
# Run all services concurrently | ||
npx concurrently \ | ||
-n API,STONKS,TS \ | ||
-c white,magenta,cyan \ | ||
"cross-env NEXT_PUBLIC_FIREBASE_ENV=${NEXT_ENV} \ | ||
yarn --cwd=backend/api $API_COMMAND" \ | ||
"cross-env NEXT_PUBLIC_API_URL=localhost:8088 \ | ||
NEXT_PUBLIC_FIREBASE_ENV=${NEXT_ENV} \ | ||
yarn --cwd=stonks dev" \ | ||
"cross-env yarn --cwd=stonks ts-watch" |
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,3 @@ | ||
{ | ||
"pages": {} | ||
} |
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,54 @@ | ||
{ | ||
"pages": { | ||
"/_app": [ | ||
"static/chunks/node_modules_next_dist_fda55f._.js", | ||
"static/chunks/08b5e_react-dom_82bb97._.js", | ||
"static/chunks/08b5e_4258f4._.js", | ||
"static/chunks/[root of the server]__aee949._.js", | ||
"static/chunks/[root of the server]__1fb947._.css", | ||
"static/chunks/pages__app_5771e1._.js", | ||
"static/chunks/pages__app_519130._.js" | ||
], | ||
"/": [ | ||
"static/chunks/[root of the server]__f4d4c0._.js", | ||
"static/chunks/node_modules_next_dist_fda55f._.js", | ||
"static/chunks/08b5e_react-dom_82bb97._.js", | ||
"static/chunks/08b5e_@firebase_auth_dist_esm2017_e15f0c._.js", | ||
"static/chunks/08b5e_lodash_87206f._.js", | ||
"static/chunks/08b5e_zod_lib_index_mjs_02ef09._.js", | ||
"static/chunks/08b5e_@supabase_gotrue-js_dist_module_b16fed._.js", | ||
"static/chunks/08b5e_prosemirror-view_dist_index_bca8cb.js", | ||
"static/chunks/08b5e_@tiptap_core_dist_tiptap-core_esm_8c5828.js", | ||
"static/chunks/08b5e_@firebase_storage_dist_index_esm2017_0c4756.js", | ||
"static/chunks/[project]__6eceda._.js", | ||
"static/chunks/08b5e_@supabase_node-fetch_browser_bb8cad.js", | ||
"static/chunks/pages_index_5771e1._.js", | ||
"static/chunks/pages_index_7f8975._.js" | ||
], | ||
"/uploader": [ | ||
"static/chunks/[root of the server]__b2c1f9._.js", | ||
"static/chunks/node_modules_next_dist_fda55f._.js", | ||
"static/chunks/08b5e_react-dom_82bb97._.js", | ||
"static/chunks/08b5e_@firebase_auth_dist_esm2017_e15f0c._.js", | ||
"static/chunks/08b5e_lodash_778523._.js", | ||
"static/chunks/08b5e_zod_lib_index_mjs_02ef09._.js", | ||
"static/chunks/08b5e_@supabase_gotrue-js_dist_module_b16fed._.js", | ||
"static/chunks/08b5e_prosemirror-view_dist_index_bca8cb.js", | ||
"static/chunks/08b5e_@tiptap_core_dist_tiptap-core_esm_8c5828.js", | ||
"static/chunks/08b5e_@firebase_storage_dist_index_esm2017_0c4756.js", | ||
"static/chunks/08b5e_993a80._.js", | ||
"static/chunks/08b5e_@supabase_node-fetch_browser_d61b7b.js", | ||
"static/chunks/pages_uploader_5771e1._.js", | ||
"static/chunks/pages_uploader_a9ebf5._.js" | ||
] | ||
}, | ||
"devFiles": [], | ||
"ampDevFiles": [], | ||
"polyfillFiles": [], | ||
"lowPriorityFiles": [ | ||
"static/development/_ssgManifest.js", | ||
"static/development/_buildManifest.js" | ||
], | ||
"rootMainFiles": [], | ||
"ampFirstPages": [] | ||
} |
Oops, something went wrong.