Skip to content

Commit

Permalink
feat: add proompteng website (#623)
Browse files Browse the repository at this point in the history
* feat: add proompteng website

* remove ecran

* cancel previous workflows

* update node

* nextjs cache

* add dockerfile
  • Loading branch information
gregkonush authored Dec 22, 2024
1 parent 40d4963 commit 587ba73
Show file tree
Hide file tree
Showing 48 changed files with 3,046 additions and 13,986 deletions.
14 changes: 8 additions & 6 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
use kebab case for file names.
optimize react component rendering by using memo and useMemo and useCallback.
zod for form, api, ai generation validation.
tailwindcss for styling, use module css with variables only for complex animation.
tailwindcss for styling.
use frame motion for animation.
make sure to separate view and business logic components.
in workflow files though use log utility from temporal.
in workflow files use log utility from temporal.
if view components gets too complex, use useImmerReducer for state management.
use cn utility function for conditional class names.
break apart long list of class names into multiple lines if it longer than 100 characters.
use shadcn/ui for components, make sure to use zinc color palette for backgrounds and text.
for primary actions and buttons use indigo color palette.
break apart long list of class names into multiple lines if it longer than 100 characters by using cn utility function.
use shadcn/ui for components.
tailwindcss typography is already installed for text styling, use prose classes for text styling.
make sure to use slate color palette for backgrounds and text.
do not hardcode width and height, use tailwindcss classes instead, only use rem values if absolutely necessary.
make sure components are accessible, add aria labels where necessary.
component export should be `export default function ComponentName() {}`.
component export should be `export function ComponentName() {}`.
do not comment code when suggesting edits, just make the changes.
32 changes: 0 additions & 32 deletions .github/workflows/ci.yml

This file was deleted.

47 changes: 5 additions & 42 deletions .github/workflows/docker-build-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
branches:
- "main"
paths:
- "services/ecran/**"
- "services/juge/**"
- "apps/proompteng/**"

jobs:
version:
Expand All @@ -31,49 +30,13 @@ jobs:
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}

build-ecran-migrator:
build-proompteng:
needs: version
uses: ./.github/workflows/docker-build-common.yaml
with:
image_name: ecran-migrator
dockerfile: ./services/ecran/Dockerfile.migrator
context: ./services/ecran
new_tag: ${{ needs.version.outputs.new_tag }}
secrets:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}

build-ecran:
needs: [version, build-ecran-migrator]
uses: ./.github/workflows/docker-build-common.yaml
with:
image_name: ecran
dockerfile: ./services/ecran/Dockerfile
context: ./services/ecran
new_tag: ${{ needs.version.outputs.new_tag }}
secrets:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}

build-ecran-worker:
needs: [version, build-ecran-migrator]
uses: ./.github/workflows/docker-build-common.yaml
with:
image_name: ecran-worker
dockerfile: ./services/ecran/Dockerfile.worker
context: ./services/ecran
new_tag: ${{ needs.version.outputs.new_tag }}
secrets:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}

build-juge:
needs: [version, build-ecran-migrator]
uses: ./.github/workflows/docker-build-common.yaml
with:
image_name: juge
dockerfile: ./services/juge/Dockerfile
context: ./services/juge/app
image_name: proompteng
dockerfile: ./apps/proompteng/Dockerfile
context: ./apps/proompteng
new_tag: ${{ needs.version.outputs.new_tag }}
secrets:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
main:
runs-on: arc-arm64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: 22.12.0
cache: 'pnpm'

- run: pnpm install --frozen-lockfile
- uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/apps/proompteng/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
- run: pnpm build
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.11.0
22.12.0
13 changes: 0 additions & 13 deletions apps/proompteng-e2e/eslint.config.cjs

This file was deleted.

69 changes: 0 additions & 69 deletions apps/proompteng-e2e/playwright.config.ts

This file was deleted.

10 changes: 0 additions & 10 deletions apps/proompteng-e2e/project.json

This file was deleted.

8 changes: 0 additions & 8 deletions apps/proompteng-e2e/src/example.spec.ts

This file was deleted.

19 changes: 0 additions & 19 deletions apps/proompteng-e2e/tsconfig.json

This file was deleted.

41 changes: 41 additions & 0 deletions apps/proompteng/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

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

# env files (can opt-in for committing if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
32 changes: 32 additions & 0 deletions apps/proompteng/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM oven/bun:latest AS deps
WORKDIR /app
COPY package.json bun.lockb .npmrc ./
RUN bun install --frozen-lockfile

FROM node:lts-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build

FROM node:lts-alpine AS runner
WORKDIR /app

ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1

RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 nextjs

COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/public ./public

USER nextjs

EXPOSE 3000

ENV PORT=3000
ENV HOSTNAME="0.0.0.0"

CMD ["node", "server.js"]
21 changes: 21 additions & 0 deletions apps/proompteng/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app/globals.css",
"baseColor": "slate",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
Loading

0 comments on commit 587ba73

Please sign in to comment.