Skip to content

Commit f0388ed

Browse files
committed
feat: ✨ Create pay app in monorepo
1 parent c359710 commit f0388ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1587
-163
lines changed
File renamed without changes.
File renamed without changes.

.gitignore

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,24 @@ out
44
coverage
55
.DS_Store
66
.turbo
7-
.vercel/
8-
.env
7+
.env
8+
9+
# Output
10+
.output
11+
.vercel
12+
.svelte-kit
13+
build
14+
15+
# OS
16+
.DS_Store
17+
Thumbs.db
18+
19+
# Env
20+
.env
21+
.env.*
22+
!.env.example
23+
!.env.test
24+
25+
# Vite
26+
vite.config.js.timestamp-*
27+
vite.config.ts.timestamp-*
File renamed without changes.

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte"],
7+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
8+
}

.vscode/settings.json

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
{
2-
"css.lint.unknownAtRules": "ignore",
3-
"editor.defaultFormatter": "esbenp.prettier-vscode",
4-
"[svelte]": {
5-
"editor.defaultFormatter": "svelte.svelte-vscode"
6-
},
7-
"[css]": {
8-
"editor.defaultFormatter": "esbenp.prettier-vscode"
9-
},
10-
"[prisma]": {
11-
"editor.defaultFormatter": "Prisma.prisma"
12-
},
13-
"cSpell.words": ["skeletonlabs"]
2+
"css.lint.unknownAtRules": "ignore",
3+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4+
"[svelte]": {
5+
"editor.defaultFormatter": "svelte.svelte-vscode"
6+
},
7+
"[css]": {
8+
"editor.defaultFormatter": "esbenp.prettier-vscode"
9+
},
10+
"[prisma]": {
11+
"editor.defaultFormatter": "Prisma.prisma"
12+
},
13+
"cSpell.words": ["skeletonlabs"],
14+
"[dotenv]": {
15+
"editor.defaultFormatter": "foxundermoon.shell-format"
16+
},
17+
"[ignore]": {
18+
"editor.defaultFormatter": "foxundermoon.shell-format"
19+
}
1420
}

apps/app/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
"devDependencies": {
2424
"@changesets/cli": "^2.27.7",
2525
"@eslint/js": "^9.8.0",
26-
"@melt-ui/pp": "^0.3.2",
27-
"@melt-ui/svelte": "^0.83.0",
2826
"@playwright/test": "^1.45.3",
2927
"@skeletonlabs/skeleton": "^2.10.2",
3028
"@skeletonlabs/tw-plugin": "^0.4.0",
@@ -65,8 +63,8 @@
6563
"pnpm": ">=8"
6664
},
6765
"dependencies": {
68-
"@floating-ui/dom": "^1.6.8",
6966
"@invoicelink/db": "workspace:*",
67+
"@floating-ui/dom": "^1.6.8",
7068
"@lucia-auth/adapter-prisma": "4.0.1",
7169
"@paralleldrive/cuid2": "^2.2.2",
7270
"@prisma/client": "5.17.0",

apps/app/src/app.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@
8686
}
8787

8888
.input-primary-invoice {
89-
@apply w-full rounded-lg border-none bg-base-100 py-2 read-only:cursor-not-allowed focus:border-none focus:ring-0 disabled:cursor-not-allowed disabled:text-base-content;
89+
@apply bg-base-100 disabled:text-base-content w-full rounded-lg border-none py-2 read-only:cursor-not-allowed focus:border-none focus:ring-0 disabled:cursor-not-allowed;
9090
}
9191

9292
.input-invoice {
9393
@apply hover:input-primary-invoice focus:input-primary-invoice m-0 w-full truncate border-none bg-transparent px-0 text-sm tabular-nums transition-all hover:px-2 focus:px-2;
9494
}
9595

9696
.btn-pay-now {
97-
@apply w-36 bg-base-content text-base-100 hover:bg-base-content hover:bg-opacity-80;
97+
@apply bg-base-content text-base-100 hover:bg-base-content w-36 hover:bg-opacity-80;
9898
}
9999

100100
.input-welcome {

apps/app/svelte.config.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
import { preprocessMeltUI } from '@melt-ui/pp';
21
import sequence from 'svelte-sequential-preprocessor';
32
import adapter from '@sveltejs/adapter-vercel';
43
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
4+
55
/** @type {import('@sveltejs/kit').Config}*/
66
const config = {
7-
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
8-
// for more information about preprocessors
9-
preprocess: sequence([vitePreprocess(), preprocessMeltUI()]),
7+
preprocess: sequence([vitePreprocess()]),
108
kit: {
11-
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
12-
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
13-
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
149
adapter: adapter(),
1510
csrf: {
1611
checkOrigin: false // added custom hook to handle csrf

apps/app/tsconfig.json

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
11
{
2-
"extends": "./.svelte-kit/tsconfig.json",
3-
"compilerOptions": {
4-
"allowJs": true,
5-
"checkJs": true,
6-
"esModuleInterop": true,
7-
"forceConsistentCasingInFileNames": true,
8-
"resolveJsonModule": true,
9-
"skipLibCheck": true,
10-
"sourceMap": true,
11-
"strict": true,
12-
"strictNullChecks": true,
13-
"noErrorTruncation": true
14-
}
2+
"extends": ["./.svelte-kit/tsconfig.json", "../../tsconfig.base.json"]
153
}

apps/pay/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# create-svelte
2+
3+
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).
4+
5+
## Creating a project
6+
7+
If you're seeing this, you've probably already done this step. Congrats!
8+
9+
```bash
10+
# create a new project in the current directory
11+
npm create svelte@latest
12+
13+
# create a new project in my-app
14+
npm create svelte@latest my-app
15+
```
16+
17+
## Developing
18+
19+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
20+
21+
```bash
22+
npm run dev
23+
24+
# or start the server and open the app in a new browser tab
25+
npm run dev -- --open
26+
```
27+
28+
## Building
29+
30+
To create a production version of your app:
31+
32+
```bash
33+
npm run build
34+
```
35+
36+
You can preview the production build with `npm run preview`.
37+
38+
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.

apps/pay/package.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "pay",
3+
"description": "The invoicelink payments application",
4+
"version": "1.1.0",
5+
"scripts": {
6+
"dev": "vite dev --port 5174",
7+
"build": "vite build",
8+
"preview": "vite preview",
9+
"test": "npm run test:integration && npm run test:unit",
10+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
11+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
12+
"lint": "prettier --check . && eslint .",
13+
"format": "prettier --write .",
14+
"test:integration": "playwright test",
15+
"test:unit": "vitest"
16+
},
17+
"devDependencies": {
18+
"@fontsource/fira-mono": "^5.0.0",
19+
"@neoconfetti/svelte": "^2.0.0",
20+
"@playwright/test": "^1.28.1",
21+
"@sveltejs/adapter-auto": "^3.0.0",
22+
"@sveltejs/kit": "^2.0.0",
23+
"@sveltejs/vite-plugin-svelte": "^3.0.0",
24+
"@types/eslint": "^9.6.0",
25+
"eslint": "^9.0.0",
26+
"eslint-config-prettier": "^9.1.0",
27+
"eslint-plugin-svelte": "^2.43.0",
28+
"globals": "^15.0.0",
29+
"prettier": "^3.1.1",
30+
"prettier-plugin-svelte": "^3.1.2",
31+
"svelte": "^4.2.7",
32+
"svelte-check": "^3.6.0",
33+
"typescript": "^5.0.0",
34+
"typescript-eslint": "^8.0.0",
35+
"vite": "^5.0.3",
36+
"vitest": "^2.0.0"
37+
},
38+
"type": "module",
39+
"dependencies": {
40+
"@eslint/js": "^9.8.0",
41+
"@invoicelink/db": "workspace:*",
42+
"@sveltejs/adapter-vercel": "^5.4.1",
43+
"bits-ui": "^0.21.13",
44+
"daisyui": "^4.12.10",
45+
"svelte-french-toast": "^1.2.0",
46+
"tailwind-merge": "^2.4.0",
47+
"tailwindcss": "^3.4.7"
48+
}
49+
}

apps/pay/playwright.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import type { PlaywrightTestConfig } from '@playwright/test';
2+
3+
const config: PlaywrightTestConfig = {
4+
webServer: {
5+
command: 'npm run build && npm run preview',
6+
port: 4173
7+
},
8+
testDir: 'tests',
9+
testMatch: /(.+\.)?(test|spec)\.[jt]s/
10+
};
11+
12+
export default config;

apps/pay/postcss.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default {
2+
plugins: {
3+
'postcss-import': {},
4+
'tailwindcss/nesting': 'postcss-nesting',
5+
tailwindcss: {},
6+
autoprefixer: {}
7+
}
8+
};

apps/pay/src/+layout.svelte

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<script lang="ts">
2+
import '../app.css';
3+
import { Toaster, type ToastOptions } from 'svelte-french-toast';
4+
5+
const toastOptions = {
6+
className: `!bg-base-200 !text-base-content !text-sm`,
7+
error: {
8+
iconTheme: {
9+
primary: `oklch(var(--er))`,
10+
secondary: `oklch(var(--erc))`
11+
}
12+
},
13+
success: {
14+
iconTheme: {
15+
primary: `oklch(var(--su))`,
16+
secondary: `oklch(var(--succ))`
17+
}
18+
}
19+
} as ToastOptions;
20+
</script>
21+
22+
<slot />
23+
<Toaster {toastOptions} />

apps/pay/src/app.css

Whitespace-only changes.

apps/pay/src/app.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// See https://kit.svelte.dev/docs/types#app
2+
// for information about these interfaces
3+
declare global {
4+
namespace App {
5+
// interface Error {}
6+
// interface Locals {}
7+
// interface PageData {}
8+
// interface PageState {}
9+
// interface Platform {}
10+
}
11+
12+
// eslint-disable-next-line no-var
13+
var prisma: import('@invoicelink/db').PrismaClient;
14+
}
15+
16+
export {};

apps/pay/src/app.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!doctype html>
2+
<html lang="en" data-theme="">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" type="image/svg+xml" href="%sveltekit.assets%/favicon.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
%sveltekit.head%
8+
</head>
9+
<body data-sveltekit-preload-data="hover" class="min-h-svh">
10+
<div class="drawer drawer-end mx-auto flex min-h-full min-w-full flex-col items-center">
11+
%sveltekit.body%
12+
</div>
13+
</body>
14+
</html>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<script lang="ts">
2+
export let title = 'invoicelink.io';
3+
export let description = 'Making it easy to get paid digitally.';
4+
export let imageUrl = 'https://app.invoicelink.io/og-image.png';
5+
</script>
6+
7+
<title>{title}</title>
8+
<meta name="description" content={description} />
9+
<!-- open graph tags -->
10+
<meta property="og:title" content={title} />
11+
<meta property="og:type" content="website" />
12+
<meta property="og:url" content="https://app.invoicelink.io" />
13+
<meta property="og:description" content={description} />
14+
<meta property="og:image" content={imageUrl} />
15+
<!-- optional open graph tags -->
16+
<meta property="og:site_name" content="invoicelink" />
17+
<meta property="og:locale" content="en_ZA" />
18+
<meta property="og:image:width" content="1200" />
19+
<meta property="og:image:height" content="630" />
20+
<!-- twitter content -->
21+
<meta name="twitter:card" content="summary_large_image" />
22+
<meta property="twitter:domain" content="app.invoicelink.io" />
23+
<meta name="twitter:title" content="Pay Now" />
24+
<meta name="twitter:description" content={description} />
25+
<meta name="twitter:image" content={imageUrl} />

0 commit comments

Comments
 (0)