Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Romero committed Dec 5, 2023
0 parents commit a2348b9
Show file tree
Hide file tree
Showing 85 changed files with 13,704 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Since .env is gitignored, you can use .env.example to build a new `.env` file when you clone the repo.
# Keep this file up-to-date when you add new variables to \`.env\`.

# This file will be committed to version control, so make sure not to have any secrets in it.
# If you are cloning this repo, create a copy of this file named `.env` and populate it with your secrets.

# We use dotenv to load Prisma from Next.js' .env file
# @see https://www.prisma.io/docs/reference/database-reference/connection-urls
DATABASE_URL=file:./db.sqlite

# CLERK is used for authentication and authorization in the app
# @see https://dashboard.clerk.dev for your Clerk API keys
#
### NEW KEYS FOR APPS AFTER 1/18/2023
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_XXXXXXXXXXXXXXXXXXXX
CLERK_SECRET_KEY=sk_test_XXXXXXXXXXXXXXXXXXXXXXXX
15 changes: 15 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
project: [
"./tsconfig.json",
"./apps/*/tsconfig.json",
"./packages/*/tsconfig.json",
],
},
plugins: ["@typescript-eslint"],
extends: ["plugin:@typescript-eslint/recommended"],
};
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Logs**
Please provide logs showing the error.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI

on:
pull_request:
branches: ["*"]
push:
branches: ["main"]

# You can leverage Vercel Remote Caching with Turbo to speed up your builds
# @link https://turborepo.org/docs/core-concepts/remote-caching#remote-caching-on-vercel-builds
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY}}
CLERK_SECRET_KEY: ${{secrets.CLERK_SECRET_KEY}}


jobs:
build-lint:
env:
DATABASE_URL: file:./db.sqlite
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/[email protected]

- name: Setup Node 18
uses: actions/setup-node@v3
with:
node-version: 18

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install deps (with cache)
run: pnpm install

- name: Next.js cache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}apps/nextjs/.next/cache
key: ${{ runner.os }}-${{ runner.node }}-${{ hashFiles('**/pnpm-lock.yaml') }}-nextjs

- name: Build, lint and type-check
run: pnpm turbo build lint type-check

- name: Check workspaces
run: pnpm manypkg check
49 changes: 49 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
.pnp
.pnp.js

# testing
coverage

# database
prisma/db.sqlite
prisma/db.sqlite-journal
packages/db/prisma/db.sqlite
packages/db/prisma/db.sqlite-journal

# next.js
.next/
out/

# expo
.expo/
dist/

# production
build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo

# turbo
.turbo
12 changes: 12 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Expo doesn't play nice with pnpm by default.
# The symbolic links of pnpm break the rules of Expo monorepos.
# @link https://docs.expo.dev/guides/monorepos/#common-issues
node-linker=hoisted

# In order to cache Prisma correctly
public-hoist-pattern[]=*prisma*

# FIXME: @prisma/client is required by the @acme/auth,
# but we don't want it installed there since it's already
# installed in the @acme/db package
strict-peer-dependencies=false
12 changes: 12 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @type {import("prettier").Config} */
module.exports = {
arrowParens: "always",
printWidth: 80,
singleQuote: false,
jsxSingleQuote: false,
semi: true,
trailingComma: "all",
tabWidth: 2,
plugins: [require.resolve("prettier-plugin-tailwindcss")],
tailwindConfig: "./packages/config/tailwind",
};
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"bradlc.vscode-tailwindcss",
"Prisma.prisma"
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }],
"typescript.tsdk": "node_modules/typescript/lib"
}
4 changes: 4 additions & 0 deletions apps/expo/.expo-shared/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true,
"40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true
}
41 changes: 41 additions & 0 deletions apps/expo/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { ExpoConfig, ConfigContext } from "@expo/config";

const CLERK_PUBLISHABLE_KEY =
"pk_test_ZXBpYy1jaWNhZGEtNzAuY2xlcmsuYWNjb3VudHMuZGV2JA";

const defineConfig = (_ctx: ConfigContext): ExpoConfig => ({

Check warning on line 6 in apps/expo/app.config.ts

View workflow job for this annotation

GitHub Actions / build-lint

'_ctx' is defined but never used
name: "expo",
slug: "expo",
version: "1.0.0",
orientation: "portrait",
icon: "./assets/icon.png",
userInterfaceStyle: "light",
splash: {
image: "./assets/icon.png",
resizeMode: "contain",
backgroundColor: "#2e026d",
},
updates: {
fallbackToCacheTimeout: 0,
},
assetBundlePatterns: ["**/*"],
ios: {
supportsTablet: true,
bundleIdentifier: "your.bundle.identifier",
},
android: {
adaptiveIcon: {
foregroundImage: "./assets/icon.png",
backgroundColor: "#2e026d",
},
},
extra: {
eas: {
projectId: "your-project-id",
},
CLERK_PUBLISHABLE_KEY,
},
plugins: ["./expo-plugins/with-modify-gradle.js"],
});

export default defineConfig;
Binary file added apps/expo/assets/emptyCart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/expo/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/expo/assets/noData.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions apps/expo/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = function (api) {
api.cache(true);
return {
plugins: ["nativewind/babel"],
presets: ["babel-preset-expo"],
};
};
41 changes: 41 additions & 0 deletions apps/expo/expo-plugins/with-modify-gradle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//@ts-check

// This plugin is required for fixing `.apk` build issue
// It appends Expo and RN versions into the `build.gradle` file
// References:
// https://github.com/t3-oss/create-t3-turbo/issues/120
// https://github.com/expo/expo/issues/18129

const { withProjectBuildGradle } = require("@expo/config-plugins");

module.exports = (config) => {
return withProjectBuildGradle(config, (config) => {
if (!config.modResults.contents.includes("ext.getPackageJsonVersion =")) {
config.modResults.contents = config.modResults.contents.replace(
"buildscript {",
`buildscript {
ext.getPackageJsonVersion = { packageName ->
new File(['node', '--print', "JSON.parse(require('fs').readFileSync(require.resolve('\${packageName}/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
}`,
);
}

if (!config.modResults.contents.includes("reactNativeVersion =")) {
config.modResults.contents = config.modResults.contents.replace(
"ext {",
`ext {
reactNativeVersion = "\${ext.getPackageJsonVersion('react-native')}"`,
);
}

if (!config.modResults.contents.includes("expoPackageVersion =")) {
config.modResults.contents = config.modResults.contents.replace(
"ext {",
`ext {
expoPackageVersion = "\${ext.getPackageJsonVersion('expo')}"`,
);
}

return config;
});
};
8 changes: 8 additions & 0 deletions apps/expo/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { registerRootComponent } from "expo";

import App from "./src/_app";

// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
// It also ensures that whether you load the app in Expo Go or in a native build,
// the environment is set up appropriately
registerRootComponent(App);
26 changes: 26 additions & 0 deletions apps/expo/metro.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Learn more: https://docs.expo.dev/guides/monorepos/
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { getDefaultConfig } = require('expo/metro-config');
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require('path');

const projectRoot = __dirname;
const workspaceRoot = path.resolve(projectRoot, '../..');

// Create the default Metro config
const config = getDefaultConfig(projectRoot);

// Add the additional `cjs` extension to the resolver
config.resolver.sourceExts.push('cjs');

// 1. Watch all files within the monorepo
config.watchFolders = [workspaceRoot];
// 2. Let Metro know where to resolve packages and in what order
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, 'node_modules'),
path.resolve(workspaceRoot, 'node_modules'),
];
// 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
config.resolver.disableHierarchicalLookup = true;

module.exports = config;
Loading

0 comments on commit a2348b9

Please sign in to comment.