RateMate Front-End is a front-end application built using React.js, Vite, Tailwind CSS, Prettier, ESLint, Husky, Redux Toolkit, and React Router. It is the user interface for interacting with the RateMate API, providing a seamless experience for currency conversions. The app is deployed on Vercel and can be accessed live.
Live Version: RateMate Front-End
RateMate-front-end/
├── dist/ # Distribution folder
├── node_modules/ # Dependencies
├── public/
│ └── index.html # Main HTML file
├── src/ # Source code
│ ├── assets/
│ │ └── react.svg # Sample React logo
│ ├── components/ # Reusable components
│ │ ├── Navbar.jsx # Navigation component
│ │ ├── SignIn.jsx # Sign In form
│ │ ├── SignUp.jsx # Sign Up form
│ │ └── ProtectedRoute.jsx # Protected route component
│ ├── pages/ # Page components for routes
│ │ ├── HomePage.jsx
│ │ ├── SignInPage.jsx
│ │ ├── RegisterPage.jsx
│ │ └── CheckCurrencyHistory.jsx
│ ├── services/ # API call services
│ │ └── authService.js # Handles sign-in and sign-up authentication services
│ ├── store/ # Redux store configuration
│ │ ├── authSlice.js # Handles auth state management
│ │ └── store.js # Redux store configuration
│ ├── App.css # Application-specific styles
│ ├── App.jsx # Root React component with routing
│ ├── index.css # Global CSS styles
│ └── main.jsx # Main entry point for the React app
├── .gitignore # Files and folders to ignore in git
├── .prettierignore # Files to ignore for Prettier
├── .prettierrc # Prettier configuration
├── eslint.config.js # ESLint configuration
├── index.html # Main HTML file
├── package.json # Dependencies and scripts
├── postcss.config.js # PostCSS configuration
├── README.md # Project documentation
├── tailwind.config.js # Tailwind CSS configuration
└── vite.config.js # Vite configuration
Before running the project, you need to create a .env
file in the root of the project and add the following environment variables:
VITE_FIXER_API_KEY=your_fixer_api_key
VITE_FIXER_API_BASE_URL=https://data.fixer.io/api
VITE_API_BASE_URL=http://localhost:3000/api/v1
your_fixer_api_key
with the API key you receive from Fixer.io.The app uses React Router to handle client-side routing. The available routes include:
/
/signin
/register
/history
Protected routes (accessible only after login):
/
/history
The src/services
folder handles API interactions, specifically authentication for the RateMate API. It includes two main services:
Both services interact with the backend authentication API and handle errors such as invalid credentials or existing user conflicts.
Make sure you have the following installed:
Clone the repository:
git clone https://github.com/heshamelmasry77/RateMate-front-end.git
cd RateMate-front-end
Install dependencies:
npm install
Create a .env
file:
Add your environment variables in the .env
file as mentioned above, including your Fixer.io API key.
Run the development server:
npm run dev
The application will be available at http://localhost:3000
.
To create a production build, run:
npm run build
To format your code using Prettier, run:
npm run format
This will automatically format your code according to the configured rules.
Husky is used to manage Git hooks, ensuring that linting and formatting rules are followed before committing changes.
Redux Toolkit is used for managing the application's state in a scalable way. The store is located in the src/store
directory and includes an authSlice
for handling user authentication.
React Router is used for client-side routing. The application includes the following routes:
/
/signin
/register
/history
Protected routes:
/
/history
The project is deployed on Vercel.
Live Version: RateMate Front-End
This project is open-sourced and available under the MIT license.