Friendbook NextJs Theme

Welcome to Friendbook!

When you unpack downloaded archive from ThemeForest.net you'll get folder containing 2 folders.

  1. Documentation - Documentation for Friendbook HTML site template
  2. THEME - Friendbook Main Folder
  • Theme
    • src
      • app
        • auth
          • page.tsx
        • api
          • auth /*--------------------- For next-auth ---------------------- */
            • [...nextauth]
              • authOption.tsx
              • pages-options.ts
              • route.ts
        • birthday
          • page.tsx
        • company
          • page.tsx
        • other main pages
      • Common
        • common modals for themes
        • common dropdown for themes
        • other common components for theme
      • components
        • auth
          • index.tsx
        • birthday
          • index.tsx
        • company
          • index.tsx
        • all component here
      • Data
        • company
          • index.tsx
        • birthday
          • index.tsx
        • Event
          • index.tsx
        • all component here
      • layout
        • common layout
          • common-layout.tsx
        • layout related files here
      • redux-toolkit
        • redux-files here
      • utils
        • DynamicNumberArray.tsx
        • for themes utils will be here
      • middleware.tsx
    • public
      • assets
        • fonts
          • all fonts files
        • images
          • all images
        • scss
          • base
            • _reset.scss
            • _typography.scss
          • components
            • _accordion.scss
            • _animation.scss
            • _button.scss
            • _calender.scss
            • _dropdown.scss
            • _emoji.scss
            • _form.scss
            • _gradient.scss
            • _icon.scss
            • _pagination.scss
            • _popover.scss
            • _ratio.scss
            • _slick-slider.scss
            • _switch.scss
            • _timer.scss
            • _title.scss
          • layout
            • _acitivity-log.scss
            • _app.scss
            • _birthday.scss
            • _breadcrumb.scss
            • _chatbox.scss
            • _conversation-sidebar.scss
            • _element-page.scss
            • _event.scss
            • _filter.scss
            • _footer.scss
            • _hashtag.scss
            • _header.scss
            • _like-page.scss
            • _loader.scss
            • _location.scss
            • _modal.scss
            • _page-cover.scss
            • _player.scss
            • _profile-about.scss
            • _profile-box.scss
            • _profile-cover.scss
            • _post.scss
            • _sidebar.scss
            • _story.scss
            • _suggestion-box.scss
            • _tap-top.scss
            • _user.scss
            • _weather.scss
          • pages
            • _about.scss
            • _birthday-page.scss
            • _blog-page.scss
            • _career.scss
            • _company-landing.scss
            • _coming-soon.scss
            • _contact-us.scss
            • _error-page.scss
            • _event-page.scss
            • _favourite-page.scss
            • _games.scss
            • _help-support.scss
            • _home.scss
            • _login-signup.scss
            • _messanger.scss
            • _music.scss
            • _page-list.scss
            • _profile-page.scss
            • _setting.scss
            • _weather-page.scss
          • themes
            • _theme-setting.scss
            • _responsive.scss
            • _rtl.scss
          • utils
            • _dark-variables.scss
            • _helpers.scss
            • _variables.scss
            • _mixins.scss
          • vendor
            • bootstrap
              • all bootstrap scss files
            • font-awesome
              • all font-awesome scss files
            • _animate.scss
            • _bootstrap.scss
            • _date-picker.scss
            • _emojionearea.scss
            • _font-awesome.scss
            • _fullcalender.scss
            • _slick.scss
            • _slick-theme.scss
            • _tippy.scss
            • _weather-animated.scss
        • dark.scss
        • style.scss
    • .env.local
    • next-env.d.ts
    • next.config.ts
    • package.json
    • README.md
    • tsconfig.json

Welcome to Next.js! Next.js helps you build modern web applications.

For getting started an Next.js application you needs two things as Prerequisites.

Prerequisites

Before you begin, make sure your development environment includes Node and an npm package manager.

  1. Node.js

    Install Node.js using downloaded file

    To check your node version, run node -v in a terminal/console window.

  2. Npm package manager

    CLI (command line interface), and React apps depend on features and functionality provided by libraries that are available as npm packages. To download and install npm packages, you must have an npm package manager.

    This Quick Start uses the npm client command line interface, which is installed with Node.js by default. To check that you have the npm client installed, run npm -v in a terminal/console window.

    For better understanding React we suggest you to once go through official documentation of React from reactjs.org

Next.js setup

If you want Friendbook theme setup then directly follow next Friendbook setup section

Create Initial application

Run the npm command create-next-app and provide the details:

npx create-next-app@latest

The create-react-app command prompts you for information about features to include in the initial app project. Accept the defaults by pressing the Enter or Return key.

Serve Application

Go to the workspace folder (my-app).

cd my-app

Launch the server by using the npm command npm run dev

npm run dev

Build Application

Build you application for host on server using below command:

npm run build

It will create one .next/static folder in your root directory. This folder contains all the optimized and bundled files for your Next.js app. Make a zip of the .next/static folder. You are now ready to upload your theme to the server.

Friendbook setup

If you have already download and install node.js then ignore prerequisites accordingly.

Friendbook setup

You can check it in your terminal window using these commands node --version and npm --version.

Friendbook Template Setup

  • Download and extract an Friendbook Template from themeforest
  • Extract it and then go in to Template folder. cd Template
  • Create the .env.local File: Inside your project root directory, create a file named .env.local to store environment variables execute the following command.
  • touch .env.local
  • Configure .env.local Variables
  • 1. For next-auth to work properly, you'll need to configure a few environment variables based on the authentication provider(s) you're using. Here's a basic example for Google OAuth, but the structure will vary slightly depending on the provider.
  • Example Configuration for Google OAuth: .env.local

    NEXTAUTH_SECRET=your_super_secret_key
    NEXTAUTH_URL=http://localhost:3000    /* can use any port */
    
    # Google OAuth Credentials
    GOOGLE_CLIENT_ID=your_google_client_id
    GOOGLE_CLIENT_SECRET=your_google_client_secret

  • 2. NEXTAUTH_SECRET: A secret key used to encrypt JWT tokens. You can generate a random string using any secret key Open your terminal in mac/linux and enter the following command and it will generates a random 32-character base64-encoded string using OpenSSL:
  • openssl rand -base64 32

    If your are a Windows user you can generate from here :

  • 3. NEXTAUTH_URL: This is the URL of your application. During development, it is usually http://localhost:3000 In production, this will be the live domain of your website.
  • 4. Add the Authentication Provider:
  • In your Next.js project, create a file at app/api/auth/[...nextauth]/authOption.tsx (or .js for JavaScript users) and add your providers. Here's an example using Google:
  • import NextAuth from 'next-auth'
    import GoogleProvider from 'next-auth/providers/google'
    
    export default NextAuth({
        providers: [
              GoogleProvider({
                      clientId: process.env.GOOGLE_CLIENT_ID,
                      clientSecret: process.env.GOOGLE_CLIENT_SECRET,
        }),
      ],
    })
  • 5.More details for next-auth prefer next-auth documentation Next-Auth-Documentation
  • Import all dependency by installing npm command npm install
  • Now you are in stage to successfully run Cion using below command: npm run dev

NPM use the package.json file and automatically install the required local dependencies listed in it.

In Friendbook theme, google fonts have been used. google fonts are open source and easy to use. Friendbook have used following fonts:

you can use different google fonts. following are the steps

  1. Go to Google Fonts.
  2. Use the filters on the left-hand side to display the kinds of fonts you want to choose and choose a couple of fonts you like.
  3. To select a font family, press the ⊕ button alongside it.
  4. When you've chosen the font families, press the [Number] Families Selected bar at the bottom of the page.
  5. In the resulting screen, you first need to copy the line of HTML code shown and paste it into the head of your HTML file. Put it above the existing element, so that the font is imported before you try to use it in your CSS
  6. You then need to copy the CSS declarations listed into your CSS as appropriate, to apply the custom fonts to your HTML.

In Friendbook theme, we have used Unlimited Colors.

To try different color combinations we have provided a color selector so that you could tweak the colors are per your needs and from the theme itself and when you are satisfied with the changed color, you can set the primary and secondary color in the scss file. you need to choose any color and set that css to your html pages in your jsx(see below).

useEffect(() => {
  setTimeout(() => {
    document.documentElement.style.setProperty("--theme-color","82, 128, 164");
  }, 3500);
          
  return () => {
    document.documentElement.style.setProperty("--theme-color","3, 137, 201");
  };
}, []);
Now it's bit easy to remove demos from theme

Suppose if you don't want other demo except demo which you like then just do below steps:

Note: Same component import statement you need remove from other menus like shop, products, features etc.. as per you received an error in your console.

Suppose if you want to remove /change the loader which you can see in page load that you can change from:

Friendbook have mainly used FontAwesome Icons. FontAwesome icons available in FontAwesome.com/icons, other icons are available in assets/images/icon

how to use FontAwesome font

for example:

<i className="fas fa-camera"></i> <!-- this icon's 1) style prefix == fas and 2) icon name == camera -->
<i className="fas fa-camera"></i> <!-- using an <i> element to reference the icon -->
<span className="fas fa-camera"></span> <!-- using a <span> element to reference the icon -->

how to use Feather Icon

for example:

<DynamicFeatherIcon iconName="MessageSquare" className="iw-16 ih-16"/>

how to use Theme Icon

how to use Animated Weather Icon

how to use Emoji/weather Icon

If you want RTl theme, changes are below:

<!-- Add class rtl in body tag -->
<body class="rtl">

If you want Dark theme, changes are below:

<!-- Add class dark in body tag -->
<body class="dark">

What is Skeleton Screen?

Skeleton screen is a low fidelity UI into which information is gradually loaded. It gives users a visual cue that the content is being loaded into each UI element.

Skeleton Screen when used as the feature in the product make people perceive that app/website is loading fast. Improved perceived performance not only provide good UX but also helps in increasing conversion ratio.

How to set Skeleton Loader

there is a loader component in starting of pages. you can remove it by just delete that section.


import LoaderHoc from "@/utils/LoaderHoc"
import { LoadingLoaderProps } from "./LayoutTypes"
              
 const LoadingLoader: React.FC<LoadingLoaderProps> = ({ show }) => {
   return (
    <>
      {show && (
        <div className="loading-text">
          <div>
           <h1 className="animate">Loading</h1>
           </div>
           </div>
       )}
      </>
   );
 };
              
export default LoaderHoc(LoadingLoader);

Ratio Classes: Change your image proportion by just adding class

If you use image as background than add class ".bg-img" in image and add below class in parent.

RTL and pages link button are for demo purpose only, following is the steps to remove that buttons:

  1. You can delete the Theme Customizer component from the page that you wish to remove.
  2. Remove _theme-setting.scss(assets/scss/themes/_theme-setting.scss) from style.scss(assets/scss/style.scss)

without this plugins and products, our theme will be incomplete.

open source plugins

Recent Version

Once again thank you for purchasing one of our Templates , if you like our Templates please rate us

Best Regards, Pixelstrap