Banking Management System made for Experian's Workshop (Sept 2024)
BankingSystem is a React-based web application built with TypeScript. It provides a user interface for a banking system, allowing users to view their account information, make transactions, and manage their finances. The app features Auth functionalities.
npm start
npm i react-redux- The project utilizes the following libraries and technologies:
-
React: A JavaScript library for building user interfaces
-
TypeScript: A typed superset of JavaScript
-
React-Router-dom: Router library used to handle navigation
-
Redux: A state management library for React applications
-
React Router: For handling routing in the application
-
Axios: A promise-based HTTP client for making API requests
-
Styled-components: A CSS-in-JS library for component-based styling
-
Material-UI: A popular React UI framework
-
React Hook Form: A library for flexible and efficient form handling
-
Yup: A JavaScript schema validation library
The project follows a modular structure with components, pages, and utility functions organized into separate directories. Here's an overview of the main directories:
├── components/
├── pages/
├── redux/
├── routes/
├── styles/
├── types/
├── routes/
└──hooks/
- Validation using zod with TypeScript
- Authentication hook
"./hooks/useZodForm"Format example:
password: z.string({ required_error:"Field is required" }).regex(/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*\W)(?!.* ).{8,16}$/"./hooks/useAuth"A response is invoked containing information regarding the user : access token(lasting 1hr) and whether or not the user is administrator Used in every protected page to ensure that no data is leaked
const { user, login, logout } = useAuth();Used to handle state management asynchronously in the MVC
The project uses the barrel export pattern to simplify imports and exports. This pattern involves creating an index.ts file in each directory to re-export the contents of other files in that directory.
Example of a barrel export (src/components/index.ts):
export * from "./Button"
export * from "./Icon"
export * from "./Typography"This allows for cleaner imports in other files: *
import { Button, Icon, Typography } from '../components';Example of an API service:
The project uses Redux for state management. The store is configured with reducers and middleware(featuring redux-thunk and redux-logger).
export const ACTION_TYPES={
CREATE: "CREATE",
UPDATE: "UPDATE",
DELETE: "DELETE",
FETCH_ID:"FETCH_ID",
FETCH_ALL_LOANS: "FETCH_ALL_LOANS",
}Used to handle actions and forwards the response to the reducer
Used to handle dispatch logic and forward it to the payload
The project uses styled-components for styling, along with a theme for consistent design across the application.
Example of the theme configuration:
Usage of the theme in a styled component:
export const Heading4 = styled(({ variant , ...props }: H4Props) => (
<h4 {...props} />
))`
${({ variant }) => variant && theme.typography.h4[variant]}
`;- Implemented using react-router-dom
- Handled with injected api endpoints to the frontEnd for better security









