An open API service indexing awesome lists of open source software.

https://github.com/misbahul-alam/shopping-bag

A scalable full-stack eCommerce app using NestJS, TypeORM, PostgreSQL, and Next.js with authentication, product catalog, cart, orders, and address management.
https://github.com/misbahul-alam/shopping-bag

nestjs nextjs postgresql typeorm typescript

Last synced: 2 months ago
JSON representation

A scalable full-stack eCommerce app using NestJS, TypeORM, PostgreSQL, and Next.js with authentication, product catalog, cart, orders, and address management.

Awesome Lists containing this project

README

          

# Shopping-Bag ๐Ÿ›๏ธ

A modern full-stack e-commerce application built with Next.js and NestJS, offering a seamless shopping experience with a clean, minimalist design philosophy.

## ๐Ÿ“‹ Overview

Shopping-Bag is an e-commerce platform that focuses on delivering carefully curated products with an emphasis on quality essentials and thoughtful design. The application features a responsive frontend built with Next.js and React, backed by a robust NestJS API.

## โœจ Features

- ๐ŸŽจ Modern, responsive UI with Tailwind CSS and DaisyUI
- ๐Ÿ›’ Product browsing with category carousels
- ๐Ÿ“ฑ Mobile-first responsive design
- ๐Ÿ” User authentication (Login/Register)
- ๐Ÿช Shop and product detail pages
- ๐ŸŽฏ Featured products, new arrivals, and best sellers sections
- ๐Ÿ“ฆ Shopping cart functionality
- ๐ŸŽญ Clean and intuitive user interface

## ๐Ÿ› ๏ธ Tech Stack

### Frontend

- **Framework:** Next.js 16 (React 19)
- **Language:** TypeScript
- **Styling:** Tailwind CSS, DaisyUI
- **State Management:** Zustand
- **UI Components:** Custom components with react-icons
- **Carousel:** Embla Carousel React
- **Package Manager:** pnpm

### Backend

- **Framework:** NestJS 11
- **Language:** TypeScript
- **Runtime:** Node.js
- **Package Manager:** pnpm

## ๐Ÿ“ Project Structure

```
shopping-bag/
โ”œโ”€โ”€ frontend/ # Next.js frontend application
โ”‚ โ”œโ”€โ”€ src/
โ”‚ โ”‚ โ”œโ”€โ”€ app/ # Next.js app directory (pages & routes)
โ”‚ โ”‚ โ”œโ”€โ”€ components/ # Reusable React components
โ”‚ โ”‚ โ”œโ”€โ”€ store/ # Zustand state management
โ”‚ โ”‚ โ””โ”€โ”€ images/ # Static image assets
โ”‚ โ””โ”€โ”€ public/ # Public static files
โ”œโ”€โ”€ backend/ # NestJS backend API
โ”‚ โ”œโ”€โ”€ src/
โ”‚ โ”‚ โ”œโ”€โ”€ app.module.ts
โ”‚ โ”‚ โ”œโ”€โ”€ app.controller.ts
โ”‚ โ”‚ โ”œโ”€โ”€ app.service.ts
โ”‚ โ”‚ โ””โ”€โ”€ main.ts
โ”‚ โ””โ”€โ”€ test/ # E2E tests
โ””โ”€โ”€ old-backend/ # Legacy backend (deprecated)
```

## ๐Ÿš€ Getting Started

### Prerequisites

- Node.js (v18 or higher)
- pnpm (recommended) or npm
- Git

### Installation

1. **Clone the repository**

```bash
git clone https://github.com/misbahul-alam/Shopping-Bag.git
cd Shopping-Bag
```

2. **Install frontend dependencies**

```bash
cd frontend
pnpm install
```

3. **Install backend dependencies**
```bash
cd backend
pnpm install
```

### Running the Application

#### Development Mode

1. **Start the backend server**

```bash
cd backend
pnpm run start:dev
```

The backend will run on `http://localhost:3000`

2. **Start the frontend development server**
```bash
cd frontend
pnpm run dev
```
The frontend will run on `http://localhost:3000` (or next available port)

#### Production Mode

1. **Build and start the backend**

```bash
cd backend
pnpm run build
pnpm run start:prod
```

2. **Build and start the frontend**
```bash
cd frontend
pnpm run build
pnpm run start
```

## ๐Ÿ“œ Available Scripts

### Frontend Scripts

- `pnpm dev` - Start development server
- `pnpm build` - Build for production
- `pnpm start` - Start production server
- `pnpm lint` - Run ESLint

### Backend Scripts

- `pnpm run start` - Start the application
- `pnpm run start:dev` - Start in watch mode
- `pnpm run start:debug` - Start in debug mode
- `pnpm run start:prod` - Start production build
- `pnpm run build` - Build the application
- `pnpm run test` - Run unit tests
- `pnpm run test:e2e` - Run end-to-end tests
- `pnpm run test:cov` - Run tests with coverage
- `pnpm run lint` - Run ESLint and fix issues
- `pnpm run format` - Format code with Prettier

## ๐ŸŽจ Key Features in Detail

### Frontend Pages

- **Home Page** - Hero section with featured products, new arrivals, and best sellers
- **Shop Page** - Browse all products with filtering options
- **Product Detail** - Detailed product information and purchase options
- **Login/Register** - User authentication pages
- **Cart** - Shopping cart management

### Component Architecture

- **Layout Components** - Header, Footer, Drawer, MainLayout
- **UI Components** - Button, InputField, SelectField, TextArea
- **Feature Components** - ProductCard, CategoryCarousel

## ๐Ÿ”ง Configuration

### Environment Variables

Create `.env` files in both frontend and backend directories:

**Backend `.env`:**

```env
PORT=3000
# Add your environment variables here
```

**Frontend `.env.local`:**

```env
NEXT_PUBLIC_API_URL=http://localhost:3000
# Add your environment variables here
```

## ๐Ÿงช Testing

Run tests in the backend:

```bash
cd backend
pnpm run test # Unit tests
pnpm run test:e2e # E2E tests
pnpm run test:cov # Coverage report
```

## ๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## ๐Ÿ“ License

This project is licensed under the UNLICENSED license.

## ๐Ÿ‘ค Author

**Misbahul Alam**

- GitHub: [@misbahul-alam](https://github.com/misbahul-alam)

## ๐Ÿ™ Acknowledgments

- Next.js team for the amazing framework
- NestJS team for the robust backend framework
- The open-source community for the excellent tools and libraries

---

**Note:** This project is currently in active development. Some features may be incomplete or subject to change.