0.0.2 • Published 12 months ago

ticketing2 v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

Base-Parvan

Base-Parvan is a package that provides a foundation for projects developed by Parvan Pajooh. It allows you to easily create the base structure for your projects.

Installation

To install the Base-Parvan package, run the following command: npm i base-parvan

Usage

Before using the Base-Parvan package, make sure to include the following line at the top of your file: "use client";

Configuring the httpClient

To configure the theme for your project, you need to use the createClient function and provide the necessary configuration parameters. Here's an example of how to configure the theme:

import { createClient } from "base-parvan";

createClient({
  uaaUrl: "https://example.com", // URL for authentication
  backendBaseUrl: "https://example.com/api", // Base URL for API endpoints
  requestTimeout: 3000, // API request timeout in milliseconds
});

Make sure to replace the example URLs with the appropriate URLs for your project.

Using the Theme Wrapper

Once you have configured the theme, you can use the ParvanTheme component as a wrapper for your entire project. It provides a consistent theme and includes predefined styles and components. Here's an example of how to use the ParvanTheme component:

import { ParvanTheme } from "base-parvan";

function App() {
  return (
    <ParvanTheme
      logo="ExampleLOGO"
      smallLogo="EL"
      menuItems={[
        {
          id: "exampleId",
          path: "/examplePath",
          title: "exampleTitle",
          icon: (
            <!-- custom svg -->
          ),
        },
      ]}
    >
      {/* Your project's content goes here */}
    </ParvanTheme>
  );
}

Replace the logo, smallLogo, menuItems, and the content within the ParvanTheme component with your own project-specific values.

Please note that the provided code is a simplified example. You may need to adapt it to your specific project requirements and the actual usage of the base-parvan package.

API Calls

For API calls, you can use the httpClient component as shown below:

httpClient.call<exampleType>({
  method: 'GET',
  url: `example endpoint url`,
  // ...otherParams
});

Next.js Features

For other Next.js features such as next/navigation, next/link, and next/image, you can use the base-parvan components.