This project is a full-stack application composed of:
- Backend: a Spring Boot REST API (Java) for managing recipes, ingredients, instructions.
- Frontend: a React + TypeScript client that consumes the backend API.
It demonstrates:
- RESTful services with Spring Boot
- JPA/Hibernate persistence
- Switching between MySQL and H2
- Client‑server architecture with HTTP + JSON
Layer | Tech / Tools |
---|---|
Backend | Java, Spring Boot, Spring Data JPA, Hibernate |
Database | MySQL (prod), H2 (dev/test) |
Frontend | React, TypeScript, Axios |
Build | Maven (backend), npm/yarn (frontend) |
- Java 17+
- Maven
- Node.js + npm or yarn
- MySQL (optional)
-
Clone the repo:
git clone https://github.com/MattysLeduc/Web-Services_Final-Project.git cd Web-Services_Final-Project/recipe-app-backend
-
Database choice:
- H2 (default/dev):
spring.datasource.url=jdbc:h2:mem:ems;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE spring.datasource.driverClassName=org.h2.Driver spring.datasource.username=sa spring.datasource.password= spring.jpa.database-platform=org.hibernate.dialect.H2Dialect spring.jpa.hibernate.ddl-auto=update spring.h2.console.enabled=true spring.h2.console.path=/h2-console
- MySQL:
spring.datasource.url=jdbc:mysql://localhost:3306/ems spring.datasource.username=root spring.datasource.password=yourpassword spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect spring.jpa.hibernate.ddl-auto=update
- H2 (default/dev):
-
Build & Run:
mvn clean install mvn spring-boot:run
-
H2 Console:
- Visit: http://localhost:8080/h2-console
- JDBC URL: jdbc:h2:mem:ems
- User: sa
- Pass: (blank)
-
Open new terminal:
cd library-app-frontend
-
Install deps:
npm install
-
Run:
npm start
- Column mismatches: Ensure consistent naming (
recipe_id
vsrecipeId
). - Script errors:
data.sql
must use correct column names. - Port conflicts: Adjust backend or frontend config.
- CORS: Allow requests from frontend (localhost:3000).
recipe-app-backend/
— Spring Boot backend- Entities: Recipe, Ingredients, Instructions
- Controllers, Repositories, Services
schema.sql
,data.sql
library-app-frontend/
— React frontend- Components for recipes
- Axios client
- Pages for listing recipes
This is a web app for managing recipes. It uses Spring Boot for the backend and React for the frontend, with MySQL or H2 as the database.