Merge pull request 'dev' (#20) from dev into main

Reviewed-on: #20
This commit is contained in:
Giovanni-Josserand 2025-08-31 16:29:50 +00:00
commit 3728385ebc
5 changed files with 107 additions and 80 deletions

View File

@ -1,39 +1,45 @@
import '../styles/Experiences.css'; import '../styles/Experiences.css';
import SingleExperience from './SingleExperience'; import SingleExperience from './SingleExperience';
import React, {useEffect, useState} from "react";
function Experiences() { function Experiences() {
const experiencesData = [ const [experiences, setExperiences] = useState([]);
{ const [experienceTasks, setExperienceTasks] = useState([]);
role: "Web Development Intern", const [error, setError] = useState(null);
company: "Pandora",
duration: "April 2024", useEffect(() => {
location: "Rennes (Ille-et-Vilaine), France", const fetchExperiencesAndTasks = async () => {
tasks: [ try {
"Development of a dynamic website with database integration (HTML, CSS, PHP, SQL)", let response = await fetch('/api/experiences');
"Created a reusable interface used as an internal learning resource", if (!response.ok) {
"Introduction to GitHub Actions" throw new Error(`Erreur HTTP: ${response.status}`);
] }
}, let data = await response.json();
{ setExperiences(data.data);
role: "IT Support Intern",
company: "INRAE", response = await fetch('/api/experienceTasks');
duration: "April 2023", if (!response.ok) {
location: "Rennes (Ille-et-Vilaine), France", throw new Error(`Erreur HTTP: ${response.status}`);
tasks: [ }
"Introduction to ProxMox Backup and UpdateEngine tools", data = await response.json();
"Preparation of two workstations", setExperienceTasks(data.data);
"Setup of a Wi-Fi hotspot using a Raspberry Pi", } catch (err) {
"Installation of a RAID 1 system" setError(err.message);
] }
} };
]; fetchExperiencesAndTasks();
}, []);
if (error) {
return <div>Erreur lors de la récupération des données : {error}</div>;
}
return ( return (
<section id="experiences-section"> <section id="experiences-section">
<h1 className="section-title">Experiences</h1> <h1 className="section-title">Experiences</h1>
<div className="experiences-container"> <div className="experiences-container">
{experiencesData.map((exp) => ( {experiences.map((exp) => (
<SingleExperience experience={exp}/> <SingleExperience experience={exp} tasks={experienceTasks.filter(task => task.experience_id === exp.id)}/>
))} ))}
</div> </div>
</section> </section>

View File

@ -1,29 +1,28 @@
import SingleProject from "./SingleProject.jsx"; import SingleProject from "./SingleProject.jsx";
import "../styles/Projects.css" import "../styles/Projects.css"
import React, {useEffect, useState} from "react";
function Projects() { function Projects() {
const codevProject = { const [projects, setProjects] = useState([]);
title: "Codev", const [error, setError] = useState(null);
image: "codev",
color: "orange", useEffect(() => {
nbImage: 5, const fetchProjects = async () => {
skills: ['HTML', 'CSS', 'PHP', 'JavaScript', 'SQL'], try {
description: "A collaborative platform where developers can create, share, and grow coding projects. Built for solo makers or teams, it features real-time messaging and a centralized workspace." const response = await fetch('/api/projects');
} if (!response.ok) {
const SAECProject = { throw new Error(`Erreur HTTP: ${response.status}`);
title: "SAE C++", }
image: "SAE_C++", const data = await response.json();
color: "purple", setProjects(data.data);
nbImage: 3, } catch (err) {
skills: ['C++', 'Git'], setError(err.message);
description: "A C++ program developed for creating and managing treasure hunt records, with a web interface that allows browsing and consulting the entries." }
} };
const proxmoxProject = { fetchProjects();
title: "Proxmox", }, []);
image: "proxmox",
color: "green", if (error) {
nbImage: 5, return <div>Erreur lors de la récupération des données : {error}</div>;
skills: [],
description: "A Proxmox-based infrastructure that consolidates my personal cloud, home automation, code hosting, media services and web hosting into a single, self-hosted environment."
} }
@ -31,9 +30,9 @@ function Projects() {
<section id="projects-section"> <section id="projects-section">
<h1 className="section-title">Projects</h1> <h1 className="section-title">Projects</h1>
<div className="projects-section-list"> <div className="projects-section-list">
<SingleProject image={codevProject.image} title={codevProject.title} description={codevProject.description} skills={codevProject.skills} color={codevProject.color} nbImage={codevProject.nbImage}/> {projects.map(project => (
<SingleProject image={SAECProject.image} title={SAECProject.title} description={SAECProject.description} skills={SAECProject.skills} color={SAECProject.color} nbImage={SAECProject.nbImage}/> <SingleProject image={project.image_name} title={project.title} description={project.description} skills={project.skills} color={project.color} nbImage={project.nb_image}/>
<SingleProject image={proxmoxProject.image} title={proxmoxProject.title} description={proxmoxProject.description} skills={proxmoxProject.skills} color={proxmoxProject.color} nbImage={proxmoxProject.nbImage}/> ))}
</div> </div>
<div className="show-more-container"> <div className="show-more-container">
<p className="show-more-link"> <p className="show-more-link">

View File

@ -1,6 +1,6 @@
import '../styles/SingleExperience.css'; import '../styles/SingleExperience.css';
function SingleExperience({ experience }) { function SingleExperience({ experience, tasks }) {
return ( return (
<div className="experience-card"> <div className="experience-card">
<div className="experience-card-left"> <div className="experience-card-left">
@ -11,8 +11,8 @@ function SingleExperience({ experience }) {
<div className="experience-card-right"> <div className="experience-card-right">
<h3 className="experience-role">{experience.role}</h3> <h3 className="experience-role">{experience.role}</h3>
<ul className="experience-tasks"> <ul className="experience-tasks">
{experience.tasks.map((task, index) => ( {tasks.map((task) => (
<li key={index}>{task}</li> <li>{task.description}</li>
))} ))}
</ul> </ul>
</div> </div>

View File

@ -1,35 +1,49 @@
import React, { useState, useEffect } from 'react';
import SkillCard from "./SkillCard.jsx"; import SkillCard from "./SkillCard.jsx";
import "../styles/Skills.css"; import "../styles/Skills.css";
function Skills() { function Skills() {
const [skills, setSkills] = useState([]);
const [error, setError] = useState(null);
useEffect(() => {
const fetchSkills = async () => {
try {
const response = await fetch('/api/skills');
if (!response.ok) {
throw new Error(`Erreur HTTP: ${response.status}`);
}
const data = await response.json();
setSkills(data.data);
} catch (err) {
setError(err.message);
}
};
fetchSkills();
}, []);
if (error) {
return <div>Erreur lors de la récupération des données : {error}</div>;
}
const uniqueSkillTypes = [...new Set(skills.map(skill => skill.type))];
return ( return (
<section id="skills-section"> <section id="skills-section">
<h1 className="section-title">Skills</h1> <h1 className="section-title">Skills</h1>
<div id="languages" className="skill-category"> {uniqueSkillTypes.map(type => (
<h2>Languages</h2> <div id="languages" className="skill-category">
<div className="skills"> <h2>{type}</h2>
<SkillCard text="Python"/> <div className="skills">
<SkillCard text="Java"/> {skills
<SkillCard text="C++"/> .filter(skill => skill.type === type)
<SkillCard text="HTML"/> .map(skill => (
<SkillCard text="CSS"/> <SkillCard text={skill.name}/>
<SkillCard text="JavaScript"/> ))}
<SkillCard text="PHP"/> </div>
<SkillCard text="SQL"/>
</div> </div>
</div> ))}
<div id="librairies" className="skill-category">
<h2>Librairies</h2>
<div className="skills">
<SkillCard text="React"/>
</div>
</div>
<div id="tools" className="skill-category">
<h2>Tools</h2>
<div className="skills">
<SkillCard text="Git"/>
</div>
</div>
</section> </section>
) )
} }

View File

@ -4,4 +4,12 @@ import react from '@vitejs/plugin-react'
// https://vite.dev/config/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [react()], plugins: [react()],
server: {
proxy: {
'/api': {
target: 'http://localhost:8000',
changeOrigin: true,
},
}
}
}) })