To run the project locally, follow these steps:
- Ensure you have Node.js and npm installed on your machine.
- Clone the repository from GitHub.
- Navigate to the project directory in your terminal or command prompt.
- Install project dependencies by running the following command:
npm install
- Once the installation is complete, start the development server with:
npm start
- The application will be accessible at
http://localhost:3000
in your web browser.
The codebase follows a structured approach, where reusable components and utility functions are organized to improve maintainability. The key components and files are as follows:
All the reusable components such as buttons, tables, and modals are placed inside the src/components
folder.
All calculation-related functions are stored in the utils
file within the src
folder. This helps keep the core logic separate from the UI components.
This file contains the main logic of the application, tying together different components and handling user interactions.
For this project, simple React state management has been utilized. Given the project's small size and scope, opting for Redux would have been overkill. React state management provides sufficient functionality to handle the state locally within the components.
The project employs the bignumber.js
library for calculations involving monetary values. This library provides added precision and avoids potential issues with floating-point arithmetic, ensuring accurate and reliable results.
The user interface design takes inspiration from the CinemaCal website and has been optimized for user-friendliness. Key considerations in the design include clarity, ease of use, and accessibility.
The development process involved the following tasks:
- Implemented the overall app logic in a single file (App.tsx) to ensure functionality.
- Divided the code into different components, allowing for better code organization and reusability.
- Conducted manual testing of the logic and calculations to ensure accuracy.
- Applied CSS to enhance the app's visual appeal and maintain a neat design.