Last Updated: October 2025
This is the frontend application for Silah, an AI-augmented full-stack B2B platform that connects suppliers and buyers. Built using React and Vite, it features fast hot-module reloading (HMR), code splitting, and automatic route detection.
Silah (Arabic: Ψ΅ΩΩΩΨ©) [noun] Connection, bond, link; often used to describe the ties between people, family, or communities.
The frontend handles:
- User Interfaces (Landing, Login, Signup, Buyer/Supplier dashboards)
- Routing (Dynamic route discovery and lazy-loading pages)
- Multi-language Support (i18n with Arabic and English)
- Forms & Validation (Signup, Login, Password Reset, Buyer/Supplier forms)
- File Uploads (Images & documents integration with backend)
- Payment Integration UI (Tap Payments frontend flows)
- Responsive Layouts (RTL/LTR support)
- Framework: React 18 + Vite
- Routing: react-router-dom v6
- State Management: React Context + Hooks
- Styling: CSS
- Translation: react-i18next
- Testing: Vitest + React Testing Library
- Bundling: Vite (HMR, optimized build)
- Version Control: Git + GitHub
Make sure you have:
- Node.js >= 20
- npm >= 10
- Git >= 2.40
git clone https://github.com/GP-Silah/silah-frontend.git
cd silah-frontendnpm installCopy example env file:
cp .env.example .envEdit .env for your configuration.
npm run devThis starts Vite dev server with HMR. The default URL: http://localhost:5173
src/
ββ components/ # Reusable UI components
ββ pages/ # Each page folder contains a page component
β ββ Landing/
β β ββ Landing.jsx
β ββ Signup/
β ββ Login/
β ββ BuyerHomePage/
ββ App.jsx # Auto-imports all pages dynamically
ββ main.jsx # ReactDOM entry point
ββ i18n.js # Language setupNote: Pages are auto-detected for routing. You can optionally export a
routePathin your page file to override the default path.
Each page can export a custom path:
// src/pages/BuyerHomePage/BuyerHomePage.jsx
import React from 'react';
export const routePath = '/buyer-home';
function BuyerHomePage() {
return <h1>Welcome to Buyer Dashboard</h1>;
}
export default BuyerHomePage;The App will automatically pick up this path without modifying App.jsx.
Each page can set its own browser title dynamically, based on the current language, using the useTranslation hook from i18next.
import React, { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
function Landing() {
const { t, i18n } = useTranslation();
useEffect(() => {
document.title = t('pageTitle');
}, [t, i18n.language]);
return <div>Landing Page</div>;
}
export default Landing;This ensures the page title updates automatically whenever the user changes the language.
- Arabic (RTL)
- English (LTR)
Language is handled globally via i18next. CSS classes lang-ar and lang-en adjust layout direction automatically.
<div className={i18n.language === 'ar' ? 'lang-ar' : 'lang-en'}>
<Header />
<Routes>{routeElements}</Routes>
<Footer />
</div>npm run dev # Start frontend dev server with HMR
npm run build # Build production-ready bundle
npm run lint # Run ESLint
npm run format # Prettier formatting
npm run test # Run unit & integration tests- ESLint + Prettier for consistent code style
- All new pages/components must pass linting before PR
Frontend communicates with Silah backend using REST API endpoints:
- Base URL from
.env(VITE_API_URL) - Authorization via JWT tokens stored in cookies at
localStorage - File uploads handled via Cloudflare R2 signed URLs
- Page not showing: Make sure folder and file names are correct and App.jsx routes are auto-detecting.
- HMR not working: Restart Vite server.
- CSS not applied: Ensure import paths are correct (
import '../../App.css';).
- Check console and network logs
- Verify environment variables are set correctly
- Contact frontend team or check GitHub Issues
This project is licensed under the terms specified in the LICENSE file.
Built with care by Silah's Frontend Team, as part of the Graduation Project.