Skip to content

Lightweight e-commerce app built with Angular, Tailwind CSS, PrimeNG, RxJS, and JSON Server – features cart, authentication, and role-based access control.

Notifications You must be signed in to change notification settings

erkamyaman/mini-e-commerce

Repository files navigation

🛒 Mini E-Commerce

A lightweight e-commerce web application built with Angular, Tailwind CSS, PrimeNG, and JSON Server. It demonstrates state management with RxJS and BehaviorSubject.

🚀 Features

  • Product listing and browsing
  • Shopping cart functionality
  • Responsive design with Tailwind CSS
  • Rich UI with PrimeNG
  • Mock backend with JSON Server
  • State management using Angular services and BehaviorSubject
  • Routing with Angular Router
  • Authentication guard for protected routes
  • Role-based access control (e.g., Admin, Logged-in users)

🛠️ Tech Stack

  • Angular 19.2.7
  • Tailwind CSS for utility-first styling
  • PrimeNG for ready-made UI components
  • RxJS with BehaviorSubject for reactive state
  • JSON Server to simulate a RESTful backend

📦 Installation

git clone https://github.com/yamanerkam/mini-e-commerce.git
cd mini-e-commerce
npm install

🧑‍💻 Development

Start Angular server

ng serve

Visit: http://localhost:4200

Start JSON server

npx json-server --watch db.json

JSON server will run on http://localhost:3000

If you prefer global install:

npm install -g json-server

📁 Project Structure

mini-e-commerce/
├── .vscode/                 # VS Code editor settings
├── public/                  # Static assets
├── src/
│   ├── app/
│   │   ├── core/            # Singleton services and interceptors
│   │   │   ├── guard/       # Route guards (auth, role-based)
│   │   │   ├── service/     # Core/global services (auth, user, etc.)
│   │   │   ├── types/       # Global TypeScript interfaces/types
│   │   ├── layout/          # Layout components (header, footer, etc.)
│   │   ├── pages/           # Page-level features (Home, Product, etc.)
│   │   ├── shared/          # Reusable components, directives, pipes
│   │   ├── app.routes.ts    # Central routing config
│   │   ├── app.component.ts/html/css
│   │   ├── app.service.ts   # App-level logic
│   │   └── app.config.ts    # Global app config
│   ├── assets/              # Images, icons, etc.
│   ├── environments/        # Environment files (dev, prod)
│   ├── main.ts              # App entry point
│   └── index.html           # Base HTML template
├── db.json                  # JSON Server mock API
├── primeNG.config.ts        # PrimeNG setup and themes
├── tailwind.config.js       # Tailwind CSS config
├── angular.json             # Angular workspace config
├── package.json             # Project dependencies
├── .editorconfig            # Coding style config
├── .prettierrc.json         # Prettier formatting rules
├── tsconfig.app.json        # TypeScript config
├── README.md                # Project documentation

🤝 Contributing

Contributions are welcome! Please open an issue or pull request for enhancements or bug fixes.

📄 License

This project is licensed under the MIT License.

About

Lightweight e-commerce app built with Angular, Tailwind CSS, PrimeNG, RxJS, and JSON Server – features cart, authentication, and role-based access control.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published