Skip to content

Repository files navigation

ComputerGe

A Multi Region E-Commerce Platform with currency support and payment gateways .

Multi-region e-commerce websie with high performance it features seamless payment gateways, load balancing, user interface for an optimized user experience, and high security.


Preview

Storefront Admin Dashboard Shop

Stack

Next.js 16 (App Router) · TypeScript · Tailwind v4 · shadcn/ui · tRPC v11 · Prisma + PostgreSQL · better-auth · Typesense · Cloudflare R2 · Stripe + Paymob · Bun


What it does

  • Storefront :

  • Admin dashboard : Manage prodcuts,brands,categories,orders, and storefront . also there is analytics page with charts

  • Payments : Paymob (card, Fawry, and mobile wallet), Stripe everywhere else and cache on delivery

  • Search : Typesense for fast product search, auto-synced on product create/update/delete (currently disabled because i dont have server to try on it, i tried it locally and it works)

  • Uploads : Cloudflare R2 via presigned URLs, images never pass through the server (that is a feature because image upload performance will decrease if passes in server )


Regions

Key Country Language Currency Payments
eg-ar Egypt Arabic / RTL EGP Paymob + COD
us-en USA English / LTR USD Stripe + COD

You can handle more see next-region/region.ts .


Running locally

You need PostgreSQL, a Typesense instance, a Cloudflare R2 bucket, and Stripe/Paymob accounts if you want to test payments.

git clone https://github.com/ttherealdev/computerge.git
cd computerge
bun install
cp .env.example .env   # fill it
bun db:generate && bun db:migrate --name init
bun dev

Opens at localhost:3000, redirects to /us-en by default.


Auth

better-auth with email & password and email verification and google. Sessions in PostgreSQL.

Roles : Developer, Admin, Staff, User

Staff can only access orders and customer support. Admins get full store management. Route protection is split between the proxy and tRPC procedure types (adminProcedure, staffProcedure).

Content caching

The storefront uses unstable_cache to give it high performance like popular shops Amazon & Noon. When you update a hero slide or featured product in the dashboard it calls revalidateTag immediately .


Environment variables

NEXT_PUBLIC_APP_URL=

DATABASE_URL=

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

BETTER_AUTH_SECRET=
BETTER_AUTH_URL=

R2_ACCOUNT_ID=
R2_ACCESS_KEY_ID=
R2_SECRET_ACCESS_KEY=
R2_BUCKET_NAME=
R2_PUBLIC_URL=

TYPESENSE_HOST=
TYPESENSE_PORT=8108
TYPESENSE_PROTOCOL=http
TYPESENSE_API_KEY=

STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=

PAYMOB_API_KEY=
PAYMOB_HMAC_SECRET=
PAYMOB_CARD_INTEGRATION_ID=
PAYMOB_WALLET_INTEGRATION_ID=
PAYMOB_FAWRY_INTEGRATION_ID=

EXCHANGE_RATE_API_KEY=

Deployment

Runs On Vercel .

If you want to deploy it on Dokploy edit proxy.ts ( Recommneded to deploy on Dokploy and make database and typesense internal )

  • Make compose service and upload project and put your env .

Contact

**If you have an any issue open it in issues or you will find me Anas Mohameed

MIT

About

e-commerce store with payment gateway .

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages