Skip to content

Commit

Permalink
Merge pull request #225 from COS301-SE-2023/dev
Browse files Browse the repository at this point in the history
Demo 3 Dev
  • Loading branch information
ryanbasiltrickett authored Jul 31, 2023
2 parents b4525a0 + 946ea3f commit b2954ea
Show file tree
Hide file tree
Showing 610 changed files with 25,599 additions and 7,383 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/cd-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,20 @@ jobs:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
aws-region: af-south-1

- name: Setup NodeJS and Cache
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'

- name: Setup Enviroment File
run: |
printf "${{ secrets.ENV_FILE }}" > .env
shell: bash

- name: Install Dependencies
run: npm install
Expand Down Expand Up @@ -73,7 +78,12 @@ jobs:
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
distribution: 'temurin'

- name: Setup Enviroment File
run: |
printf "${{ secrets.ENV_FILE }}" > .env
shell: bash

- name: Setup NX
run: npm install nx@latest
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/cd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,20 @@ jobs:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
aws-region: af-south-1

- name: Setup NodeJS and Cache
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'

- name: Setup Enviroment File
run: |
printf "${{ secrets.ENV_FILE }}" > .env
shell: bash

- name: Install Dependencies
run: npm install
Expand Down Expand Up @@ -76,15 +81,14 @@ jobs:
java-version: '17'
distribution: 'temurin'

- name: Setup NX
run: npm install nx@latest

- name: Setup Enviroment Files
- name: Setup Enviroment File
run: |
printf "${{ secrets.API_APPLICATION_PROPERTIES }}" > apps/api/src/main/resources/application.properties
cat apps/api/src/main/resources/application.properties
printf "${{ secrets.ENV_FILE }}" > .env
shell: bash

- name: Setup NX
run: npm install nx@latest

- name: Build API
run: npm run build:api

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches: [ feat/*, hotfix/* ]
pull_request:
branches: [ dev, feat/*, hotfix/* ]
merge_group:
types: [ checks_requested ]
workflow_call:

permissions:
Expand Down Expand Up @@ -56,7 +58,7 @@ jobs:
files: coverage/lcov.info

- name: e2e Test App
run: npm run e2e:app:ci
run: npm run e2e:app:test

- name: Build App
run: npm run build:app:dev
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

name: Lint, Test & Build Wokspace
runs-on: windows-latest
environment: Production
environment: Development

steps:
- name: Checkout Repo
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
files: coverage/lcov.info

- name: e2e Test App
run: npm run e2e:app:prod
run: npm run e2e:app:test

- name: Build App
run: npm run build:app:prod
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# npm run start:app:dev

# npm run start:app:dev

# compiled output
dist
tmp
Expand Down Expand Up @@ -47,3 +49,4 @@ Thumbs.db
#Enviroment Files
.env
.prod.env
# *application.properties
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<br>

FridgeToPlate is a user-friendly app that utilizes preference AI and relational database models to gather recipes based on the ingredients found in the user's fridge. By providing access to delicious and wholesome meal ideas, this product aims to elevate the user's cooking experience.
FridgeToPlate is a user-friendly app that utilizes preferences AI and relational database models to gather recipes based on the ingredients found in the user's fridge. By providing access to delicious and wholesome meal ideas, this product aims to elevate the user's cooking experience.

COS301 Capstone Project for [Amazon Web Services](https://aws.amazon.com/).

Expand All @@ -36,7 +36,7 @@ Final year Computer Science student at the University of Pretoria. I'm an enthus
[![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/ryan-trickett/)

### Paul Pilane
I am a Final-Year Computer Science student at the University of Pretoria. I am a young, exquisitive individual who yearns and seeks knowledge through consistent, tireless efforts to equip myself for the changing enviroments and have a strong passion for technology and innovation, and aim to solve a class of problems through the lenses of technological innovation.
I am a Final-Year Computer Science student at the University of Pretoria. I am a young, exquisitive individual who yearns and seeks knowledge through consistent, tireless efforts to equip myself for the changing environments and have a strong passion for technology and innovation, and aim to solve a class of problems through the lenses of technological innovation.

[![GitHub](https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/PaulPilane)
[![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/paul-pilane/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@ComponentScan("com.fridgetoplate")
Expand All @@ -12,4 +15,9 @@ public static void main(String[] args) {
SpringApplication.run(ApiApplication.class, args);
}

@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
return builder.build();
}

}

This file was deleted.

43 changes: 0 additions & 43 deletions apps/api/src/main/java/com/fridgetoplate/api/RecipeController.java

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* This is a Java class that defines the REST API endpoints for managing ingredients in a recipe
* application.
*/
package com.fridgetoplate.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.fridgetoplate.frontendmodels.RecipeFrontendModel;
import com.fridgetoplate.interfaces.Explore;
import com.fridgetoplate.interfaces.Recipe;
import com.fridgetoplate.model.Ingredient;
import com.fridgetoplate.model.MealPlanModel;
import com.fridgetoplate.model.ProfileModel;
import com.fridgetoplate.repository.ExploreRepository;
// import com.fridgetoplate.repository.IngredientRepository;
import com.fridgetoplate.repository.MealPlanRepository;

@RestController
@CrossOrigin(origins = "*", allowedHeaders = "*", methods = { RequestMethod.GET, RequestMethod.POST, RequestMethod.PUT, RequestMethod.DELETE })
@RequestMapping("/explore")

public class ExploreController {

@Autowired
private ExploreRepository exploreRepository;


@GetMapping
public List<RecipeFrontendModel> findAll() {
return exploreRepository.findAll();
}

@PostMapping("/search")
public List<RecipeFrontendModel> findBySearch(@RequestBody Explore search) {
return exploreRepository.findBySearch(search);
}

}
Loading

0 comments on commit b2954ea

Please sign in to comment.