Skip to content

Commit

Permalink
feat: minimal functional gallery app with pasic routing api calls xat…
Browse files Browse the repository at this point in the history
…a db
  • Loading branch information
denniswon committed Feb 27, 2024
1 parent e7b4c7a commit c18fecc
Show file tree
Hide file tree
Showing 101 changed files with 6,648 additions and 612 deletions.
13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
NODE_ENV=<YOUR_NODE_ENV>

ALCHEMY_KEY=<YOUR_ALCHEMY_KEY>
NEXT_PUBLIC_ALCHEMY_GAS_MANAGER_POLICY_ID=<YOUR_ALCHEMY_GAS_MANAGER_POLICY_ID>

# Xata credentials
XATA_BRANCH=main
XATA_API_KEY=

# Setting to true will disable API / UI to write to the database
READ_ONLY=false

NEXT_TELEMETRY_DISABLED=1
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
next.config.mjs
69 changes: 69 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* @type {import("eslint").Linter.Config}
*/
{
"parser": "@typescript-eslint/parser",

"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"project": "tsconfig.json"
},
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:jsx-a11y/recommended",
"prettier",
"next",
"next/core-web-vitals",
"plugin:jsx-a11y/recommended"
],
"plugins": ["react", "jsx-a11y", "check-file"],
"rules": {
"import/extensions": ["off", "ignorePackages"],
"no-unused-expressions": ["error", { "enforceForJSX": true }],
"import/no-default-export": 0,
"import/no-anonymous-default-export": 0,
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"jsx-a11y/no-autofocus": 0,
"jsx-a11y/alt-text": 0,
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_", "ignoreRestSiblings": true }
],
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-explicit-any": "off",
"react/jsx-curly-brace-presence": [
1,
{ "props": "never", "propElementValues": "always" }
],
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "lodash",
"importNames": ["default"],
"message": "Please import only the functions you need to reduce bundle size. E.g. import { range } from 'lodash'"
}
]
}
]
},
"overrides": [
{
"files": ["*.test.ts{,x}"],
"rules": {
"no-restricted-imports": 0 // this are purely for bundle size
}
},
{
"files": ["*.stories.ts{,x}"],
"rules": {
"import/no-default-export": 0 // storybook uses default export
}
}
]
}
2 changes: 2 additions & 0 deletions app/.gitignore → .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

.eslintcache
11 changes: 11 additions & 0 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

function changed {
git diff --name-only HEAD@{1} HEAD | grep "^$1" > /dev/null 2>&1
}

if changed 'yarn-lock.json'; then
echo "Lockfile changes detected. Installing updates..."
yarn install
fi
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

./node_modules/.bin/lint-staged
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/.git
**/.svn
**/.hg
**/node_modules
10 changes: 10 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
tabWidth: 2,
singleQuote: true,
semi: true,
trailingComma: 'none',
printWidth: 120,
endOfLine: 'auto',
plugins: ['prettier-plugin-organize-imports'],
organizeImportsSkipDestructiveCodeActions: true
};
4 changes: 4 additions & 0 deletions .prettierrc.precommit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
...require('./.prettierrc'),
organizeImportsSkipDestructiveCodeActions: false
};
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"SocketSecurity.vscode-socket-security",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"juanblanco.vscode-solidity"
]
}
14 changes: 14 additions & 0 deletions .xata/migrations/.ledger
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
mig_cnegf4e7cb53crnrs05g_4d9f7b07
mig_cnegfhu7cb53crnrs06g_854a0463
mig_cnegfsa97ik6pd01gssg_c87d6a92
mig_cnegg2q97ik6pd01gsu0_e11f9782
mig_cnegg8297ik6pd01gsv0_4febcc54
mig_cnegghm7cb53crnrs07g_0ea38b94
mig_cnegh7u7cb53crnrs08g_ee8b86aa
mig_cneghbe7cb53crnrs09g_d052962b
mig_cneghde7cb53crnrs0ag_8fdfe99f
mig_cneghge7cb53crnrs0bg_e04f9746
mig_cneghl67cb53crnrs0cg_447a1967
mig_cneghne7cb53crnrs0dg_479c1b4e
mig_cnegi8297ik6pd01gt00_54c09449
mig_cnegic67cb53crnrs0eg_42b12a10
11 changes: 11 additions & 0 deletions .xata/migrations/mig_cnegf4e7cb53crnrs05g_4d9f7b07.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"id": "mig_cnegf4e7cb53crnrs05g",
"checksum": "1:4d9f7b07a2307597eb6e40b32eeeb51d3cf904155ac8f63b6006e821c3095324",
"operations": [
{
"addTable": {
"table": "tag"
}
}
]
}
18 changes: 18 additions & 0 deletions .xata/migrations/mig_cnegfhu7cb53crnrs06g_854a0463.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"id": "mig_cnegfhu7cb53crnrs06g",
"parentID": "mig_cnegf4e7cb53crnrs05g",
"checksum": "1:854a046348884ba7fe9a2eec5c46a95c60a3be6a1c27d3889773873e70f7d354",
"operations": [
{
"addColumn": {
"column": {
"name": "name",
"type": "string",
"notNull": true,
"defaultValue": "gallery"
},
"table": "tag"
}
}
]
}
12 changes: 12 additions & 0 deletions .xata/migrations/mig_cnegfsa97ik6pd01gssg_c87d6a92.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "mig_cnegfsa97ik6pd01gssg",
"parentID": "mig_cnegfhu7cb53crnrs06g",
"checksum": "1:c87d6a92fc9cb4594de92b44a4449d6284c57dad29ee3aadf0bf932cfbf3cd6e",
"operations": [
{
"addTable": {
"table": "tag-to-image"
}
}
]
}
12 changes: 12 additions & 0 deletions .xata/migrations/mig_cnegg2q97ik6pd01gsu0_e11f9782.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "mig_cnegg2q97ik6pd01gsu0",
"parentID": "mig_cnegfsa97ik6pd01gssg",
"checksum": "1:e11f978240ed60fd8646deabd205eb434a6924c35b65ad00dcd407cec717590a",
"operations": [
{
"addTable": {
"table": "image"
}
}
]
}
18 changes: 18 additions & 0 deletions .xata/migrations/mig_cnegg8297ik6pd01gsv0_4febcc54.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"id": "mig_cnegg8297ik6pd01gsv0",
"parentID": "mig_cnegg2q97ik6pd01gsu0",
"checksum": "1:4febcc548fb0d698eb95a5ae61b15015a5d5ecadb6c3dd8b1764db84f0e884ee",
"operations": [
{
"addColumn": {
"column": {
"name": "name",
"type": "string",
"notNull": true,
"defaultValue": "Image"
},
"table": "image"
}
}
]
}
19 changes: 19 additions & 0 deletions .xata/migrations/mig_cnegghm7cb53crnrs07g_0ea38b94.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"id": "mig_cnegghm7cb53crnrs07g",
"parentID": "mig_cnegg8297ik6pd01gsv0",
"checksum": "1:0ea38b94cdecebbc63e25d0c11b11bf4e98acdf628bab4600731dfd1ae6c3b93",
"operations": [
{
"addColumn": {
"column": {
"name": "image",
"type": "file",
"file": {
"defaultPublicAccess": true
}
},
"table": "image"
}
}
]
}
13 changes: 13 additions & 0 deletions .xata/migrations/mig_cnegh7u7cb53crnrs08g_ee8b86aa.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "mig_cnegh7u7cb53crnrs08g",
"parentID": "mig_cnegghm7cb53crnrs07g",
"checksum": "1:ee8b86aafc3cb4234d59ee8835affb932d329a245c8972829581e0730b7a0316",
"operations": [
{
"removeColumn": {
"column": "name",
"table": "image"
}
}
]
}
18 changes: 18 additions & 0 deletions .xata/migrations/mig_cneghbe7cb53crnrs09g_d052962b.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"id": "mig_cneghbe7cb53crnrs09g",
"parentID": "mig_cnegh7u7cb53crnrs08g",
"checksum": "1:d052962b0775e6832ee385d4f63a908ede3461939b6796646183ff3c801c2133",
"operations": [
{
"addColumn": {
"column": {
"name": "name",
"type": "string",
"notNull": true,
"defaultValue": "Image"
},
"table": "image"
}
}
]
}
13 changes: 13 additions & 0 deletions .xata/migrations/mig_cneghde7cb53crnrs0ag_8fdfe99f.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "mig_cneghde7cb53crnrs0ag",
"parentID": "mig_cneghbe7cb53crnrs09g",
"checksum": "1:8fdfe99f06d594637139d54bb5c95a45ece5c00ca2f3cbac821bf5f6d75f97ab",
"operations": [
{
"removeColumn": {
"column": "image",
"table": "image"
}
}
]
}
19 changes: 19 additions & 0 deletions .xata/migrations/mig_cneghge7cb53crnrs0bg_e04f9746.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"id": "mig_cneghge7cb53crnrs0bg",
"parentID": "mig_cneghde7cb53crnrs0ag",
"checksum": "1:e04f97463544ca7afc812072fa5fbc0e304e88376b29e44b249edbd2db085eb2",
"operations": [
{
"addColumn": {
"column": {
"name": "image",
"type": "link",
"link": {
"table": "tag-to-image"
}
},
"table": "image"
}
}
]
}
13 changes: 13 additions & 0 deletions .xata/migrations/mig_cneghl67cb53crnrs0cg_447a1967.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "mig_cneghl67cb53crnrs0cg",
"parentID": "mig_cneghge7cb53crnrs0bg",
"checksum": "1:447a1967c1da2197fe596ef066fde6904915c4f055445b63e0120efb16d3d1a6",
"operations": [
{
"removeColumn": {
"column": "image",
"table": "image"
}
}
]
}
19 changes: 19 additions & 0 deletions .xata/migrations/mig_cneghne7cb53crnrs0dg_479c1b4e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"id": "mig_cneghne7cb53crnrs0dg",
"parentID": "mig_cneghl67cb53crnrs0cg",
"checksum": "1:479c1b4e6d914be053152902a61d654aee36a406d1e007f4881031fb0feacf30",
"operations": [
{
"addColumn": {
"column": {
"name": "image",
"type": "file",
"file": {
"defaultPublicAccess": true
}
},
"table": "image"
}
}
]
}
19 changes: 19 additions & 0 deletions .xata/migrations/mig_cnegi8297ik6pd01gt00_54c09449.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"id": "mig_cnegi8297ik6pd01gt00",
"parentID": "mig_cneghne7cb53crnrs0dg",
"checksum": "1:54c09449fe5f046b55ab435302c3638df0edbad68a598c4a57b61d3f6a9cdad5",
"operations": [
{
"addColumn": {
"column": {
"name": "image",
"type": "link",
"link": {
"table": "image"
}
},
"table": "tag-to-image"
}
}
]
}
19 changes: 19 additions & 0 deletions .xata/migrations/mig_cnegic67cb53crnrs0eg_42b12a10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"id": "mig_cnegic67cb53crnrs0eg",
"parentID": "mig_cnegi8297ik6pd01gt00",
"checksum": "1:42b12a10f82c1a3d6379009feb9c2739e47dd2c5aac0975adb3e1243c2247862",
"operations": [
{
"addColumn": {
"column": {
"name": "tag",
"type": "link",
"link": {
"table": "tag"
}
},
"table": "tag-to-image"
}
}
]
}
Loading

0 comments on commit c18fecc

Please sign in to comment.