Skip to content

Felix221123/PromptCart---Smart-eCommerce-Recommender-and-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Prompt Cart - Smart eCommerce Recommender & Assistant

πŸ›’ Overview

Prompt Cart is a Smart eCommerce Application that helps consumers effortlessly find products they’re looking for. The system combines a full-stack web infrastructure and a microservices-ready architecture (FastAPI coming soon) with a chatbot assistant and intelligent product recommender.

This monorepo currently consists of:

  • A Node.js / Express / PostgreSQL backend
  • A React / Typescript / Vite frontend powered by Tailwind CSS, Vitest, Cypress, and Docker

🧩 Tech Stack

Backend

  • PostgreSQL
  • TypeScript
  • Node.js
  • Express.js
  • TypeORM

Frontend

  • React (Typescript) (with Vite)
  • Tailwind CSS
  • Vitest (unit testing)
  • Cypress (E2E testing)
  • Docker & Docker Compose

πŸ“ Project Structure

PromptCart/
β”‚
β”œβ”€β”€ client/             # React Frontend
β”œβ”€β”€ server/             # Node.js Backend
└── README.md

πŸš€ Getting Started

πŸ”§ Prerequisites

  • Node.js v20+
  • npm v10+ or yarn
  • PostgreSQL installed and configured
  • Docker (optional but recommended for containerization)

βš™οΈ Backend Setup (/server)

1. Clone & Navigate

git clone <repo_url>
cd server

2. Configure Environment

Create .env and .env.local files based on .env.example. Fill in your database and server config:

NODE_ENV="local"
AUTH_TOKEN_EXPIRATION_TIME=""
AUTH_TOKEN_SECRET=""

DB_HOST=""
DB_NAME=""
DB_PASSWORD=""
DB_PORT=""
DB_USERNAME=""
DB_MAIN_SCHEMA=""
DB_AUDIT_SCHEMA=""

LOGGING_COMBINED_FILE=""
LOGGING_ERROR_FILE=""
LOGGING_LEVEL=""
LOGGING_TYPE=""

SERVER_PORT=""

3. Create Your PostgreSQL Database

Using a tool like pgAdmin or CLI:

createdb promptcart_db

4. Run Migrations

npm install
npm run db:migration:generate

5. Start Backend Server

npm run server

Backend runs by default at: http://localhost:3000


βœ… Running Backend Tests

# Setup test database first
createdb promptcart_test_db

# Configure .env.test based on .env.example
npm run setup:test
npm test

πŸ–₯️ Frontend Setup (/client)

1. Navigate & Install

cd ../client
npm install

Or with yarn:

yarn install

2. Start Development Server

npm run dev

Or:

yarn dev

Frontend runs by default at: http://localhost:5173


🐳 Running the Frontend with Docker

Docker (Standalone)

docker build -t promptcart-frontend .
docker run -p 5173:5173 promptcart-frontend

Docker Compose

Make sure the provided docker-compose.yml exists in /client, then run:

docker-compose up
# Or detached
docker-compose up -d

To stop:

docker-compose down

πŸ§ͺ Frontend Testing

Unit Tests with Vitest

npm run test
# or interactive:
npm run test:ui

E2E Tests with Cypress

npm run cy:open

🎨 Tailwind CSS

This project uses Tailwind CSS. Modify tailwind.config.js to customize utilities. Example usage:

<button className="bg-blue-500 hover:bg-blue-700 text-white py-2 px-4 rounded">
  Click me
</button>

πŸ“¦ Building for Production

npm run build

βœ… Notes

  • Ensure the backend is running and accessible to the frontend for API requests.
  • You can update the frontend to point to the backend by setting a proxy in vite.config.ts.

πŸ“œ License

This project is licensed under the MIT License.


πŸ”— Resources


About

Prompt Cart is a Smart eCommerce Application that helps consumers effortlessly find products they are looking for.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors