diff --git a/.husky/commit-msg b/.husky/commit-msg deleted file mode 100644 index 313c0c45..00000000 --- a/.husky/commit-msg +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# regex to validate in commit msg -techmelyTicketReg='^(TML-[A-Z0-9]{2,4}|merge|hotfix|release)' -errorMsg="Aborting commit. Your commit message must start with JIRA code (eg: 'TML-1111') or 'merge|hotfix|release'" - -if ! grep -iqE "$techmelyTicketReg" "$1"; then - echo "$errorMsg" >&2 - exit 1 -fi diff --git a/.husky/prepare-commit-msg b/.husky/prepare-commit-msg deleted file mode 100644 index 8eaa6c29..00000000 --- a/.husky/prepare-commit-msg +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -textBase='\033[0m' -textInformation='\033[1;34m' -textSuccess='\033[1;32m' - -branchName=$(git rev-parse --abbrev-ref HEAD) -techmelyTicketReg='^(TML-[A-Z0-9]{2,4}|merge|hotfix|release)' - -gitCommitMsg=$(head -n 1 "$1") # $1 is path = .git/COMMIT_EDITMSG - -if [[ $gitCommitMsg =~ $techmelyTicketReg ]];then - echo "$textInformation Already exist prefix branch-name, ignore appending prefix." - echo "$textBase" -else - echo "$textInformation Starting append prefix branch-name..." - if [[ -n "$branchName" ]] && [[ $branchName =~ $techmelyTicketReg ]]; then - # Append prefix branch name into commit message - sed -i.bak -e "1s~^~$branchName ~" "$1" - echo "$textSuccess Append prefix branch-name successfully." - echo "$textBase" - fi -fi diff --git a/.moon/hooks/commit-msg.sh b/.moon/hooks/commit-msg.sh index 72c5ab1f..a387c252 100755 --- a/.moon/hooks/commit-msg.sh +++ b/.moon/hooks/commit-msg.sh @@ -4,5 +4,5 @@ set -eo pipefail # Automatically generated by moon. DO NOT MODIFY! # https://moonrepo.dev/docs/guides/vcs-hooks -echo "commit msg" +scripts/git/commit-msg.sh diff --git a/.moon/hooks/post-checkout.sh b/.moon/hooks/post-checkout.sh new file mode 100755 index 00000000..05d330ca --- /dev/null +++ b/.moon/hooks/post-checkout.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -eo pipefail + +# Automatically generated by moon. DO NOT MODIFY! +# https://moonrepo.dev/docs/guides/vcs-hooks + +scripts/git/post-checkout.sh + diff --git a/.moon/hooks/pre-commit.sh b/.moon/hooks/pre-commit.sh index 6e1a0100..f3e701dc 100755 --- a/.moon/hooks/pre-commit.sh +++ b/.moon/hooks/pre-commit.sh @@ -4,5 +4,5 @@ set -eo pipefail # Automatically generated by moon. DO NOT MODIFY! # https://moonrepo.dev/docs/guides/vcs-hooks -echo "pre commit msg" +scripts/git/pre-commit.sh diff --git a/.moon/hooks/pre-push.sh b/.moon/hooks/pre-push.sh index 2a65af65..62e16d25 100755 --- a/.moon/hooks/pre-push.sh +++ b/.moon/hooks/pre-push.sh @@ -4,5 +4,5 @@ set -eo pipefail # Automatically generated by moon. DO NOT MODIFY! # https://moonrepo.dev/docs/guides/vcs-hooks -echo "pre push" +scripts/git/pre-push.sh diff --git a/.moon/hooks/prepare-commit-msg.sh b/.moon/hooks/prepare-commit-msg.sh index 51e6e3ec..a387c252 100755 --- a/.moon/hooks/prepare-commit-msg.sh +++ b/.moon/hooks/prepare-commit-msg.sh @@ -4,5 +4,5 @@ set -eo pipefail # Automatically generated by moon. DO NOT MODIFY! # https://moonrepo.dev/docs/guides/vcs-hooks -echo "prepare commit msg" +scripts/git/commit-msg.sh diff --git a/.moon/tasks/typescript.yml b/.moon/tasks/typescript.yml index 487e72ac..f0556d0e 100644 --- a/.moon/tasks/typescript.yml +++ b/.moon/tasks/typescript.yml @@ -47,18 +47,12 @@ tasks: - "tsconfig.*.json" - "/tsconfig.base.json" - lint-useless: - command: - - "knip" - local: true - lint: command: "noop" deps: - lint-biome - lint-circular - lint-typecheck - - lint-useless test: command: diff --git a/Makefile b/Makefile deleted file mode 100644 index b049c755..00000000 --- a/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -build: - bun run nx run-many -t build -p - -dev: - bun run nx run-many -t dev - -gen.proto: - bun nx run @techmely/models:gen - -lint.format: - bunx @biomejs/biome check . --apply - -lint.circular: - bun run madge --extensions ts --exclude '.d.ts$' --circular . - -lint.typecheck: - bun tsc - -lint.useless: - bun run knip - -test.unit: - bun run vitest --passWithNoTests - -test.unit.coverage: - bun run vitest --coverage.all - -test.unit.run: - bun run vitest run --passWithNoTests - -migration.add: - node scripts/generateMigrateFileApi.mjs - -migration.run: - bun run tsx scripts/migrate-db.ts - -docker.build: - bun run nx run-many -t docker.build - -docker.storage: - bun run nx run-many -t docker.storage - -docker.up: - bun run nx run-many -t docker.up - -clean: - bun run nx run-many -t clean -p diff --git a/Makefile.toml b/Makefile.toml index b01f3eec..ef8387e2 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -2,17 +2,16 @@ # https://github.com/sagiegurari/cargo-make extend = [ - { path = "scripts/api.toml" }, - { path = "scripts/generate.toml" }, - { path = "scripts/git.toml" }, - { path = "scripts/migration.toml" }, - { path = "scripts/mobile.toml" }, + # { path = "scripts/api.toml" }, + # { path = "scripts/generate.toml" }, + # { path = "scripts/migration.toml" }, + # { path = "scripts/mobile.toml" }, # { path = "scripts/protobuf.toml" }, - # { path = "scripts/docker.toml" }, + { path = "scripts/docker.toml" }, # { path = "scripts/env.toml" }, - { path = "scripts/tests.toml" }, - { path = "scripts/tool.toml" }, - { path = "scripts/web.toml" }, + # { path = "scripts/tests.toml" }, + # { path = "scripts/tool.toml" }, + # { path = "scripts/web.toml" }, ] [config] @@ -24,3 +23,45 @@ CARGO_PROFILE = "dev" CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true # CARGO_MAKE_CRATE_FS_NAME = "dart_ffi" # CARGO_MAKE_CRATE_NAME = "dart-ffi" + +# lint-useless: +# command: +# - "knip" +# local: true + +# build: +# bun run nx run-many -t build -p + +# dev: +# bun run nx run-many -t dev + + +# lint.useless: +# bun run knip + +# test.unit: +# bun run vitest --passWithNoTests + +# test.unit.coverage: +# bun run vitest --coverage.all + +# test.unit.run: +# bun run vitest run --passWithNoTests + +# migration.add: +# node scripts/generateMigrateFileApi.mjs + +# migration.run: +# bun run tsx scripts/migrate-db.ts + +# docker.build: +# bun run nx run-many -t docker.build + +# docker.storage: +# bun run nx run-many -t docker.storage + +# docker.up: +# bun run nx run-many -t docker.up + +# clean: +# bun run nx run-many -t clean -p diff --git a/README.md b/README.md index 786ca4e5..ab45e627 100644 --- a/README.md +++ b/README.md @@ -102,54 +102,8 @@ _Focus on coding, not publishing._ - Code Snippets say goodbye to the boilerplate - Team Management manage your team & their permissions -This project mainly write with Typescript + Vue + Rust, so you should learn it to contribute easier 🌷 +This project mainly write with React Typescript + Flutter + Rust, so you should learn it to contribute easier 🌷 -## How to run project +### Setup + Run projects -1. Install deps `bun install` -1. Run web site + api with command `bun run dev` -1. Have fun with that. - -## How to get the icons for project? - -1. Go to `https://icones.js.org/collection/all` and search what you needs. -2. Copy the symbol of icons -3. If your icon just specific for one page --> Create a list icons for that page in `/public/svg` folder --> Add page name, EX: post.svg -4. If your icon is a common icon, can use anywhere in app --> add to the last item on `public/svg/common.svg` -5. Use `SvgUse` component to expose the icon on view - -## The decided of technical to fit with the business - -1. The width of detail blog post - - - With the research --> We chosen the width is around 70~80 characters depends on the user-device width + The main language is LATIN(Vietnamese + English). - - So the width is `34rem` to `38rem`. - - Here is some research paper: - - - - -2. - -## Thirst party API - -- - -## Deployment - -### Self-host Docker Deployment - -1. checkout source `git clone https://github.com/techmely/techmely.git` -1. got into new source dir: `cd tech` -1. build Docker image: `docker build .` -1. create local storage directory for settings: `mkdir tml-storage` -1. adjust permissions of storage dir: `sudo chown 911:911 ./tml-storage` -1. start container: `docker-compose up -d` - -```sh -git clone https://github.com/techmely/techmely.git -cd techmely -bun run docker.build # build Docker image for all app -bun run docker.storage # create local storage directory + adjust permissions of storage dir -bun run docker.up # Start container - Enjoy -``` +Go to document "apps/handbook/3.products/1.techmely.md" or `https://www.teams.techmely.com/products/techmely` diff --git a/apps/api/package.json b/apps/api/package.json index 9bad042b..1c3c015b 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -18,8 +18,8 @@ "url": "https://github.com/techmely" }, "dependencies": { - "@aws-sdk/client-s3": "3.569.0", - "@aws-sdk/s3-request-presigner": "3.569.0", + "@aws-sdk/client-s3": "3.572.0", + "@aws-sdk/s3-request-presigner": "3.572.0", "@techmely/auth": "^1.0.1", "@techmely/cache": "1.0.9", "@techmely/domain-driven": "1.0.3", diff --git a/apps/handbook/3.products/1.techmely.md b/apps/handbook/3.products/1.techmely.md index e69de29b..d5e931c3 100644 --- a/apps/handbook/3.products/1.techmely.md +++ b/apps/handbook/3.products/1.techmely.md @@ -0,0 +1,51 @@ +# Techmely + +## How to run project + +1. Install deps `bun install` +1. Run web site + api with command `bun run dev` +1. Have fun with that. + +## How to get the icons for project? + +1. Go to `https://icones.js.org/collection/all` and search what you needs. +2. Copy the symbol of icons +3. If your icon just specific for one page --> Create a list icons for that page in `/public/svg` folder --> Add page name, EX: post.svg +4. If your icon is a common icon, can use anywhere in app --> add to the last item on `public/svg/common.svg` +5. Use `SvgUse` component to expose the icon on view + +## The decided of technical to fit with the business + +1. The width of detail blog post + + - With the research --> We chosen the width is around 70~80 characters depends on the user-device width + The main language is LATIN(Vietnamese + English). + - So the width is `34rem` to `38rem`. + + Here is some research paper: + + - + +2. + +## Thirst party API + +- + +## Deployment + +### Self-host Docker Deployment + +1. checkout source `git clone https://github.com/techmely/techmely.git` +1. got into new source dir: `cd tech` +1. build Docker image: `docker build .` +1. create local storage directory for settings: `mkdir tml-storage` +1. adjust permissions of storage dir: `sudo chown 911:911 ./tml-storage` +1. start container: `docker-compose up -d` + +```sh +git clone https://github.com/techmely/techmely.git +cd techmely +bun run docker.build # build Docker image for all app +bun run docker.storage # create local storage directory + adjust permissions of storage dir +bun run docker.up # Start container - Enjoy +``` diff --git a/apps/web/package.json b/apps/web/package.json index f9a54dd3..fceee08a 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -8,12 +8,12 @@ "@builder.io/partytown": "0.10.2", "@builder.io/react-hydration-overlay": "0.0.8", "@lukemorales/query-key-factory": "1.3.4", - "@sentry/browser": "7.113.0", - "@stripe/stripe-js": "3.3.0", - "@tanstack/query-persist-client-core": "5.34.1", - "@tanstack/query-sync-storage-persister": "5.34.1", - "@tanstack/react-query": "5.34.1", - "@tanstack/react-query-devtools": "5.34.1", + "@sentry/browser": "7.114.0", + "@stripe/stripe-js": "3.4.0", + "@tanstack/query-persist-client-core": "5.35.1", + "@tanstack/query-sync-storage-persister": "5.35.1", + "@tanstack/react-query": "5.35.1", + "@tanstack/react-query-devtools": "5.35.1", "@tanstack/react-table": "8.16.0", "@techmely/cache": "1.0.9", "@techmely/design-system": "workspace:*", @@ -28,25 +28,25 @@ "@techmely/vike-react": "2.0.0", "@techmely/vike-react-query": "4.0.0", "@upstash/ratelimit": "1.1.3", - "@upstash/redis": "1.30.0", + "@upstash/redis": "1.30.1", "@wasmer/sdk": "0.6.0", "bentocache": "1.0.0-beta.8", "blurhash": "2.0.5", "canvas-confetti": "1.9.3", "clsx": "2.1.1", "firebase": "10.11.1", - "framer-motion": "11.1.7", + "framer-motion": "11.1.9", "fuse.js": "7.0.0", "gsap": "3.12.5", - "hono": "4.3.2", + "hono": "4.3.4", "jose": "5.2.4", "kysely": "0.27.3", "million": "3.0.6", "nanoid": "5.0.7", - "openai": "4.40.2", + "openai": "4.44.0", "perfume.js": "9.4.0", "pino": "9.0.0", - "posthog-js": "1.130.2", + "posthog-js": "1.131.3", "qrcode": "1.5.3", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -56,18 +56,18 @@ "sanitize-html": "2.13.0", "simdjson": "0.9.2", "sitemap": "7.1.1", - "stripe": "15.5.0", + "stripe": "15.6.0", "swup": "4.6.1", "telefunc": "0.1.72", "three": "0.164.1", "ts-pattern": "5.1.1", "ua-parser-js": "1.0.37", "unlazy": "0.11.3", - "vaul": "0.9.0" + "vaul": "0.9.1" }, "devDependencies": { - "@hono/vite-dev-server": "0.12.0", - "@inlang/paraglide-js": "1.7.3", + "@hono/vite-dev-server": "0.12.1", + "@inlang/paraglide-js": "1.8.0", "@inlang/paraglide-js-adapter-vite": "1.2.40", "@techmely/types": "1.6.9", "@types/mixpanel-browser": "2.49.0", @@ -86,9 +86,9 @@ "tailwindcss": "3.4.3", "ts-essentials": "10.0.0", "ts-node": "10.9.2", - "tsx": "4.9.1", + "tsx": "4.9.3", "typescript": "5.4.5", - "unocss": "0.59.4", + "unocss": "0.60.0", "unocss-preset-scrollbar": "0.3.1", "unplugin-auto-import": "0.17.5", "vike": "0.4.171", diff --git a/bun.lockb b/bun.lockb index 6e8caf20..31977799 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 82c450ec..dc115518 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,8 +1,8 @@ version: "3.8" - +name: techmely-local-db services: postgresql: - image: docker.io/bitnami/postgresql:16 + image: docker.io/bitnami/postgresql:16.3.0 ports: - "5432:5432" volumes: @@ -30,9 +30,9 @@ services: /bin/sh -c " /usr/bin/mc alias set techmely_minio http://minio:9000 minio_access_key minio_secret_key; /usr/bin/mc mb techmely_minio/techmely; - /usr/bin/mc policy set public techmely_minio/techmely; + /usr/bin/mc mc anonymous set public techmely_minio/techmely; exit 0; " volumes: postgresql_data: {} - minio_data: {} \ No newline at end of file + minio_data: {} diff --git a/packages/design-system/package.json b/packages/design-system/package.json index 42aa0734..b8d4edf7 100644 --- a/packages/design-system/package.json +++ b/packages/design-system/package.json @@ -41,7 +41,7 @@ "@radix-ui/react-slider": "^1.1.2", "@radix-ui/react-switch": "^1.0.3", "@radix-ui/colors": "^3.0.0", - "vaul": "^0.9.0", + "vaul": "^0.9.1", "react": "^18.2.0", "react-hook-form": "^7.51.4" }, diff --git a/packages/hono/package.json b/packages/hono/package.json index 391c1caa..361617fd 100644 --- a/packages/hono/package.json +++ b/packages/hono/package.json @@ -20,9 +20,9 @@ "@techmely/utils": "^3.1.0", "@techmely/auth": "^1.0.1", "jose": "^5.2.4", - "hono": "^4.3.2", + "hono": "^4.3.4", "toucan-js": "^3.4.0", - "zod": "^3.23.6" + "zod": "^3.23.8" }, "devDependencies": { "@techmely/types": "1.6.9", diff --git a/scripts/docker.toml b/scripts/docker.toml new file mode 100644 index 00000000..6992805e --- /dev/null +++ b/scripts/docker.toml @@ -0,0 +1,4 @@ +[tasks.docker-db-local-up] +script = """ +docker-compose -f docker/docker-compose.yml up -d +"""