♻️ Switch to turborepo (#532)
|
@ -2,10 +2,12 @@ node_modules
|
|||
.git
|
||||
.github
|
||||
.vscode
|
||||
tsconfig.tsbuildinfo
|
||||
.env
|
||||
.sentryclirc
|
||||
sentry.properties
|
||||
Dockerfile
|
||||
docker-compose.yml
|
||||
docs
|
||||
/docs
|
||||
README.md
|
||||
node_modules
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": ["next/core-web-vitals"],
|
||||
"extends": ["next/core-web-vitals", "turbo"],
|
||||
"plugins": ["simple-import-sort", "@typescript-eslint"],
|
||||
"overrides": [
|
||||
{
|
||||
|
|
9
.github/workflows/ci.yml
vendored
|
@ -11,6 +11,9 @@ jobs:
|
|||
linting:
|
||||
name: Linting
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
|
@ -35,7 +38,9 @@ jobs:
|
|||
name: Run tests
|
||||
# Containers must run in Linux based operating systems
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||
steps:
|
||||
# Downloads a copy of the code in your repository before running CI tests
|
||||
- name: Check out repository code
|
||||
|
@ -66,7 +71,7 @@ jobs:
|
|||
yarn wait-on --timeout 60000 tcp:localhost:5432
|
||||
|
||||
- name: Deploy migrations
|
||||
run: yarn prisma migrate deploy
|
||||
run: yarn db:deploy
|
||||
|
||||
- name: Install playwright dependencies
|
||||
run: yarn playwright install --with-deps chromium
|
||||
|
|
1
.github/workflows/docker-image.yml
vendored
|
@ -39,6 +39,7 @@ jobs:
|
|||
- name: Build and publish image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
file: /apps/web/Dockerfile
|
||||
platforms: linux/arm64,linux/amd64
|
||||
push: true
|
||||
cache-from: type=gha
|
||||
|
|
13
.gitignore
vendored
|
@ -31,15 +31,8 @@ yarn-error.log*
|
|||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
# Sentry
|
||||
.sentryclirc
|
||||
|
||||
# playwright
|
||||
/playwright-report
|
||||
/test-results
|
||||
|
||||
# ts
|
||||
tsconfig.tsbuildinfo
|
||||
|
||||
# Turbo
|
||||
.turbo
|
25
Dockerfile
|
@ -1,25 +0,0 @@
|
|||
FROM node:lts as build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json .
|
||||
COPY yarn.lock .
|
||||
COPY prisma/schema.prisma .
|
||||
|
||||
RUN yarn --frozen-lockfile --no-cache --production --network-timeout 1000000
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN yarn build
|
||||
|
||||
FROM node:lts
|
||||
|
||||
ENV PORT 3000
|
||||
EXPOSE 3000
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY --from=build /app .
|
||||
COPY ./scripts/docker-start.sh .
|
||||
|
||||
ENTRYPOINT ["./scripts/docker-start.sh"]
|
8
apps/web/.gitignore
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
node_modules
|
||||
|
||||
# Sentry
|
||||
.sentryclirc
|
||||
|
||||
# playwright
|
||||
/playwright-report
|
||||
/test-results
|
47
apps/web/Dockerfile
Normal file
|
@ -0,0 +1,47 @@
|
|||
FROM node:lts AS builder
|
||||
|
||||
WORKDIR /app
|
||||
RUN yarn global add turbo
|
||||
COPY . .
|
||||
RUN turbo prune --scope=app --docker
|
||||
|
||||
FROM node:lts AS installer
|
||||
|
||||
WORKDIR /app
|
||||
COPY .gitignore .gitignore
|
||||
COPY --from=builder /app/out/json/ .
|
||||
COPY --from=builder /app/out/yarn.lock ./yarn.lock
|
||||
RUN yarn --network-timeout 1000000
|
||||
|
||||
# Build the project
|
||||
COPY --from=builder /app/out/full/ .
|
||||
COPY turbo.json turbo.json
|
||||
RUN yarn turbo run generate
|
||||
RUN yarn turbo run build --filter=app...
|
||||
|
||||
FROM node:lts AS runner
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN yarn global add prisma
|
||||
# Don't run production as root
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
USER nextjs
|
||||
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/scripts/docker-start.sh ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/packages/database/prisma ./prisma
|
||||
|
||||
COPY --from=installer /app/apps/web/next.config.js .
|
||||
COPY --from=installer /app/apps/web/package.json .
|
||||
|
||||
ENV PORT 3000
|
||||
EXPOSE 3000
|
||||
|
||||
# Automatically leverage output traces to reduce image size
|
||||
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
||||
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
|
||||
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
|
||||
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public
|
||||
|
||||
CMD ["./docker-start.sh"]
|
0
next-env.d.ts → apps/web/next-env.d.ts
vendored
|
@ -12,6 +12,7 @@ const withBundleAnalyzer = require("@next/bundle-analyzer")({
|
|||
const nextConfig = {
|
||||
i18n: i18n,
|
||||
productionBrowserSourceMaps: true,
|
||||
output: "standalone",
|
||||
webpack(config) {
|
||||
config.module.rules.push({
|
||||
test: /\.svg$/,
|
93
apps/web/package.json
Normal file
|
@ -0,0 +1,93 @@
|
|||
{
|
||||
"name": "app",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "TAILWIND_MODE=watch next dev",
|
||||
"build": "next build",
|
||||
"analyze": "ANALYZE=true next build",
|
||||
"start": "next start",
|
||||
"lint": "eslint .",
|
||||
"lint:tsc": "tsc --noEmit",
|
||||
"lint:i18n": "i18n-unused remove-unused",
|
||||
"test": "PORT=3001 playwright test",
|
||||
"test:codegen": "playwright codegen http://localhost:3000",
|
||||
"docker:start": "./scripts/docker-start.sh"
|
||||
},
|
||||
"dependencies": {
|
||||
"@floating-ui/react-dom-interactions": "^0.13.3",
|
||||
"@headlessui/react": "^1.7.7",
|
||||
"@next/bundle-analyzer": "^12.3.4",
|
||||
"@radix-ui/react-popover": "^1.0.3",
|
||||
"@rallly/database": "*",
|
||||
"@sentry/nextjs": "^7.33.0",
|
||||
"@svgr/webpack": "^6.5.1",
|
||||
"@tailwindcss/typography": "^0.5.9",
|
||||
"@tanstack/react-query": "^4.22.0",
|
||||
"@trpc/client": "^10.13.0",
|
||||
"@trpc/next": "^10.13.0",
|
||||
"@trpc/react-query": "^10.13.0",
|
||||
"@trpc/server": "^10.13.0",
|
||||
"@vercel/analytics": "^0.1.8",
|
||||
"accept-language-parser": "^1.5.0",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"clsx": "^1.1.1",
|
||||
"dayjs": "^1.11.7",
|
||||
"eta": "^2.0.0",
|
||||
"framer-motion": "^6.5.1",
|
||||
"i18next": "^22.4.9",
|
||||
"iron-session": "^6.3.1",
|
||||
"js-cookie": "^3.0.1",
|
||||
"lodash": "^4.17.21",
|
||||
"nanoid": "^4.0.0",
|
||||
"next": "^13.2.1",
|
||||
"next-i18next": "^13.0.3",
|
||||
"next-seo": "^5.15.0",
|
||||
"nodemailer": "^6.9.0",
|
||||
"postcss": "^8.4.21",
|
||||
"posthog-js": "^1.42.3",
|
||||
"react": "^18.2.0",
|
||||
"react-big-calendar": "^1.5.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-hook-form": "^7.42.1",
|
||||
"react-hot-toast": "^2.4.0",
|
||||
"react-i18next": "^12.1.4",
|
||||
"react-linkify": "^1.0.0-alpha",
|
||||
"react-use": "^17.4.0",
|
||||
"smoothscroll-polyfill": "^0.4.4",
|
||||
"spacetime": "^7.1.4",
|
||||
"superjson": "^1.12.2",
|
||||
"tailwindcss": "^3.2.4",
|
||||
"tailwindcss-animate": "^1.0.5",
|
||||
"timezone-soft": "^1.3.1",
|
||||
"typescript": "^4.9.4",
|
||||
"zod": "^3.20.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.31.1",
|
||||
"@rallly/tsconfig": "*",
|
||||
"@types/accept-language-parser": "^1.5.3",
|
||||
"@types/lodash": "^4.14.178",
|
||||
"@types/nodemailer": "^6.4.4",
|
||||
"@types/react": "^18.0.28",
|
||||
"@types/react-big-calendar": "^0.31.0",
|
||||
"@types/react-dom": "^18.0.11",
|
||||
"@types/react-linkify": "^1.0.1",
|
||||
"@types/smoothscroll-polyfill": "^0.3.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.21.0",
|
||||
"@typescript-eslint/parser": "^5.50.0",
|
||||
"cheerio": "^1.0.0-rc.12",
|
||||
"eslint": "^7.26.0",
|
||||
"eslint-config-next": "^13.0.1",
|
||||
"eslint-config-turbo": "^0.0.9",
|
||||
"eslint-import-resolver-typescript": "^2.7.0",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"eslint-plugin-react": "^7.23.2",
|
||||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"eslint-plugin-simple-import-sort": "^7.0.0",
|
||||
"i18n-unused": "^0.12.0",
|
||||
"prettier-plugin-tailwindcss": "^0.1.8",
|
||||
"smtp-tester": "^2.0.1",
|
||||
"wait-on": "^6.0.1"
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 386 B After Width: | Height: | Size: 386 B |
Before Width: | Height: | Size: 707 B After Width: | Height: | Size: 707 B |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |