This repository contains a full-stack sample e-commerce application:
shopapp-angular/— Angular frontend (client-side + server-side rendering files included)shopapp-backend/— Spring Boot backend (Java, Maven)
This README explains how to set up, run, build and test both parts on a development machine (Windows with bash available).
- Project overview
- Directory layout
- Prerequisites
- Frontend (development, build, SSR)
- Backend (run, build, DB)
- Environment & configuration
- Uploads and static assets
- Tests
- Contributing
ShopApp is a small e-commerce example app with an Angular SPA frontend and a Spring Boot REST backend. The frontend contains components, services, and server-side rendering (SSR) entry points. The backend provides APIs, data storage, and handles uploads.
shopapp-angular/— Angular app source and configurationshopapp-backend/— Spring Boot backend (Maven project)uploads/— uploaded files used by the backend
See each subfolder for more detail.
- Node.js (>= 16 recommended) and npm or yarn
- Angular CLI (optional for global dev tools)
- Java JDK 11+ (or the version required by the backend pom.xml)
- Maven (or use the included Maven wrapper
mvnw/mvnw.cmd)
On Windows with bash (Git Bash / WSL), the commands below will work in a bash shell.
- Install dependencies
cd shopapp-angular
npm ci
# or: npm install- Development server (client-side)
cd shopapp-angular
npm run start
# Typically runs the dev server (check package.json scripts)- Server-Side Rendering (SSR) / Universal
This project contains server.ts and main.server.ts for SSR. To run SSR locally, build server bundle and run the server script.
Example (may vary depending on scripts in package.json):
cd shopapp-angular
npm run build:ssr # build browser + server bundles
npm run serve:ssr # start node server (server.ts)- Production build (static)
cd shopapp-angular
npm run build -- --configuration production
# outputs static files into the configured output path (check angular.json)Notes
- Check
angular.json,package.json, andserver.tsto confirm available npm scripts and exact build targets. - If you want to run the Angular app behind the backend or a proxy, configure the proxy settings or enable CORS on the backend.
- Database
This project includes database.sql (top-level of shopapp-backend/) for schema and example data. Configure the datasource in src/main/resources/application.yml or the dev/ folder configuration.
- Run locally using the Maven wrapper
cd shopapp-backend
./mvnw spring-boot:run
# On Windows (PowerShell / cmd) use mvnw.cmd; in bash ./mvnw works if executableOr build a jar and run it:
cd shopapp-backend
./mvnw clean package -DskipTests
java -jar target/*.jar- Configuration
- Check
src/main/resources/application.ymlfor DB connection, upload directory, logging, and other properties. - There is a
dev/config folder for development overlays.
- Uploads
Uploaded files are stored in the uploads/ folder at project root (used by the backend). Ensure the backend user has read/write permissions to that folder.
- Frontend environment files live under
shopapp-angular/src/environments/(e.g.,environment.ts,environment.prod.ts). Update API base URLs and feature flags there. - Backend configuration is in
shopapp-backend/src/main/resources/application.ymland may use profiles (dev,prod).
- Ensure DB is running and
application.ymlis configured to connect to it (or use an embedded DB if configured). - Start the backend:
cd shopapp-backend
./mvnw spring-boot:run- Start the frontend dev server (or SSR server) in another terminal:
cd shopapp-angular
npm run startAdjust ports and CORS as needed. If the frontend is built for production, you can serve the static build from the backend or a CDN.
- Backend tests: run
./mvnw testinshopapp-backend/. - Frontend tests: run
npm testinshopapp-angular/(verify script inpackage.json).
- Fork and create a branch for your feature or fix
- Run and add tests where appropriate
- Open a pull request with a clear description of changes
- If builds fail, check Node and Java versions match project expectations.
- Check
application.ymland Angular environment files for correct API URLs and credentials. - On Windows, if
./mvnwis not executable, usemvnw.cmdor run via installedmvn.
shopapp-angular/package.json— frontend npm scripts and dependenciesshopapp-backend/pom.xml— backend dependencies and buildshopapp-backend/database.sql— DB schema & sample data
This project doesn't include a license file by default. Add one if you plan to publish.
If you want specific adjustments to the README (more detail in any section, added screenshots, or CI/CD instructions), tell me which sections to expand and I will update it.