Skip to content

LuXDAmore/wegree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

180 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WeGree

WeGree is a B2B marketplace for telematic auctions and direct-sale industrial assets. The MVP covers three business areas:

  • Direct Sale / 01 Machinery showcase, sourced from Zucchetti.
  • Judicial real-estate listings, enriched in WeGree and redirected to the external AstaLegale/Falco engine.
  • Proprietary movable-goods auctions, managed by the WeGree backoffice with deposits, bids and realtime updates.

Stack

  • Nuxt 4 SSR, Nitro API routes and Nitro WebSocket.
  • Nuxt UI 4, Tailwind CSS 4, Pinia and @nuxtjs/i18n.
  • NuxtHub with Neon PostgreSQL, Vercel Blob and Vercel KV.
  • Better Auth through @onmax/nuxt-better-auth, with email/password and Google/LinkedIn OAuth.
  • Stripe for deposits and Resend for transactional email.
  • Drizzle ORM schema in server/db/schema.ts.

Prerequisites

  • Node.js 24.
  • pnpm 10.33.2, pinned by packageManager.
  • mkcert for trusted HTTPS on localhost.
  • Local .env copied from the right file in env/.

Install dependencies:

pnpm install

Local Environment

Copy the development env file to the project root:

Copy-Item env/.env.development .env

The local dev server runs over HTTPS. Install and trust the local certificate once:

winget install mkcert
mkcert -install
mkcert -key-file certificates/server.key.pem -cert-file certificates/server.cert.pem localhost 127.0.0.1 ::1

Start the app:

pnpm dev

Default local URL:

https://localhost:3000

Database

Database schema changes must start from Drizzle schema files, not manual SQL migrations.

  1. Edit server/db/schema.ts or another schema file under server/db/schema/.
  2. Generate migrations with NuxtHub:
npx nuxt db generate
  1. Apply migrations:
npx nuxt db migrate

Never create files manually in server/db/migrations/.

Useful scripts:

pnpm db:generate
pnpm db:migrate
pnpm db:sql

Dev Seed Users

The endpoint POST /api/dev/seed-users is disabled by default and returns 404 unless explicitly enabled. It is also blocked in production.

Enable it locally:

DEV_SEED_USERS_ENABLED=true
DEV_SEED_USERS_TOKEN=una-stringa-lunga-e-random

Run the app, then seed local users:

pnpm dev
pnpm seed:users:local

The script reads DEV_SEED_USERS_TOKEN, posts to https://localhost:3000/api/dev/seed-users, and sends the x-seed-token header. Override the URL when needed:

SEED_USERS_URL=https://localhost:3001/api/dev/seed-users pnpm seed:users:local

To create a complete local demo dataset with fake B2B buyers, procedures, auctions, lots, registrations, manual deposits, bids, bid audit logs and auction messages:

pnpm seed:demo:local

The demo seed posts to https://localhost:3000/api/dev/seed-demo, uses the same token header, and resets only records with the DEMO- prefix before recreating them. Override the URL when needed:

SEED_DEMO_URL=https://localhost:3001/api/dev/seed-demo pnpm seed:demo:local

Seed credentials returned by the endpoint use password:

Password123!

Production Smoke Users

Use this only for controlled production or staging smoke tests. The endpoint POST /api/ops/seed-production-smoke-users is disabled by default and returns 404 until explicitly enabled.

Required private environment variables:

PROD_SMOKE_USERS_ENABLED=true
PROD_SMOKE_USERS_TOKEN=una-stringa-lunga-e-random
PROD_SMOKE_USERS_PASSWORD=una-password-di-almeno-8-caratteri

Run the interactive script:

pnpm seed:prod-smoke-users

The script asks for the deployed endpoint URL and the secret token at runtime using consola.prompt. These values are not read from a local env file and are not saved in the repository.

The seed is idempotent, writes a forensic log, never returns the password, and only provisions controlled @wegree.it or @wegree.com smoke users:

qa-admin@wegree.it
qa-buyer-a@wegree.it
qa-buyer-b@wegree.it

Local Demo Quickstart

Use this path when you want a local WeGree instance with fake users, auctions, lots, registrations, manual deposits and bids.

  1. Prepare the local environment:
pnpm install
Copy-Item env/.env.development .env
  1. Make sure the local seed endpoint is enabled in .env:
DEV_SEED_USERS_ENABLED=true
DEV_SEED_USERS_TOKEN=una-stringa-lunga-e-random
  1. Create the HTTPS certificate if it is not already present:
mkcert -install
mkcert -key-file certificates/server.key.pem -cert-file certificates/server.cert.pem localhost 127.0.0.1 ::1
  1. Apply the current database migrations:
pnpm db:migrate
  1. Start Nuxt:
pnpm dev
  1. In a second terminal, create the base users and the demo marketplace data:
pnpm seed:users:local
pnpm seed:demo:local

The demo seed is idempotent for demo records: it removes and recreates only data with the DEMO- prefix. It does not delete non-demo local records.

Demo Accounts

All seeded accounts use:

Password123!

Useful logins:

Role Email Use case
Admin admin@wegree.local Backoffice and project checks
Operator operatore@wegree.local Auction operations and approvals
Buyer buyer@wegree.local Basic buyer account
Buyer buyer-b2b@wegree.local Approved B2B buyer
Buyer buyer-rossi@wegree.local Manual-approval demo buyer
Buyer buyer-logistica@wegree.local Manual-deposit demo buyer

What To Check

Open https://localhost:3000 and verify:

  • Login works with the seeded accounts.
  • /backoffice/aste shows the demo auctions.
  • /aste/mobili shows demo movable-goods auctions and lots.
  • A free demo auction can receive bids without Stripe.
  • Manual-approval and manual-deposit demo auctions show the participation flow without calling Stripe.

Run quality checks after code or seed changes:

pnpm typecheck
pnpm lint

Quality Commands

Use these checks before opening a PR or deploying:

pnpm typecheck
pnpm test:unit -- --run
pnpm test:nuxt
pnpm test:coverage
pnpm build
pnpm lint

pnpm lint must finish with a clean console. If it reports errors or warnings, fix them and rerun the command.

Main Scripts

pnpm dev
pnpm build
pnpm start
pnpm generate
pnpm preview
pnpm lint
pnpm lint:fix
pnpm test
pnpm test:unit -- --run
pnpm test:nuxt
pnpm test:coverage
pnpm seed:demo:local
pnpm seed:users:local

Commit Rules

This repository uses Conventional Commits and commitlint. Commit messages follow:

type(scope?): subject

Common types:

feat, fix, docs, chore, ci, test, refactor, perf, build, style, revert

Rules:

  • Keep commits atomic: one logical change per commit.
  • Do not commit unrelated files or broad "misc" changes.
  • Prefer short English technical subjects for changelog and release automation.
  • Run pnpm lint and the relevant tests before committing.
  • Keep PR history readable; squash only when the final commit message remains meaningful.

References:

Releases

Versioning and changelog generation use commit-and-tag-version:

pnpm version:patch
pnpm version:minor
pnpm version:major

About

WeGree - Aste telematiche di beni mobili (giudiziali ex art. 216 CCII e libero mercato), Vetrina Direct Sale per i beni di proprietà 01 Machinery, Aste immobiliari giudiziarie (appoggiandosi a un motore esterno, inizialmente Astalegale S.p.A. o Falco/Zucchetti)

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors