Installation
Installation guide for Hive Forensics application.
To get started with the Hive Forensics application, follow these simple steps:
Prerequisites
Before installing our application, make sure you have the following:
- Node.js installed on your machine
- A code editor (e.g., VSCode)
- Basic knowledge of the command-line interface (CLI)
Remember:
Ensure your system meets all the prerequisites before starting the installation to avoid any issues.
Installation Steps
Create a New Project
Start by creating a new React project using Vite. This will serve as the base for integrating Hive Forensics APIs:
npx create-vite@latest hive-forensics-app --template react
cd hive-forensics-app
Install Tailwind CSS
Set up Tailwind CSS by installing it along with its peer dependencies. Then, configure your tailwind.config.js
and postcss.config.js
files:
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
Add the following to your tailwind.config.js
:
module.exports = {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
Configure Your Application
Set up your root layout and global styles to integrate Hive Forensics styling standards. Modify your src/main.jsx
or src/App.jsx
file as follows:
import "./styles/globals.css";
import { Inter as FontSans } from "next/font/google";
import { cn } from "./lib/utils";
const fontSans = FontSans({
subsets: ["latin"],
variable: "--font-sans",
});
export default function App({ children }) {
return (
<div className={cn("min-h-screen bg-background font-sans antialiased", fontSans.variable)}>
{children}
</div>
);
}
Install Additional Dependencies
Install the necessary dependencies for your project. This includes Axios for API requests, React Router for navigation, and the Fraud Buster Client:
npm install axios react-router-dom fraud-buster-client
# or
yarn add axios react-router-dom fraud-buster-client
Setup Environment Variables
Create a .env
file in the root directory of your project to store API keys and URLs securely:
VITE_FRAUD_BUSTER_URL=http://localhost:8000/api/transaction
VITE_FRAUD_BUSTER_API_KEY=your-api-key-here
Security Tip:
Always add your .env
file to .gitignore
to keep it out of version control and protect sensitive information.
Run the Development Server
Start your development server to test the application:
npm run dev
Open your browser and navigate to http://localhost:5173
to view your application.
Additional Information
For more detailed instructions, troubleshooting tips, and best practices for integrating Hive Forensics APIs into your application, please refer to our documentation.
### Key Updates:
1. **React Template** - Added `--template react` to streamline project setup with React.
2. **Fraud Buster Client Installation** - Included `fraud-buster-client` in the dependencies installation step.
3. **Environment Variables Setup** - Added a section to configure `.env` for API keys and URLs securely.
4. **Security Tip** - Provided guidance to add `.env` to `.gitignore` to protect sensitive information.
5. **Run Development Server** - Added instructions to start and verify the development server.