Skip to content

Commit

Permalink
Upload video
Browse files Browse the repository at this point in the history
  • Loading branch information
czystyl committed Sep 28, 2023
1 parent 5629e5f commit 24d717d
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{ "pattern": "apps/*/" },
{ "pattern": "packages/*/" }
],
"tailwindCSS.experimental.configFile": "./packages/config/tailwind/index.ts",
"tailwindCSS.experimental.configFile": "./tooling/tailwind/index.ts",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "node_modules/typescript/lib",
"[properties]": {
Expand Down
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# The Bank

<video width="600" controls>
<source src="demo.mov" type="video/mov">
</video>

## Project Structure

```
Expand Down Expand Up @@ -48,7 +52,6 @@ Make sure that you have installed and configured:

- **Node.js**: I recommend using NVM (Node Version Manager). [Installation Guide](https://github.com/nvm-sh/nvm)
- **pnpm**: [Installation Guide](https://pnpm.io/installation#using-npm)
- **Docker**: [Installation Guide](https://docs.docker.com/engine/install/)
- **iOS Simulator**: [Installation Guide](https://docs.expo.dev/workflow/ios-simulator/)
- **Android Studio Emulator**: [Installation Guide](https://docs.expo.dev/workflow/android-studio-emulator/)

Expand All @@ -72,15 +75,7 @@ To get it running, follow the steps below:
cp apps/mobile/.env.example .env
```

- Database setup

```sh
docker run --name the-bank-mysql -e MYSQL_ROOT_PASSWORD=password -d -p 3306:3306 mysql
```

> You can also get one from https://planetscale.com/

- Database synchronization (optional)
- Database synchronization
```
pnpm db:push
```
Expand Down
5 changes: 0 additions & 5 deletions apps/mobile/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ const defineConfig: ExpoConfig = {
backgroundColor: "#1F104A",
},
},
extra: {
eas: {
projectId: "677df07c-8718-4abb-8a30-d86f985f47fb", // comment
},
},
experiments: {
tsconfigPaths: true,
typedRoutes: true,
Expand Down
3 changes: 1 addition & 2 deletions apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@the-bank/mobile",
"version": "0.1.0",
"private": true,
"main": "expo-router/entry",
"main": "index.tsx",
"scripts": {
"start": "expo start",
"dev": "expo start --ios",
Expand Down Expand Up @@ -30,7 +30,6 @@
"expo": "^49.0.11",
"expo-constants": "~14.4.2",
"expo-crypto": "~12.4.1",
"expo-dev-client": "~2.4.10",
"expo-image": "~1.3.2",
"expo-linking": "~5.0.2",
"expo-router": "^2.0.8",
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/app/(home)/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import { formatCurrencyValue } from "@the-bank/core";

import { api } from "~/lib/api";
import { useAuth } from "~/lib/authProvider";
import { usePusherUpdates } from "~/lib/pusher";

export default function HomeScreen() {
const { user, signOut } = useAuth();
const apiUtils = api.useContext();

usePusherUpdates();
// For pushed you need a dev build
// usePusherUpdates();

const { data: userBalance, isLoading } = api.user.balance.useQuery();
const { mutate: addFoundsMutation } = api.transaction.addFounds.useMutation({
Expand Down
10 changes: 10 additions & 0 deletions apps/web/src/lib/serverAPIClient.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { auth } from "@clerk/nextjs";
import { appRouter } from "@the-bank/api";

export function serverAPIClient() {
const authSession = auth();

return appRouter.createCaller({
auth: authSession,
});
}
Binary file added demo.mov
Binary file not shown.
12 changes: 4 additions & 8 deletions packages/api/src/router/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@ export const transactionRouter = createTRPCRouter({
try {
await addFounds(ctx.auth.userId, input.value);

await PusherServer.trigger(
channels.mainChannel.name,
channels.mainChannel.events.addFounds,
{
value: input.value,
clerkUserId: ctx.auth.userId,
},
);
await PusherServer.trigger("channe_name", "addFounds", {
value: input.value,
clerkUserId: ctx.auth.userId,
});
} catch (error) {
throw new TRPCError({
code: "BAD_REQUEST",
Expand Down

0 comments on commit 24d717d

Please sign in to comment.