Implement Projects gallery and case studies

This commit is contained in:
rob
2026-11-11 16:20:30 +00:00
parent 26605771ff
commit bc980e43cc
84 changed files with 686 additions and 48 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ afterEach(() => { window.history.replaceState({}, "", "/"); vi.unstubAllGlobals(
describe("public marketing routes", () => {
it.each([
["/services", "Services"], ["/projects", "Projects"],
["/projects/example", "Project details"], ["/about", "About BortStack"],
["/projects/example", "Project not found"], ["/about", "About BortStack"],
["/contact", "Have a project in mind?"], ["/privacy", "Privacy policy"],
["/login", "Page not found"], ["/register", "Page not found"], ["/dashboard", "Page not found"],
])("loads %s without account infrastructure", async (path, heading) => {
+85
View File
@@ -0,0 +1,85 @@
import { Container, Row, Col } from "react-bootstrap";
import { Link, useParams } from "react-router-dom";
import { FiArrowLeft, FiArrowRight, FiImage, FiMessageCircle, FiExternalLink } from "react-icons/fi";
import PropTypes from "prop-types";
import PageMeta from "../../components/PageMeta/PageMeta";
import { projects } from "./projects";
import styles from "./Projects.module.scss";
function ProjectMedia({ name }) {
return <div className={styles.media} role="img" aria-label={`${name}: genuine project screenshot pending`}>
<FiImage aria-hidden="true" /><span>{name}</span><small>Genuine project screenshot pending</small>
</div>;
}
ProjectMedia.propTypes = { name: PropTypes.string.isRequired };
function Technologies({ items }) {
return <ul className={styles.technologies} aria-label="Technologies">{items.map(item => <li key={item}>{item}</li>)}</ul>;
}
Technologies.propTypes = { items: PropTypes.arrayOf(PropTypes.string).isRequired };
function ContactInvitation() {
return <section className={styles.contact} aria-labelledby="projects-contact-heading">
<h2 id="projects-contact-heading">Have a project in mind?</h2>
<p>Let’s discuss your ideas and turn them into a practical solution.</p>
<Link to="/contact" className="btn btn-primary"><FiMessageCircle aria-hidden="true" /> Discuss a Project</Link>
</section>;
}
export default function Projects() {
const [featured, ...others] = projects;
return <div className={styles.page}><Container>
<section className={styles.hero} aria-labelledby="projects-heading">
<div><p className={styles.eyebrow}>Projects <span aria-hidden="true" /></p><h1 id="projects-heading">Projects</h1>
<p className={styles.intro}>A selection of software projects, from focused applications to more substantial systems in development.</p></div>
<div className={styles.layers} aria-hidden="true"><i /><i /><i /></div>
</section>
<section aria-labelledby="featured-heading">
<h2 className={styles.sectionTitle} id="featured-heading">Featured project <span aria-hidden="true" /></h2>
<Row className={`align-items-center ${styles.featured}`}>
<Col md={7}><ProjectMedia name={featured.name} /></Col>
<Col md={5}><p className={styles.category}>{featured.category}</p><h3>{featured.name}</h3><p>{featured.summary}</p>
<div className={styles.actions}><Link className={styles.caseLink} to={`/projects/${featured.slug}`}>View case study <FiArrowRight aria-hidden="true" /></Link>
<a className={styles.caseLink} href={featured.website}>Visit RouletteBuddy <FiExternalLink aria-hidden="true" /></a></div>
<Technologies items={featured.technologies} /></Col>
</Row>
</section>
<section className={styles.otherProjects} aria-labelledby="other-heading">
<h2 className={styles.sectionTitle} id="other-heading">Other projects <span aria-hidden="true" /></h2>
<Row className="gy-5">{others.map(project => <Col md={6} key={project.slug}>
<article aria-labelledby={`${project.slug}-heading`}>
<ProjectMedia name={project.name} /><p className={styles.status}>{project.status}</p>
<h3 id={`${project.slug}-heading`}>{project.name}</h3><p>{project.summary}</p>
<Technologies items={project.technologies} />
<Link className={styles.caseLink} to={`/projects/${project.slug}`}>Explore {project.name} <FiArrowRight aria-hidden="true" /></Link>
</article>
</Col>)}</Row>
</section>
<ContactInvitation />
</Container></div>;
}
export function ProjectCaseStudy() {
const { slug } = useParams();
const project = projects.find(item => item.slug === slug);
if (!project) return <Container className={styles.unavailable}>
<PageMeta title="Project not found" noIndex /><h1>Project not found</h1><p>This case study is not available.</p><Link to="/projects">Back to Projects</Link>
</Container>;
return <div className={styles.page}><PageMeta title={project.name} description={project.summary} /><Container>
<header className={styles.caseHeader}>
<Link className={styles.caseLink} to="/projects"><FiArrowLeft aria-hidden="true" /> All projects</Link>
<p className={styles.status}>{project.status}</p><h1>{project.name}</h1><p className={styles.intro}>{project.summary}</p>
<Technologies items={project.technologies} />
{project.website && <a className={styles.caseLink} href={project.website}>Visit {project.name} <FiExternalLink aria-hidden="true" /></a>}
</header>
<ProjectMedia name={project.name} />
<div className={styles.caseBody}>
<section><h2>The problem</h2><p>{project.problem}</p></section>
<section><h2>The solution</h2><p>{project.solution}</p></section>
<section><h2>Main features</h2><ul>{project.features.map(feature => <li key={feature}>{feature}</li>)}</ul></section>
<section><h2>Engineering</h2><p>{project.engineering}</p></section>
<section><h2>Work to date</h2><p>{project.outcome}</p></section>
</div>
<ContactInvitation />
</Container></div>;
}
@@ -0,0 +1,38 @@
.page {
background: radial-gradient(ellipse at 85% 10%, var(--site-glow), transparent 30%);
:global(.container) { width: calc(100% - 104px); max-width: 1280px; padding-inline: 0; }
h1 { font-size: clamp(42px, 6vw, 64px); margin-bottom: 18px; }
h3 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 18px; }
p { color: var(--site-text); }
}
.hero { display: grid; grid-template-columns: 2fr 1fr; align-items: center; min-height: 250px; padding-block: 44px; gap: 32px; }
.eyebrow, .sectionTitle { display: flex; align-items: center; gap: 22px; color: var(--site-link) !important; text-transform: uppercase; font-size: 16px; letter-spacing: .13em; font-weight: 600; span { height: 1px; flex: 1; background: linear-gradient(90deg, var(--bs-steel-blue), transparent); } }
.eyebrow { max-width: 330px; }
.intro { font-size: 20px; line-height: 1.6; max-width: 760px; }
.layers { position: relative; height: 190px; i { position: absolute; width: 155px; height: 155px; border: 1px solid var(--site-link); border-radius: 7px; transform: rotateX(58deg) rotateZ(45deg); left: calc(50% - 78px); top: -10px; background: var(--site-glow); &:nth-child(2) { top: 32px; } &:nth-child(3) { top: 74px; } } }
.sectionTitle { margin: 0 0 30px; }
.featured { --bs-gutter-x: 42px; p { font-size: 18px; line-height: 1.7; } }
.media { aspect-ratio: 1.65; width: 100%; padding: 24px; border: 1px dashed var(--site-line); border-radius: 15px; background: radial-gradient(ellipse at center, var(--site-glow), transparent 75%), var(--site-surface); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; text-align: center; color: var(--site-muted); svg { color: var(--site-link); width: 34px; height: 34px; } span { font-size: 22px; font-weight: 600; } small { font-size: 13px; } }
.category, .status { font-size: 13px !important; color: var(--site-link) !important; margin-bottom: 12px; }
.status { margin-top: 22px; font-weight: 600; }
.caseLink { display: inline-flex; align-items: center; gap: 13px; min-height: 44px; font-weight: 600; text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; column-gap: 24px; }
.technologies { display: flex; flex-wrap: wrap; gap: 9px; padding: 0; list-style: none; margin: 20px 0; li { border: 1px solid var(--site-line); border-radius: 30px; padding: 3px 14px; color: var(--site-muted); font-size: 13px; } }
.otherProjects { margin-top: 64px; margin-bottom: 54px; :global(.row) { --bs-gutter-x: 42px; } h3 { font-size: 28px; } article > p:not(.status) { font-size: 16px; line-height: 1.8; } }
.contact { margin: 40px -18px 30px; padding: 32px 24px; text-align: center; border: 1px solid var(--site-line); border-radius: 15px; background: radial-gradient(ellipse at top right, var(--site-glow), transparent 70%), var(--site-surface); h2 { font-size: clamp(27px, 4vw, 38px); } p { margin: 18px 0 26px; } a { min-height: 52px; display: inline-flex; gap: 12px; align-items: center; justify-content: center; padding-inline: 24px; } }
.caseHeader { padding-block: 35px; h1 { overflow-wrap: anywhere; } }
.caseBody { max-width: 800px; margin: 45px auto; section { margin-block: 34px; } h2 { font-size: 28px; margin-bottom: 16px; } li { margin-block: 10px; } }
.unavailable { padding-block: 80px; }
@media (max-width: 991.98px) { .page :global(.container) { width: calc(100% - 64px); } .hero { gap: 20px; } .intro { font-size: 17px; } .featured { --bs-gutter-x: 28px; p { font-size: 16px; } } }
@media (max-width: 767.98px) {
.page :global(.container) { width: calc(100% - 40px); }
.hero { grid-template-columns: 1fr; padding-block: 32px; gap: 0; }
.layers { height: 150px; margin-top: 10px; i { width: 120px; height: 120px; left: calc(50% - 60px); } }
.intro { font-size: 16px; }
.eyebrow, .sectionTitle { font-size: 13px; gap: 15px; }
.featured { --bs-gutter-x: 24px; --bs-gutter-y: 26px; }
.otherProjects { margin-block: 36px; :global(.row) { --bs-gutter-x: 24px; } }
.contact { margin-inline: 0; padding-inline: 16px; a { font-size: 14px; } }
.media { padding: 18px; small { font-size: 12px; } }
.caseBody h2 { font-size: 24px; }
}
@@ -0,0 +1,39 @@
import { render, screen, within } from "@testing-library/react";
import { afterEach, describe, expect, it, vi } from "vitest";
import App from "../../App";
afterEach(() => { window.history.replaceState({}, "", "/"); vi.unstubAllGlobals(); });
function open(path) { window.history.replaceState({}, "", path); return render(<App />); }
describe("Projects", () => {
it("presents the approved hierarchy, honest status and genuine-media gaps without account requests", () => {
const fetch = vi.fn(); vi.stubGlobal("fetch", fetch);
open("/projects");
expect(screen.getByRole("heading", { level: 1, name: "Projects" })).toBeInTheDocument();
expect(screen.getByText("In development")).toBeInTheDocument();
expect(screen.getByText("Small showcase project")).toBeInTheDocument();
expect(screen.getAllByText("Genuine project screenshot pending")).toHaveLength(3);
expect(screen.getByRole("link", { name: "View case study" })).toHaveAttribute("href", "/projects/roulettebuddy");
expect(screen.getByRole("link", { name: "Explore PitchInvader" })).toHaveAttribute("href", "/projects/pitchinvader");
expect(screen.getByRole("link", { name: "Visit RouletteBuddy" })).toHaveAttribute("href", "https://roulettebuddy.app/");
expect(fetch).not.toHaveBeenCalled();
});
it.each([["roulettebuddy", "RouletteBuddy"], ["pitchinvader", "PitchInvader"], ["api-admin", "API Admin"]])("loads %s directly with factual sections and navigation", (slug, name) => {
open(`/projects/${slug}`);
expect(screen.getByRole("heading", { level: 1, name })).toBeInTheDocument();
for (const section of ["The problem", "The solution", "Main features", "Engineering", "Work to date"]) expect(screen.getByRole("heading", { name: section })).toBeInTheDocument();
expect(screen.getByRole("link", { name: "All projects" })).toHaveAttribute("href", "/projects");
expect(screen.getByRole("link", { name: "Discuss a Project" })).toHaveAttribute("href", "/contact");
expect(document.title).toContain(name);
expect(document.querySelector('meta[name="robots"]')).toHaveAttribute("content", "index, follow");
if (slug === "roulettebuddy") expect(screen.getByRole("link", { name: "Visit RouletteBuddy" })).toHaveAttribute("href", "https://roulettebuddy.app/");
else expect(screen.queryByRole("link", { name: /^Visit / })).not.toBeInTheDocument();
if (slug === "api-admin") expect(within(screen.getByRole("list", { name: "Technologies" })).getByText("SQLite")).toBeInTheDocument();
});
it("keeps unavailable slugs noindex with a recovery link", () => {
open("/projects/not-approved");
expect(screen.getByRole("heading", { name: "Project not found" })).toBeInTheDocument();
expect(document.querySelector('meta[name="robots"]')).toHaveAttribute("content", "noindex, nofollow");
expect(screen.getByRole("link", { name: "Back to Projects" })).toHaveAttribute("href", "/projects");
});
});
+33
View File
@@ -0,0 +1,33 @@
// Public summaries verified against the local project repositories; see docs/BS-006-DESIGN.md.
export const projects = [
{
slug: "roulettebuddy", website: "https://roulettebuddy.app/", name: "RouletteBuddy", category: "Strategy analysis", status: "Featured project",
summary: "A roulette-strategy analysis application for building rules, testing individual strategies and comparing simulation results.",
technologies: ["React", "Flask", "MySQL", "Docker"],
problem: "Comparing betting strategies requires more than a single result. Rules, stakes and simulated outcomes need to be inspectable together.",
solution: "RouletteBuddy combines a strategy-building workflow with individual tests and multi-strategy simulations, making the configured rules and their results available in one application.",
features: ["Create, edit and clone strategies with starting bets and conditional rules.", "Inspect spin-by-spin results from an individual strategy test.", "Compare aggregated outcomes across selected strategies."],
engineering: "A React interface connects to Flask strategy and simulation endpoints. Saved strategies and account data use SQLAlchemy and MySQL; Docker Compose defines the application services.",
outcome: "The repository implements strategy creation, testing and comparative simulation. Simulated results describe those runs; they do not predict future outcomes or guarantee a profit.",
},
{
slug: "pitchinvader", name: "PitchInvader", category: "Football team software", status: "In development",
summary: "A substantial football application bringing team management, match entry, formations and player-performance analysis together. Development is ongoing.",
technologies: ["React", "Flask", "SQLAlchemy"],
problem: "Football match records connect players, lineups, substitutions and events. Turning those records into useful performance information requires consistent data and a workflow coaches can follow.",
solution: "PitchInvader provides team and player management alongside staged match entry and reusable formation templates. Its development includes player-rating and statistics workflows, with presentation and further work still in progress.",
features: ["Manage teams and players within an authenticated application.", "Create reusable position-based formation templates and assign match lineups.", "Record match results, events and substitutions through dedicated match workflows."],
engineering: "The React client and Flask API handle connected team, match and player records. Formation validation, match-state transitions and versioned scoring rules are significant parts of the engineering work.",
outcome: "Substantial application workflows are implemented, while the product remains in development. This case study describes the work to date, not a finished release or measured customer outcome.",
},
{
slug: "api-admin", name: "API Admin", category: "Authentication showcase", status: "Small showcase project",
summary: "A focused application demonstrating account login, device records and time-limited API keys. A deliberately small example of frontend and backend integration.",
technologies: ["React", "Flask", "SQLite"],
problem: "An API-key workflow needs a way to associate keys with a user’s devices and check them when a protected endpoint is called.",
solution: "API Admin demonstrates that flow with account login, user-owned device records and a key-protected test endpoint. It remains a separate application from this website.",
features: ["Register and log in to an account.", "View and create user-owned device records with generated, expiring keys.", "Call a protected test endpoint using a device API key."],
engineering: "A React/Vite client connects to Flask endpoints. SQLAlchemy stores users and devices in SQLite. The scope is a simple demonstration rather than a full API-management platform.",
outcome: "The repository contains the login and device-key demonstration. No production-readiness, uptime or security certification is claimed.",
},
];