Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
2e9759a
Add initial project setup with Nuxt, including layout components, rou…
Jan 5, 2025
baba925
Implement login/logout functionality and update header for authentica…
Jan 6, 2025
fd4026e
Remove unused cookTimeIcon constant from RecipeCard component
Jan 6, 2025
1d36f81
Refactor RecipeCard component to destructure recipe prop from defineP…
Jan 6, 2025
834b583
Re-add GitHub Actions workflow for Super Linter to re-enforce code qu…
Jan 6, 2025
86b5728
Wrap login text in a div for improved structure in login.vue
Jan 6, 2025
cbeadcd
Improve indentation for better readability in Header.vue
Jan 6, 2025
00a6a3f
Update Super Linter configuration and enhance README structure
Jan 6, 2025
d9590a4
Implement authentication forms with toggle between login and registra…
Jan 6, 2025
89b84dd
Enhance authentication forms with v-model binding and submit handling…
Jan 6, 2025
29868ed
Implement login and registration enhancements with session cookie man…
Jan 6, 2025
bf99c17
Disable SSR
Jan 6, 2025
bfb8440
Add instructions for generating static hosting builds in README
Jan 6, 2025
2fa1a0e
Improve recipe fetching error handling and loading states in index.vue
Jan 6, 2025
213aeac
Enhance contact page with improved layout and GitHub link
Jan 6, 2025
05d4681
Refactor registration component to redirect to the login page after s…
Jan 6, 2025
b92c085
Refactor login component to use Composition API and improve error han…
Jan 6, 2025
7f1ccb7
Refactor styles to use CSS variables for colors, typography, and spacing
Jan 6, 2025
e3a9236
Update color variables and improve component styles for consistency
Jan 6, 2025
281395f
Add secondary color to footer styles for improved visibility
Jan 6, 2025
6f78a95
Remove unused styles
Jan 6, 2025
00eacce
Enhance registration form with password visibility SVG icons
Jan 6, 2025
6d38534
Enhance password input fields with visibility toggle functionality
Jan 6, 2025
e4b5313
Add SVG icons to header navigation for improved UI
Jan 6, 2025
0442b59
Update header styles to enhance text visibility and weight
Jan 6, 2025
afb85ea
Remove unused background properties
Jan 6, 2025
8683812
Enhance main layout with custom scrollbar styles for improved aesthetics
Jan 6, 2025
b9db9c7
Update main width to 100% for some reason
Jan 6, 2025
88feee4
Update main overflow property for improved scrolling behavior
Jan 6, 2025
46b3ffa
Refactor API endpoints to use runtime configuration for improved flex…
Jan 6, 2025
599f1f2
Add .dockerignore and update .gitignore to include lock file
Jan 6, 2025
9c00df9
Add .gitattributes to ignore diffs for package-lock.json
Jan 6, 2025
5bd916d
Refactor Dockerfile to implement multi-stage builds for simplified Nu…
Jan 6, 2025
7eafc92
Update .dockerignore to include Nuxt.js build outputs and additional …
Jan 6, 2025
c8c5fb3
Update README.md to clarify local development setup with Nuxt.js and …
Jan 7, 2025
f9f0665
Refactor recipe list rendering in index.vue for improved semantics an…
Jan 7, 2025
4f26b46
Refactor index.vue template structure for improved readability and la…
Jan 7, 2025
e157188
Implement search functionality for recipes and enhance loading spinne…
Jan 7, 2025
d681561
Remove unused watch function
Jan 7, 2025
b195fc3
Refactor main layout in index.vue for improved alignment and spacing
Jan 7, 2025
6189983
Remove unused text-wrap property from main style in index.vue
Jan 7, 2025
217e0f5
Implement search bar component and refactor search functionality in i…
Jan 7, 2025
e182cfc
Fix font size in SearchBar component
Jan 7, 2025
37ecde4
Remove unnecessary blank line in README.md
Jan 7, 2025
bbc4f98
Refactor LoadingSpinner styles for improved readability and consistency
Jan 7, 2025
d6e4324
Add recipe detail and index pages; update navigation and clean up imp…
Jan 7, 2025
e21fcb4
Update Dockerfile to use slimmer base images
Jan 7, 2025
dae851c
Add GitHub Actions workflow to scan Docker images for vulnerabilities
Jan 7, 2025
48a2178
Remove unnecessary triggers and permissions from workflow configurati…
Jan 7, 2025
960d9f9
Update Trivy action version in Docker image scanning workflow
Jan 7, 2025
c662ba0
Fix Trivy action version format in Docker image scanning workflow
Jan 7, 2025
54f021b
Refactor GitHub Actions workflows to enhance Docker image scanning an…
Jan 7, 2025
a722396
Update workflow triggers to only run on pushes to the main branch
Jan 7, 2025
450a547
Fix workflow trigger configuration to support multiple branches for D…
Jan 7, 2025
1cf2f14
Update Docker image scanning workflow to use Trivy in repo mode
Jan 8, 2025
6b56edf
Add permissions for GitHub Actions to enhance security event reporting
Jan 8, 2025
e93b618
Update Docker image scanning workflow to output results in table form…
Jan 8, 2025
8180aa9
Refactor Docker image scanning workflow to remove 'ignore-unfixed' op…
Jan 8, 2025
7341f83
Remove output specification from Docker image scanning workflow
Jan 8, 2025
18e27b7
Remove Trivy because it's useless, I expected a report table and got …
Jan 8, 2025
fc103ca
Refactor footer and header components for improved rendering and upda…
Jan 8, 2025
d2c17ef
Update page titles dynamically
Jan 8, 2025
6c4611f
Refactor authentication components to destructure apiBaseUrl from run…
Jan 8, 2025
e0a2028
Refactor recipe details display into a separate Recipe component
Jan 8, 2025
830015e
Refactor Recipe component layout for improved structure and styling
Jan 8, 2025
f99a708
Enhance responsive design for Recipe component and details page
Jan 8, 2025
6e6418a
Refactor Recipe component layout and styles for improved readability …
Jan 8, 2025
f2a7659
Enhance Recipe component to dynamically fetch and display recipe imag…
Jan 9, 2025
22ca9be
Add ButtonHome component for navigation; update Header and Recipe ind…
Jan 9, 2025
11abfae
Refactor layout and styles for improved responsiveness; update sectio…
Jan 9, 2025
bfb9032
Add Comment component and integrate comments fetching in Recipe compo…
Jan 10, 2025
a1707bc
Refactor recipe fetching logic in index page; update API endpoint and…
Jan 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
.env
.env.*
!.env.example
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore diffs for package-lock.json
package-lock.json diff=none
6 changes: 5 additions & 1 deletion .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ jobs:
env:
# To report GitHub Actions status checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: false
VALIDATE_ALL_CODEBASE: true
VALIDATE_CSS_PRETTIER: false
VALIDATE_HTML_PRETTIER: false
VALIDATE_JAVASCRIPT_STANDARD: false
VALIDATE_JAVASCRIPT_PRETTIER: false
VALIDATE_JSON_PRETTIER: false
VALIDATE_YAML_PRETTIER: false
VALIDATE_JSON: false
VALIDATE_TYPESCRIPT_PRETTIER: false
VALIDATE_TYPESCRIPT_STANDARD: false
VALIDATE_VUE_PRETTIER: false
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# Node dependencies
node_modules

# Logs
logs
*.log

# Misc
.DS_Store
.fleet
.idea

# Local env files
.env
.env.*
!.env.example
31 changes: 23 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
# Use the latest nginx as the base image
FROM nginx:1.27.3
# Stage 1: Build the Nuxt.js app
FROM node:18.20-slim AS build-stage

# Set the working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application code
COPY . .

# Build the application for static hosting
RUN npm run generate

# Stage 2: Serve the static files using Nginx
FROM nginx:1.24-alpine-slim

# Set environment variables
ENV TEMP_FRONTEND_DIR=/temp-frontend-files

# Set the shell for safer execution
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Create a non-root user and group
RUN groupadd -r frontenduser && useradd -r -g frontenduser frontenduser
RUN addgroup -S frontenduser && adduser -S -G frontenduser frontenduser

# Create a directory for the PID file and assign ownership to frontenduser
RUN mkdir -p /var/run/nginx && chown -R frontenduser:frontenduser /var/run/nginx

# Copy all files to the container
COPY . /usr/share/nginx/html
# Copy the generated static files from the build stage
COPY --from=build-stage /app/dist /usr/share/nginx/html

# Copy nginx.conf to a writable location and modify the PID path
RUN cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.custom && \
Expand Down
50 changes: 44 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,50 @@
# Nginx HTTP web server
# Nginx HTTP Web Server

This repository contains the frontend for smartcooking.
This repository contains the frontend for SmartCooking.

## Getting Started

To set up the frontend locally, you'll need Docker installed. Follow the steps below to build and run the database in a container.
### Nuxt Minimal Development Server

### Setup Steps
- To develop the frontend locally, you'll need Nuxt.js installed. Follow the steps below to develop the frontend with Nuxt.js.

1. Install the dependencies:

```bash
# npm
npm install

# pnpm
pnpm install

# yarn
yarn install

# bun
bun install
```

2. Start the development server on `http://localhost:3000`:

```bash
# npm
npm run dev

# pnpm
pnpm dev

# yarn
yarn dev

# bun
bun run dev
```

Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.

### Docker image and Container and hosting with Nginx

To set up the frontend locally, you'll need Docker installed. Follow the steps below to build and run the frontend in a container.

1. **Build the Docker Image**:

Expand All @@ -20,5 +58,5 @@ To set up the frontend locally, you'll need Docker installed. Follow the steps b
docker run -d --name Smart-Cooking_Frontend -p 8080:80 smartcooking-nginx
```

3. **Access the site**
Open your brower and access `http://localhost:8080/`
3. **Access the Site**:
Open your browser and access `http://localhost:8080/`.
31 changes: 31 additions & 0 deletions app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<template>
<div class="layout">
<Header />
<NuxtPage />
<Footer />
<LoadingSpinner class="hidden" />
</div>
</template>

<style scoped>
.layout {
align-items: center;
display: flex;
flex-direction: column;
gap: var(--spacing-large);
height: 100svh;
justify-content: center;
width: 100%;
}

.layout > :nth-child(2) {
flex: 1;
overflow-y: auto;
}

@media screen and (width<=850px) {
.layout {
gap: var(--spacing-small);
}
}
</style>
6 changes: 6 additions & 0 deletions assets/icons/eye-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/icons/eye.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/icons/home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/icons/mail-question.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/icons/user.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions assets/styles/variables.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
:root {
color-scheme: light dark;

/* Colors */
--color-primary: light-dark(#b8d8ba, #426347);
--color-secondary: light-dark(#d9dbbc, #636645);
--color-tertiary: light-dark(#fcddbc, #925527);
--color-quaternary: light-dark(#ef959d, #782939);
--color-quinary: light-dark(#69585f, #3d373a);
--color-error: red;
--color-success: green;

/* Typography */
--font-family: 'Roboto', sans-serif;
--font-size-heading: 2rem;
--font-size-title: 1.6rem;
--font-size-body: 1.1rem;

/* Spacing */
--spacing-small: 0.4rem;
--spacing-medium: 1.6rem;
--spacing-large: 3.2rem;

/* Curvature */
--border-radius-small: 0.4rem;
--border-radius-medium: 1.6rem;
--border-radius-large: 3.2rem;

/* Personalized elements */
--icon-size: 2rem;
--polaroid-color: light-dark(#e9e9e9, #161616);
--polaroid-height: 107mm;
--polaroid-photo-size: 79mm;
--polaroid-width: 88mm;
--polaroid-margin-top: calc((var(--polaroid-width) - var(--polaroid-photo-size)) / 2);
}

* {
font-family: var(--font-family);
font-size: var(--font-size-body);
margin: 0;
padding: 0;
scrollbar-color: var(--color-quinary) transparent;
scrollbar-width: thin;
transition-duration: .5s;
}

a {
color: var(--color-primary);
font-weight: bold;
text-decoration: none;
}

button {
background-color: var(--color-primary);
height: 3rem;
}

svg {
height: var(--icon-size);
stroke: var(--color-primary);
width: var(--icon-size);
cursor: pointer;
}

.hidden {
display: none !important;
}
58 changes: 0 additions & 58 deletions authentication.html

This file was deleted.

7 changes: 7 additions & 0 deletions components/ButtonHome.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<nuxt-link to="/" title="Home"><IconHome /></nuxt-link>
</template>

<script setup>
import IconHome from '@/assets/icons/home.svg';
</script>
Loading
Loading