FreshCart is a standalone Angular 21 e-commerce storefront that consumes the Route E-Commerce API to deliver a complete shopping flow: authentication, product discovery, category and brand browsing, wishlist management, cart management, checkout, order history, profile settings, and bilingual UI support.
The application uses Angular SSR with hydration, lazy-loaded feature routes, Angular signals for UI state, and a service-driven data layer built on HttpClient. It is structured as a portfolio-ready storefront rather than a design-system demo, with real API integration and production build support.
- Standalone Angular 21 architecture with lazy-loaded feature routes
- Server-side rendering with hydration and event replay
- Authentication flow with signup, login, logout, and forgot-password reset steps
- Product catalog with pagination, filters, and product detail pages
- Category and brand browsing
- Search page with client-side filtering, sorting, and pagination
- Wishlist and cart flows for authenticated users
- Guest cart and guest wishlist persistence using
localStorage - Checkout flow with cash order support and hosted checkout session redirect
- Profile area with address management and account/password update forms
- Order history page for authenticated users
- Arabic and English translations via
ngx-translate - UI feedback with
ngx-toastrand SweetAlert2 dialogs - Swiper-powered product carousel sections
- Tailwind CSS v4 styling
- Angular
21.2.x - TypeScript
5.9.x - Angular SSR
- RxJS
- Angular Signals
- Tailwind CSS
4 @ngx-translate/corengx-toastr@sweetalert2/ngx-sweetalert2swiperngx-cookie-service- Express
5 - Vercel
This project is an online grocery-style storefront branded as FreshCart. Users can:
- browse featured products, categories, and brands
- search and filter products by query, price, category, and brand
- open product detail pages and review product ratings/reviews
- create an account or log in
- add products to a cart or wishlist
- complete checkout with saved shipping addresses
- review previous orders
- manage profile data, password, and addresses
- switch between English and Arabic
- Standalone app: the app uses standalone components and
bootstrapApplication()rather than NgModules. - Routing: all major sections are lazy-loaded through route definition files.
- SSR setup: Angular SSR is configured through
src/server.ts,src/main.server.ts,src/app/app.config.server.ts, andsrc/app/app.routes.server.ts. - State management: there is no NgRx or external store. The project uses Angular signals and a small number of RxJS streams/subjects for local feature state.
- Data layer: components call services in
src/app/core/services, which in turn call the Route API usingHttpClient. - Auth/session handling: JWT tokens are stored in cookies, and current user data is mirrored into local storage for client state restoration.
Main application routes from src/app/app.routes.ts:
/home/login/signup/forget-password/categories/categories/:id/products/products/:id/brands/search/wishlist/cart/checkout/orders/profile/profile/addresses/profile/settings/contact
Route guards:
guestGuardblocks logged-in users from auth pagesauthGuardprotects checkout, orders, and profile routes
The app follows a straightforward Angular feature flow:
- Feature components read route params/query params.
- Components call injected services from
src/app/core/services. - Services call the Route API using
HttpClient. - Responses are mapped into typed models from
src/app/core/models. - Components store UI state with signals and render it in standalone templates.
Examples:
ProductServiceloads products and product detailsCategoryService,BrandService, andSubCategoryServicesupport catalog navigationCartServicemanages both server cart operations and guest cart persistenceWishlistServicemanages both server wishlist operations and guest wishlist persistenceAuthServicehandles signup, signin, token access, password reset, and current-user stateOrderServicecreates cash orders, checkout sessions, and fetches user orders
- Base API URL from
src/environments/environment.tsandsrc/environments/environment.development.ts:https://ecommerce.routemisr.com/api
- Translation files:
public/i18n/en.jsonpublic/i18n/ar.json
- Third-party UI/runtime integrations:
ngx-toastrSweetAlert2Swiperngx-cookie-service
src/
app/
core/
constants/ # shared constants and validators
guards/ # auth and guest route guards
interceptors/ # auth token interceptor
models/ # API response and domain models
services/ # API and storage services
features/
auth/ # login, signup, forgot-password
home/ # landing page sections
products/ # product listing page
productDetails/ # product details and reviews
categories/ # categories list
categoryDetails/ # subcategories by category
brands/ # brands list
search/ # client-side search/filter experience
cart/ # cart page and cart item cards
wishlist/ # wishlist page
checkout/ # checkout flow
orders/ # orders history
profile/ # profile shell, addresses, settings
contact/ # contact page
notFound/ # fallback route
shared/
components/ # reusable UI components
types/ # shared filter types
utils/ # helper utilities
app.config*.ts # app/browser/server provider setup
app.routes*.ts # browser/server routes
environments/ # environment configuration
main.ts # browser bootstrap
main.server.ts # SSR bootstrap
server.ts # Express SSR server
public/
i18n/ # translation JSON files
images/ # static images
icons/ # SVG sprite assets
- Node.js 20+ recommended for Angular 21
- npm 11+ recommended
npm installnpm startThe app runs with Angular dev server on the default local port used by Angular CLI.
npm run buildnpm run serve:ssr:e-commerceThis serves the generated SSR output from dist/e-commerce/server/server.mjs.
Development watch build:
npm run watchProduction build:
npm run buildArtifacts are written to:
dist/e-commerce
Environment files:
src/environments/environment.tssrc/environments/environment.development.ts
Current configuration:
export const environment = {
baseUrl: 'https://ecommerce.routemisr.com/api',
};If you need to point the app to another backend, update baseUrl in both environment files.
- Add route resolvers or smarter data prefetching for key pages
- Add skeleton/loading states consistently across all API-backed views
- Introduce error boundaries or centralized API error presentation
- Add analytics, SEO metadata, and richer Open Graph support
- Add persistent recently viewed products
- Add coupon, payment, and checkout success/cancel pages