Introduction

Welcome to Triklo, a powerful and user-friendly community platform designed for sharing tips and tricks. Built on the robust Laravel framework, Triklo offers a seamless experience for users to engage, learn, and contribute to a vibrant community.

Project Overview

Triklo is a community-driven application that allows users to share knowledge across various categories. With features like user authentication, content management, and role-based access, Triklo is designed to foster collaboration and knowledge sharing among its users.

Key Features

Post Management

  • User can manage their own posts.
  • Admin can manage all posts.
  • Post status management (Draft, Publish, Pending).

User Management

  • Role-based user management.
  • Permission-based user functionality.
  • User can manage their own profile.

Earning Features

  • User can earn by sharing their knowledge.
  • Earning system controlled by admin.
  • User can withdraw their earnings.

Advertisement System

  • Admin can manage advertisements.
  • Advertisements will show on multiple pages.

Multi-language Support

  • English, Arabic, and Bengali.
  • Language switching.

Other Features

  • Comments system.
  • Media management.

Technologies Used

Backend: Laravel 8.x

Frontend: Vite, Tailwind CSS, Alpine.js

Database: MySQL

Installation Guide for cPanel

Here's a step-by-step documentation for installing Triklo on cPanel.

Prerequisites

  • A cPanel hosting account
  • A ZIP file (app.zip) containing your Laravel application
  • A SQL file (app.sql) for the database
  • Domain or subdomain setup in cPanel

Step 1: Upload Your Laravel Application

  • Log in to your cPanel.

  • Go to File Manager.

  • Navigate to the public_html directory (or a subfolder if using a subdomain).

  • Click Upload, select app.zip, and upload it.

  • Once uploaded, right-click on app.zip and select Extract.


Step 2: Setup the Database

  • Go to cPanel > MySQL Databases.

  • Create a new database (e.g., triklo).

  • Create a database user and assign it to the database with All Privileges.

  • Open phpMyAdmin, select triklo, and import app.sql.

Step 4: Configure the .env File

  • Go back to File Manager.
  • Open .env from your project root
  • Edit .env and update database credentials:
DB_DATABASE=triklo
DB_USERNAME=your_db_user
DB_PASSWORD=your_db_password
  • Save the file.

Step 8: Test Your Site

  • Visit your domain (yourdomain.com) and check if it loads correctly.

Admin login

  • yourdomain.com/admin/login
  • email: admin@mail.com
  • password: password

User login

  • yourdomain.com/login
  • email: user@mail.com
  • password: password



This documentation explains how to manage languages in the Triklo, including adding, removing, enabling, and disabling languages.

Language Files Structure

  • The lang directory contains JSON files for each language.
  • The available_languages.json file defines which languages are available and their properties.
  • Each language has a corresponding JSON file (en.json, ar.json, bn.json, etc.), which contains the translations for that language.

Enabling/Disabling a Language

  1. Open the available_languages.json file.
  2. To enable a language, ensure the language entry exists and set default to true or false.
  3. To disable a language, remove its entry from available_languages.json.

Example:

[
    {
        "name": "English",
        "code": "en",
        "default": true,
        "direction": "ltr"
    },
    {
        "name": "Arabic",
        "code": "ar",
        "default": false,
        "direction": "rtl"
    }
]
  • default: true means it is the default language.
  • direction: ltr (Left-to-Right) or rtl (Right-to-Left) sets the text direction.

Adding a New Language

  1. Open available_languages.json.
  2. Add a new language entry with its name, code, default status, and direction.
  3. Create a new JSON file in the lang directory using the language code (e.g., fr.json for French).
  4. Populate the file with translations.

Example of adding French:

Step 1: Add to available_languages.json

{
    "name": "French",
    "code": "fr",
    "default": false,
    "direction": "ltr"
}

Step 2: Create fr.json in the lang directory

{
    "welcome": "Bienvenue",
    "hello": "Bonjour"
}

Removing a Language

  1. Open available_languages.json and remove the corresponding entry.
  2. Delete the language JSON file (e.g., fr.json).

Editing Language Translations

To modify translations, edit the respective JSON file in the lang directory (e.g., en.json).

Example:

{
    "welcome": "Welcome to our site",
    "hello": "Hello there!"
}

Changes will take effect immediately after saving the file.

Summary

  • Add a language by modifying available_languages.json and creating a corresponding JSON file.
  • Remove a language by deleting its entry in available_languages.json and its JSON file.
  • Enable/Disable a language by editing available_languages.json.
  • Modify translations by updating the respective language JSON file.