Skip to content

Akb#485

Closed
qnafin wants to merge 27 commits into
nextorders:mainfrom
qnafin:akb
Closed

Akb#485
qnafin wants to merge 27 commits into
nextorders:mainfrom
qnafin:akb

Conversation

@qnafin
Copy link
Copy Markdown

@qnafin qnafin commented May 30, 2026

Summary by cubic

Move Essence to PostgreSQL with drizzle-orm and add a full DB-backed catalog, orders, services, reviews, and lead capture. Split channel config (delivery/payment/links) with env-driven company details and updated web UI for services, media gallery, and lead forms.

  • New Features

    • PostgreSQL setup via drizzle-orm/pg with full schema, migrations, and seeds (products, categories, variants, badges, ingredients, composition, recommended, orders, leads, services, reviews).
    • New DB utils and scripts: db:generate, db:migrate, db:push, db:studio, db:seed.
    • Orders now persist to DB; added leads for requests and VK notifications; updated storefront gateway for lead creation.
    • Channel config split into delivery, links, payment, copyright; schedules and payment options refined; values pulled from env.
    • UI: services section and cards, lead modal/buttons, battery estimate form, product media gallery (fancybox), SEO composables, footer/nav tweaks.
    • Reduced product locales to Russian-only to simplify content.
    • Added .env.example and ignore local *.db files.
  • Migration

    • Create apps/essence/.env from .env.example and set POSTGRES_URL, VK_ACCESS_TOKEN, YOUR_NAME, PHONE_NUMBER, EMAIL, INN, OGRN, LOCAL_CITY, LOCAL_ADDRESS.
    • From apps/essence, run: pnpm db:migrate then pnpm db:seed.

Written for commit efab907. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added product catalog system with categories, variants, and product badges.
    • Added order management functionality for order creation and tracking.
    • Added services section with customer reviews and ratings.
    • Added lead submission system for customer inquiries.
    • Implemented product recommendations and composition features.
  • Chores

    • Configured database infrastructure and initialized seed data for the catalog.
    • Updated product data to Russian language support.

Review Change Stack

@qnafin qnafin requested a review from hmbanan666 as a code owner May 30, 2026 04:53
@github-actions
Copy link
Copy Markdown

👋 @qnafin

💖 Thanks for opening this pull request!

We use semantic commit messages to streamline the release process.

Examples of commit messages with semantic prefixes:

  • fix: interval for sending a request in the base service
  • feat: add new NAME service
  • docs: example of using the NAME service

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9c02ee42-c9c3-418a-95b3-8f8187304d44

📥 Commits

Reviewing files that changed from the base of the PR and between ea6da5b and efab907.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (132)
  • .gitignore
  • apps/essence/.env.example
  • apps/essence/drizzle.config.ts
  • apps/essence/migrate.load
  • apps/essence/nuxt.config.ts
  • apps/essence/package.json
  • apps/essence/server/api/storefront/gateway.post.ts
  • apps/essence/server/db/index.ts
  • apps/essence/server/db/migrations/0000_sloppy_outlaw_kid.sql
  • apps/essence/server/db/migrations/0001_glorious_polaris.sql
  • apps/essence/server/db/migrations/0002_misty_snowbird.sql
  • apps/essence/server/db/migrations/0003_steep_earthquake.sql
  • apps/essence/server/db/migrations/0004_even_santa_claus.sql
  • apps/essence/server/db/migrations/0005_handy_red_skull.sql
  • apps/essence/server/db/migrations/0006_glorious_ben_parker.sql
  • apps/essence/server/db/migrations/0007_bright_pet_avengers.sql
  • apps/essence/server/db/migrations/0008_minor_ronan.sql
  • apps/essence/server/db/migrations/0009_zippy_viper.sql
  • apps/essence/server/db/migrations/0010_silky_korg.sql
  • apps/essence/server/db/migrations/0011_lyrical_ender_wiggin.sql
  • apps/essence/server/db/migrations/meta/0000_snapshot.json
  • apps/essence/server/db/migrations/meta/0001_snapshot.json
  • apps/essence/server/db/migrations/meta/0002_snapshot.json
  • apps/essence/server/db/migrations/meta/0003_snapshot.json
  • apps/essence/server/db/migrations/meta/0004_snapshot.json
  • apps/essence/server/db/migrations/meta/0005_snapshot.json
  • apps/essence/server/db/migrations/meta/0006_snapshot.json
  • apps/essence/server/db/migrations/meta/0007_snapshot.json
  • apps/essence/server/db/migrations/meta/0008_snapshot.json
  • apps/essence/server/db/migrations/meta/0009_snapshot.json
  • apps/essence/server/db/migrations/meta/0010_snapshot.json
  • apps/essence/server/db/migrations/meta/0011_snapshot.json
  • apps/essence/server/db/migrations/meta/_journal.json
  • apps/essence/server/db/schema/badges.ts
  • apps/essence/server/db/schema/categories.ts
  • apps/essence/server/db/schema/index.ts
  • apps/essence/server/db/schema/ingredients.ts
  • apps/essence/server/db/schema/leads.ts
  • apps/essence/server/db/schema/menu.ts
  • apps/essence/server/db/schema/orders.ts
  • apps/essence/server/db/schema/productComposition.ts
  • apps/essence/server/db/schema/productIngredients.ts
  • apps/essence/server/db/schema/productVariants.ts
  • apps/essence/server/db/schema/products.ts
  • apps/essence/server/db/schema/recommended.ts
  • apps/essence/server/db/schema/reviews.ts
  • apps/essence/server/db/schema/serviceReviews.ts
  • apps/essence/server/db/schema/services.ts
  • apps/essence/server/db/seed/badges.ts
  • apps/essence/server/db/seed/composition.ts
  • apps/essence/server/db/seed/index.ts
  • apps/essence/server/db/seed/menu.ts
  • apps/essence/server/db/seed/orders.ts
  • apps/essence/server/db/seed/products.ts
  • apps/essence/server/db/seed/recommended.ts
  • apps/essence/server/db/seed/services.ts
  • apps/essence/server/services/channel.ts
  • apps/essence/server/services/channel/copyright.ts
  • apps/essence/server/services/channel/delivery.ts
  • apps/essence/server/services/channel/index.ts
  • apps/essence/server/services/channel/links.ts
  • apps/essence/server/services/channel/payment.ts
  • apps/essence/server/services/data/products/burgers.ts
  • apps/essence/server/services/data/products/desserts.ts
  • apps/essence/server/services/data/products/hotMeals.ts
  • apps/essence/server/services/data/products/salads.ts
  • apps/essence/server/services/data/products/snacks.ts
  • apps/essence/server/services/data/products/soups.ts
  • apps/essence/server/services/lead.ts
  • apps/essence/server/services/menu.ts
  • apps/essence/server/services/options.ts
  • apps/essence/server/services/order.ts
  • apps/essence/server/services/product.ts
  • apps/essence/server/services/review.ts
  • apps/essence/server/services/service.ts
  • apps/essence/server/utils/safeJsonParse.ts
  • apps/essence/server/utils/slugify.ts
  • apps/essence/server/utils/vk-messenger.ts
  • apps/web-app/app/app.config.ts
  • apps/web-app/app/components/Button/Lead.vue
  • apps/web-app/app/components/Button/Vk.vue
  • apps/web-app/app/components/Footer.vue
  • apps/web-app/app/components/Modal/Lead.vue
  • apps/web-app/app/components/Navigation.vue
  • apps/web-app/app/components/Service/ServiceCard.vue
  • apps/web-app/app/components/form/BatteryEstimate.vue
  • apps/web-app/app/components/form/Lead.vue
  • apps/web-app/app/components/form/OrderPayment.vue
  • apps/web-app/app/components/form/OrderTime.vue
  • apps/web-app/app/components/product/ProductMediaGallery.vue
  • apps/web-app/app/components/sections/BatterySection.vue
  • apps/web-app/app/components/sections/FinalCTASection.vue
  • apps/web-app/app/components/sections/HeroSection.vue
  • apps/web-app/app/components/sections/ReviewsSection.vue
  • apps/web-app/app/components/sections/ServicesSection.vue
  • apps/web-app/app/composables/useCategorySeo.ts
  • apps/web-app/app/composables/useHomeSeo.ts
  • apps/web-app/app/composables/useLeadModal.ts
  • apps/web-app/app/composables/useLeade.ts
  • apps/web-app/app/composables/usePhoneValidation.ts
  • apps/web-app/app/composables/useProductSeo.ts
  • apps/web-app/app/composables/useServiceSeo.ts
  • apps/web-app/app/pages/[categorySlug]/[productSlug]/index.vue
  • apps/web-app/app/pages/[categorySlug]/index.vue
  • apps/web-app/app/pages/checkout.vue
  • apps/web-app/app/pages/finish.vue
  • apps/web-app/app/pages/index.vue
  • apps/web-app/app/pages/offer.vue
  • apps/web-app/app/pages/payment.vue
  • apps/web-app/app/pages/privacy.vue
  • apps/web-app/app/pages/services/[slug]/index.vue
  • apps/web-app/app/pages/services/index.vue
  • apps/web-app/app/stores/review.ts
  • apps/web-app/app/stores/service.ts
  • apps/web-app/package.json
  • docker-compose.prod.yml
  • docker-compose.yml
  • docker/web-app/Dockerfile
  • packages/core/server/api/lead/index.post.ts
  • packages/core/server/api/reviews/index.get.ts
  • packages/core/server/api/services/index.get.ts
  • packages/core/server/utils/api.ts
  • packages/food-schema/src/index.ts
  • packages/food-schema/src/types/gateway.ts
  • packages/food-schema/src/types/lead.ts
  • packages/food-schema/src/types/order.ts
  • packages/food-schema/src/types/product.ts
  • packages/food-schema/src/types/review.ts
  • packages/food-schema/src/types/service.ts
  • packages/ui/i18n/locales/ru-RU.ts
  • packages/ui/nuxt.config.ts
  • pnpm-workspace.yaml

📝 Walkthrough

Walkthrough

This PR establishes the complete PostgreSQL database infrastructure for the Essence food service application, including migrations, schema definitions, and seeding scripts. The monolithic channel service is refactored into modular components, and the gateway API is extended to support leads, services, and reviews.

Changes

Database Infrastructure & Service Setup

Layer / File(s) Summary
Configuration & Dependencies
.gitignore, apps/essence/.env.example, apps/essence/drizzle.config.ts, apps/essence/nuxt.config.ts, apps/essence/package.json
Environment variables defined for PostgreSQL and API credentials; Drizzle Kit configured for PostgreSQL migrations; npm scripts added for database operations (db:generate, db:migrate, db:studio, db:push, db:seed); dependencies added for pg, drizzle-orm, and dotenv.
Database Instance & Migrations
apps/essence/server/db/index.ts, apps/essence/server/db/migrations/, apps/essence/server/db/migrations/meta/
Drizzle database instance initialized from PostgreSQL connection pool; 12 sequential migrations establish schema from base tables (categories, menus) through orders, products, services, and reviews with foreign key relationships and constraints documented in migration snapshots.
TypeScript Schema Definitions
apps/essence/server/db/schema/index.ts, apps/essence/server/db/schema/*.ts
Drizzle ORM type-safe schema definitions exported for all entities: categories, menus, products, product variants, badges, ingredients, orders, services, reviews, and composition/recommendation join tables.
Database Seeding & Product Data
apps/essence/server/db/seed/, apps/essence/server/services/data/products/
Seed scripts populate initial menu, products with variants, badges, ingredients, compositions, recommendations, services, orders, and leads; product data files (burgers, desserts, hot meals) trimmed to Russian-only localization for consistent seeding.
Channel Service Refactoring
apps/essence/server/services/channel/
Monolithic channel service split into modular components: index.ts provides gateway handlers (channels, delivery/pickup status, time slots); delivery.ts defines schedules and conditions; links.ts, payment.ts, and copyright.ts provide configuration; old channel.ts removed.
Gateway API Extensions
apps/essence/server/api/storefront/gateway.post.ts
Gateway imports refactored channel service from new modular path; added support for createLead, getServices, and getReviews request types with proper type casting and field extraction.

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly Related PRs

  • nextorders/food#378: Both PRs modify the database/migrations wiring for the Essence app—especially apps/essence/drizzle.config.ts—changing the Drizzle dialect/credentials/schema inputs used to run migrations.

Suggested Labels

enhancement, 2.x

Poem

🐰 A rabbit hops through schema rows,
Where PostgreSQL wisdom flows,
Migrations dance in ordered files,
Seeds grow gardens, channel smiles,
Services bloom from modular care,
Database dreams bloom everywhere! 🌱

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​fancyapps/​ui@​6.1.13100100769670
Added@​types/​better-sqlite3@​7.6.131001007180100
Added@​types/​pg@​8.20.01001007384100
Addeddrizzle-orm@​0.38.498858898100
Addeddotenv@​16.6.19910010092100
Addeddrizzle-kit@​0.31.10991009699100

View full report

@qnafin qnafin closed this May 30, 2026
@qnafin qnafin deleted the akb branch May 30, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant