Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/andrew_testing' into fix-workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Isthisanmol committed Apr 17, 2024
2 parents 68f9115 + 2da83c7 commit 4f4754b
Show file tree
Hide file tree
Showing 396 changed files with 17,153 additions and 8,155 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mongodb-data
*.env
node_modules
# yarn.lock
Expand All @@ -19,6 +20,11 @@ google-services.json
wrangler.toml
.wrangler/

# Vitest
.vitest
vitest.config.js
vitest.config.js.*

# Tamagui
.tamagui

Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ echo "🔍 Running pre-commit hook"

# Running lint-staged
echo "🔄 Running lint-staged..."
npx lint-staged
# npx lint-staged

if [ $? -eq 0 ]; then
echo -e "${GREEN}✅ Lint-staged passed${NC}"
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fi

# Running yarn lint
echo "🔄 Running yarn lint..."
yarn lint
# yarn lint

if [ $? -eq 0 ]; then
echo -e "${GREEN}✅ Yarn lint passed${NC}"
Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 20.5.1
324 changes: 162 additions & 162 deletions .yarn/releases/yarn-4.1.0.cjs → .yarn/releases/yarn-4.1.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ logFilters:

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.1.0.cjs
yarnPath: .yarn/releases/yarn-4.1.1.cjs
33 changes: 26 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ So pack your bags, grab your friends, and get ready for your next adventure with
- [Local installation 📲](#local-installation-)
- [Dependencies](#dependencies)
- [Environment Setup](#environment-setup)
- [Automated Setup 🛠️](#automated-setup-️)
- [Automated Setup (Unix) 🛠️](#automated-setup-unix-️)
- [Manual Setup 📝](#manual-setup-)
- [Yarn Setup](#yarn-setup)
- [Root](#root)
Expand All @@ -59,6 +59,7 @@ So pack your bags, grab your friends, and get ready for your next adventure with
- [Debugging Client Environment Setup 🐛](#debugging-client-environment-setup-)
- [Expo](#expo)
- [Debugging Dependencies](#debugging-dependencies)
- [Debugging Cloudflare Wrangler and D1](#debugging-cloudflare-wrangler-and-d1)
- [Docker Installation 🐳 \[Experimental\]](#docker-installation--experimental)
- [Dependencies](#dependencies-1)
- [Installation](#installation)
Expand Down Expand Up @@ -146,6 +147,7 @@ The main folders are:
- `apps`
- `expo` (native)
- `next` (web) -- ssr not yet implemented
- `vite` (web)
- `tauri` (desktop) -- not yet implemented

- `packages` shared packages across apps
Expand Down Expand Up @@ -245,14 +247,15 @@ cd PackRat
- If you have access to the development env files, use those. Otherwise, replace the values with your own.
- See the `.env.example` files in the `apps/expo` and `server` directories for the necessary environment variables.

#### Automated Setup 🛠️
#### Automated Setup (Unix) 🛠️

1. Run the setup script from the `PackRat` directory.
```
yarn setup
```

#### Manual Setup 📝
- Note, if automated set up works the following manual config is taken care of already.

1. Navigate to the `PackRat` directory if you are not already there.

Expand Down Expand Up @@ -319,7 +322,7 @@ cp gradle.properties.example gradle.properties
cd ../..
```

9. Navigate to the `next` directory.
9. Navigate to one of the client directories such as `next`, `expo`, `vite`.

```
cd apps/next
Expand All @@ -344,11 +347,12 @@ cd ..
cd server
```

11. Duplicate the `.env.example` file and rename it to `.env`. Open the file and replace the values with your own.
- If you have access to the development env file, skip this step. Otherwise, replace the values with your own.
11. Duplicate the `.wrangler.toml.example` file and rename it to `wrangler.toml`. Open the file and replace the values with your own.
- If you have access to the development wrangler file, skip this step. Otherwise, replace the values with your own.
-

```
cp .env.example .env
cp .wrangler.toml.example wrangler.toml
```

12. Navigate back to the `PackRat` directory.
Expand Down Expand Up @@ -386,6 +390,10 @@ yarn start

#### Client

- Note, we have a few options for running the client.
- For native we support both iOS and Android. You can run the app on either platform. Additionally, we support MacOS, Linux, and Windows for the desktop app with Tauri.
- For web, we are using Next.js for server-side rendering. (This is not yet implemented.) We also have a Vite build that provides a faster development experience.

1. Navigate to the `expo` directory.

```
Expand All @@ -407,7 +415,13 @@ yarn run android
cd apps/next
```

3. Start the Expo/Next server.
3. Navigate to the `vite` directory.

```
cd apps/vite
```

4. Start the Expo/Next/Vite server.

```
yarn start
Expand Down Expand Up @@ -502,6 +516,11 @@ node -v

Additionally, if the error is occurring in nextjs that you check the transpilePackages in next.config.js and check if the problematic package is there.

##### Debugging Cloudflare Wrangler and D1
- Some helpful tips for debugging Cloudflare Wrangler and D1:
- If you encounter issues with Wrangler or D1, make sure you can see the sqlite database in the .wrangler directory.
- You can open the database with a sqlite browser to see if the data is being stored correctly.

## Docker Installation 🐳 [Experimental]

PackRat can also be installed using Docker. After setting up the development environment, follow the steps below to install and run the app using Docker.
Expand Down
2 changes: 1 addition & 1 deletion apps/bun-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@elysiajs/html": "^0.7.3",
"@hono/node-server": "^1.2.0",
"elysia": "^0.7.21",
"hono": "^3.9.1",
"hono": "^3.10.1",
"server": "*",
"trpc-panel": "^1.3.4"
}
Expand Down
73 changes: 37 additions & 36 deletions apps/bun-server/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,49 +1,50 @@
import { Elysia } from 'elysia';
import { Hono } from 'hono'
import { Hono } from 'hono';
// import { app as api } from 'server/src'
import { serve } from '@hono/node-server'
import { logger } from 'hono/logger'
import { prettyJSON } from 'hono/pretty-json'
import { cors } from 'hono/cors'
import { renderTrpcPanel } from 'trpc-panel'
import { serve } from '@hono/node-server';
import { logger } from 'hono/logger';
import { prettyJSON } from 'hono/pretty-json';
import { cors } from 'hono/cors';
import { renderTrpcPanel } from 'trpc-panel';
// import { appRouter } from 'server/src/routes/trpcRouter';
// import { html } from '@elysiajs/html';

const elysia = new Elysia()
// .use(html())
.get('/', () => '/Hello from Elysia!')
// .get('panel', () => renderTrpcPanel(appRouter, { url: 'http://localhost:3000/api/trpc' }))
.listen(8086)
// .use(html())
.get('/', () => '/Hello from Elysia!')
// .get('panel', () => renderTrpcPanel(appRouter, { url: 'http://localhost:3000/api/trpc' }))
.listen(8086);

const workers = new Hono()
.get('*', (c) => c.text('Hello from worker Hono!'))
const workers = new Hono().get('*', (c) => c.text('Hello from worker Hono!'));

const main = new Hono()
.use('*', prettyJSON()) // With options: prettyJSON({ space: 4 })
.use(logger())
.use('*', cors())
// .use('/panel', async (ctx, next) => {
// return ctx.render(
// renderTrpcPanel(appRouter, { url: 'http://localhost:3000/api/trpc' }),
// );
// })
.get('/', (c) => c.text('/Hello from Hono in root!'))
// .mount('/:wild', api.handle)
.mount('/workers', workers.fetch)
.mount('/elysia', elysia.fetch)
.get('*', (c) => c.text('Fallback from Hono in Main!'))
.onError((err, c) => {
console.error(`${err}`);
return c.text('Custom Error Message', 500);
});
.use('*', prettyJSON()) // With options: prettyJSON({ space: 4 })
.use(logger())
.use('*', cors())
// .use('/panel', async (ctx, next) => {
// return ctx.render(
// renderTrpcPanel(appRouter, { url: 'http://localhost:3000/api/trpc' }),
// );
// })
.get('/', (c) => c.text('/Hello from Hono in root!'))
// .mount('/:wild', api.handle)
.mount('/workers', workers.fetch)
.mount('/elysia', elysia.fetch)
.get('*', (c) => c.text('Fallback from Hono in Main!'))
.onError((err, c) => {
console.error(`${err}`);
return c.text('Custom Error Message', 500);
});

serve({
serve(
{
fetch: main.fetch,
port: 8085,
...main
}, (info) => {
console.log('Server started on port ->', info.port)
}
)
...main,
},
(info) => {
console.log('Server started on port ->', info.port);
},
);

export default main
export default main;
28 changes: 14 additions & 14 deletions apps/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@
"@rneui/base": "^4.0.0-rc.8",
"@rneui/themed": "^4.0.0-rc.8",
"@rnmapbox/maps": "^10.0.0-beta.79",
"@tamagui/animations-react-native": "^1.91.3",
"@tamagui/babel-plugin": "^1.91.3",
"@tamagui/config": "^1.91.3",
"@tamagui/font-inter": "^1.91.3",
"@tamagui/linear-gradient": "^1.91.3",
"@tamagui/lucide-icons": "^1.91.3",
"@tamagui/progress": "^1.91.3",
"@tamagui/react-native-media-driver": "^1.91.3",
"@tamagui/shorthands": "^1.91.3",
"@tamagui/switch": "^1.91.3",
"@tamagui/theme-base": "^1.91.3",
"@tamagui/themes": "^1.91.3",
"@tamagui/animations-react-native": "1.92.1",
"@tamagui/babel-plugin": "1.92.1",
"@tamagui/config": "1.92.1",
"@tamagui/font-inter": "1.92.1",
"@tamagui/linear-gradient": "1.92.1",
"@tamagui/lucide-icons": "1.92.1",
"@tamagui/progress": "1.92.1",
"@tamagui/react-native-media-driver": "1.92.1",
"@tamagui/shorthands": "1.92.1",
"@tamagui/switch": "1.92.1",
"@tamagui/theme-base": "1.92.1",
"@tamagui/themes": "1.92.1",
"@tanstack/query-async-storage-persister": "^4.36.1",
"@tanstack/react-query": "^4.36.1",
"@tanstack/react-query-devtools": "^4.36.1",
Expand Down Expand Up @@ -136,7 +136,7 @@
"serve": "^14.2.0",
"server": "*",
"superjson": "^2.0.0",
"tamagui": "^1.91.3",
"tamagui": "1.92.1",
"togpx": "^0.5.4",
"uuid": "3.4.0",
"xmldom": "^0.6.0",
Expand All @@ -163,7 +163,7 @@
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"prettier": "^3.0.2",
"prettier": "^3.2.5",
"typescript": "^5.3.3"
},
"overrides": {
Expand Down
2 changes: 1 addition & 1 deletion apps/next/envResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const API_URL = process.env.API_URL || 'http://localhost:3000/api';
export const NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN =
process.env.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN;

export const NEXT_PUBLIC_API_URL = process.env.NEXT_PUBLIC_API_URL;
export const NEXT_PUBLIC_API_URL = process.env.NEXT_PUBLIC_API_URL || 'https://packrat_api.abbierman101.workers.dev/api';

export default {
NODE_ENV,
Expand Down
20 changes: 11 additions & 9 deletions apps/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@
"start": "next start",
"lint": "next lint",
"postinstall": "patch-package",
"pages:build": "npx @cloudflare/next-on-pages",
"pages:build": "yarn pages:build:static",
"pages:build:static": "next build && next export -o .vercel/output/static",
"pages:build:full": "npx @cloudflare/next-on-pages",
"pages:preview": "npm run pages:build && wrangler pages dev .vercel/output/static --compatibility-date=2024-01-17 --compatibility-flag=nodejs_compat",
"pages:deploy": "npm run pages:build && wrangler pages deploy .vercel/output/static",
"pages:dev": "npx @cloudflare/next-on-pages --watch",
"build:cloudflare": "npx @cloudflare/next-on-pages@1"
"build:cloudflare": "yarn pages:build"
},
"dependencies": {
"@babel/core": "^7.23.7",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/plugin-transform-react-jsx": "^7.23.4",
"@expo/next-adapter": "5.0.2",
"@react-native/assets-registry": "^0.74.0",
"@tamagui/config": "^1.91.3",
"@tamagui/next-plugin": "^1.91.3",
"@tamagui/next-theme": "^1.91.3",
"@tamagui/config": "1.92.1",
"@tamagui/next-plugin": "1.92.1",
"@tamagui/next-theme": "1.92.1",
"app": "*",
"babel-preset-expo": "9.5.2",
"babel-preset-react-native": "^4.0.1",
Expand All @@ -36,19 +38,19 @@
"react-dom": "^18.2.0",
"react-native-web": "^0.19.10",
"setimmediate": "^1.0.5",
"tamagui": "^1.91.3",
"tamagui": "1.92.1",
"url-loader": "^4.1.1",
"vercel": "latest"
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@cloudflare/next-on-pages": "^1.8.5",
"@cloudflare/workers-types": "^4.20240117.0",
"@cloudflare/next-on-pages": "^1.11.0",
"@cloudflare/workers-types": "^4.20240405.0",
"@types/node": "^20.8.3",
"babel-plugin-module-resolver": "^5.0.0",
"eslint-plugin-next-on-pages": "^1.8.5",
"patch-package": "^8.0.0",
"postinstall-postinstall": "^2.1.0",
"wrangler": "3.24.0"
"wrangler": "^3.49.0"
}
}
14 changes: 7 additions & 7 deletions apps/tauri/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"@babel/plugin-transform-react-jsx": "^7.23.4",
"@expo/next-adapter": "5.0.2",
"@react-native/assets-registry": "^0.74.0",
"@tamagui/config": "^1.91.3",
"@tamagui/next-plugin": "^1.91.3",
"@tamagui/next-theme": "^1.91.3",
"@tamagui/config": "1.92.1",
"@tamagui/next-plugin": "1.92.1",
"@tamagui/next-theme": "1.92.1",
"app": "*",
"babel-preset-expo": "9.5.2",
"babel-preset-react-native": "^4.0.1",
Expand All @@ -36,20 +36,20 @@
"react-dom": "^18.2.0",
"react-native-web": "^0.19.10",
"setimmediate": "^1.0.5",
"tamagui": "^1.91.3",
"tamagui": "1.92.1",
"url-loader": "^4.1.1",
"vercel": "latest"
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@cloudflare/next-on-pages": "^1.8.5",
"@cloudflare/workers-types": "^4.20240117.0",
"@cloudflare/next-on-pages": "^1.11.0",
"@cloudflare/workers-types": "^4.20240405.0",
"@tauri-apps/cli": "^1.5.9",
"@types/node": "^20.8.3",
"babel-plugin-module-resolver": "^5.0.0",
"eslint-plugin-next-on-pages": "^1.8.5",
"patch-package": "^8.0.0",
"postinstall-postinstall": "^2.1.0",
"wrangler": "3.24.0"
"wrangler": "^3.49.0"
}
}
Loading

0 comments on commit 4f4754b

Please sign in to comment.