A full-stack e-commerce application (React frontend + Spring Boot backend) with Firebase helpers and Stripe integration.
This repository contains two main parts:
backend/— Spring Boot application (Maven) that provides REST APIs, authentication (JWT), Stripe integration and persistence (MySQL/JPA).frontend/— React application that uses Firebase for auth, hosting, and serverless functions; integrates with the backend for product/order operations.
- Backend: Java 17, Spring Boot 3.x, Maven. Builds to an executable JAR in
backend/target/. - Frontend: React (create-react-app), Firebase hosting & functions in
frontend/functions/. - Payment: Stripe Java SDK used in backend; frontend uses Stripe JS packages.
- Java 17 (OpenJDK or another JDK)
- Maven (for backend)
- Node.js (16+ recommended) and npm
- Firebase CLI (if you plan to deploy the frontend to Firebase Hosting)
- MySQL (or another DB configured in
application.properties) - (Optional) GitHub CLI
ghif you want to create the remote repo from the command line
Top-level important folders:
backend/— Spring Boot app,pom.xml,Procfile(Heroku style),system.properties(Java version for some PaaS)frontend/— React app,functions/(Firebase Cloud Functions),firebase.json
Also included are other example React projects in the workspace (React/, plzwork/) but the main app is frontend/.
- Build with Maven (from project root):
cd backend
mvn clean package -DskipTests- Run the jar produced in
backend/target/:
cd backend\target
:: Example jar name observed in the workspace; adjust if different
java -jar ecommerce-backend-0.0.1-SNAPSHOT.jarAlternative for development (run from backend folder):
mvn spring-boot:runNotes:
- The backend
pom.xmluses Java 17 and includes dependencies such as Spring Web, Spring Data JPA, Spring Security, Lombok, Stripe Java SDK and jjwt for JWT handling. - Database connection details (JDBC URL, username, password) should be provided in
src/main/resources/application.properties(or as environment variables when running in production). - A
Procfileexists for PaaS providers (e.g., Heroku):web: java -Dserver.port=$PORT $JAVA_OPTS -jar target/*.jar.
From the frontend/ folder:
cd frontend
npm install
npm startTo build for production:
npm run buildTo deploy to Firebase Hosting (if configured):
npm run build
firebase deploy --only hostingNotes specific to this frontend:
- The frontend is a React CRA app that relies on Firebase for authentication and several services (Firestore, Storage, Functions).
- The
frontend/functions/folder contains Firebase Cloud Functions; runnpm installinside that folder if you plan to emulate or deploy functions. - Useful scripts from
package.json:start— start CRA dev serverbuild— create production bundledeploy— build and thenfirebase deploy --only hosting
Environment files:
frontend/src/env.exampleexists as an example for environment variables. Copy it to.envor configure your Firebase and Stripe keys using environment variables or the hosting provider's secret manager.
Common values you will need to configure before running/deploying:
- Backend: DB URL, DB user, DB password, JWT secret, STRIPE_API_KEY, any mail/sendgrid keys
- Frontend: Firebase config (apiKey, authDomain, projectId, storageBucket, messagingSenderId, appId), Stripe publishable key
Set these via your environment or a secure configuration mechanism. Avoid committing secrets to the repo.
- Backend: Package with
mvn packageand deploy the generated JAR to your hosting environment. The providedProcfileandsystem.propertiessuggest previous use of Heroku-like or PaaS deployment. - Frontend: Can be hosted on Firebase Hosting (there are Firebase config and rules in the repo). Use
firebase deployafter configuring your Firebase project.
If you have gh (GitHub CLI) installed and authenticated, from the project root run:
:: initialize repo (if not already a git repo)
git init
git add .
git commit -m "Initial commit: add project"
:: create a new repo on GitHub and push main branch
gh repo create "E-Commerce Project" --public --source=. --remote=origin --pushIf you prefer to create the remote on github.com manually, then add the remote and push:
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/<your-username>/E-Commerce-Project.git
git push -u origin mainReplace <your-username> with your GitHub username. If authentication is required, follow the prompts or configure a personal access token.
README.md(this file) at project root — overview, setup, build and deploy instructions.gitignore— common ignores for Java/Maven and Node/React
- Add a CI workflow (GitHub Actions) to build both backend and frontend and run basic tests.
- Add a small
READMEinbackend/andfrontend/(frontend already contains a README) with env examples. - Add a Dockerfile for the backend and a Docker image + small nginx static container for the frontend.
- Add unit tests and integration tests for critical backend services.
Home page (rendered from the built React app):
