Introduction

Please carefully read this guide in order to fully configure this template, and remember to test it on browsers like Chrome, Edge, Safari, or Firefox.

IMPORTANT: The backend of this template is the DBase API.

A VPS Server, minimum 2GB RAM, 1 vCPUs is required to run the DBase API.
I strongly recommend you to use AWS Lightsail with Ubuntu 18.04, solid servers and good prices
In case you want to use a different backend, you'd need to change 80% of the code. Please note that I will not be responsible for any bug encountered after editing the original source code

Quick Start

BEFORE uploading the php file of the Website files folder into your own server, you can either do the following:
  • Copy the path (URL) where you’ve hosted the DBase files - ex: https://mydomain.com/dbasefiles - and replace the string of the DATABASE_PATH variable in the DBase.php file with your URL:
     $DATABASE_PATH = "https://example.com/dbase/";
    
  • Enter the _Tables folder on your server and delete the Users.json and Posts.json files
  • Upload the JSON files included in the Tables folder of this template’s package into the _Tables folder
Your website is now connected to your DBase backend!

You can now upload all the files and folders from the files folder to your own server via an FTP client app like Filezilla.
The installation of the .php files and folders into your own server is super easy, just connect Filezilla to your server, select all files contained in the files folder and upload them, like this example:


General

Server requirements

You must have your own domain and VPS server – get it on AWS Lightsail. DO NOT USE 000webhost.com or any other free hosting websites, nor a Shared Hosting plan – and make sure you have PHP enabled and updated to the 7 version or higher.

Also, you need to install the SSL Certificate and enable it in your own hosting server, usually this option comes apart from the hosting purchase. If you don’t buy and enable SSL, this website won’t work properly. So just make sure you have SSL and PHP enabled BEFORE uploading the files of the Website files folder into your own server.

If your VPS server is on AWS with Ubuntu 18.x, make sure to install the cURL, Apache, PHP and PEAR Mail.php packages

CSS style

The files folder contains the main.css file that handles the CSS layout of this template. You can find it into the css folder. Open it with your favorite text editor software and check it out.

Images

The files folder contains the img folder, where you can find the category images and other PNG images, including the favicon.png icon. Replace them as you wish, just don’t change their size and name so you won’t have to edit a single line of code to show them in your own version of this template.

Terms of Use and Privacy Policy

Open the terms-of-service.php file form the files folder and edit it accordingly to your own Terms of Service and Privacy Policy.

Delete a User’s account upon request

Accordingly to GDPR Terms, you have 24 hours to delete an account after receiving a deletion request. In order for you to delete an account, you first need to identify the user’s row in the Users table of your Database, keep a note of its ID_id value, select that row and click the Delete Row(s) button.
Then, just search for that ID_id value you’ve previously noted in all the other Tables of your database, check out all the rows until you’ll find that ID_id and delete it – this is in case it appears into some Array type columns.

Reported content

People are allowed to report inappropriate/offensive Items, as well as block/unblock Users from the Chat.
So you should daily check your Database in order to see the columns called AR_reportedBy in the Items tables, and take action for it asap. See if they contain some ID_id of the Users (which means those users have reported the data of that row). You may delete the abusive Users rows from your database forever by selecting a cell and click Delete row(s), but please note that before deleting a user from the Users table you must note its ID_id and search for it in the other tables.

Configurations

• The DBase.php file

You can find this file into the files folder.
Open it and keep reading this guide, you’ll have to perform some edits in this file in order to get your template ready to run:

DBase database and admin panel

To install and configure the DBase admin panel into your VPS server, please follow the instructions of its README file
Once you’ll have the DBase files ready in your own server, enter the _Tables folder and:
  • Delete the Users.json and Posts.json files
  • Upload the JSON files included in the Tables folder of this template’s package
In this way, you’ll get all the necessary Tables and columns for this app to work, without having to manually create them in the DBase Dashboard.
Data will be empty, so after you’ll get this app’s configurations done, you’ll be able to sign up with test Users, post items, and all the other features.

Website name

Replace the string of this variable with the name you want to give to this template:
 $APP_NAME = "Bazaar";

iOS App Store and Google Play Store links

If you’ve uploaded the mobile versions of this template into your own Apple and Google Stores, set their links to the following variables:
 $IOS_APPSTORE_LINK = '';
$GOOGLE_PLAY_LINK = '';

Google Sign in Client ID

Replace the string below with your own Google OAuth Client ID (check the Google Sign In paragraph to learn how to create your own OAuth Client ID):
 $GOOGLE_SIGNIN_KEY = ''; 

Share URL

Replace the string of this variable with the URL of your website:
 $SHARE_URL = 'https://yourdomain.com/';

Currency code

Replace the string of this variable with the currency code you need for this website:
 var PRICE_CURRENCY = "USD";

Array of Categories

You can edit the strings of this array as you wish – just in case you want to change category names. Remember to rename the .png images of the img folder accordingly to the changes you’ll make in this array, and ALL LOWERCASE characters:
 var categoriesList = [
    	"All Categories",  // Mandatory element, it must stay at first position
    
	    "Clothes",
	    "Home",
	    "Electronics",
	    "Hobbies",
	    "Toys",
	    "Pets",
	    "Books",
	    "Music",
	    "Health",
	    "Vehicles",
	    "Properties",
	    "Other",
    
    	// If you'll add new Categories here, remember to add their relative images in the 'img' folder too, all lowercase names
];

Array of Cities

You can edit the strings of this array based on the cities you want to list on your website. Please note that the first element is mandatory and it’s to search for items in all cities you’ve listed:
 var citiesList = [
            "All US Cities", // <-- FIRST CATEGORY THAT INCLUDES ALL LOCATIONS - MANDATORY, AND MUST STAY AT FIRST POSITION OF THIS ARRAY

	    "New York City",
	    "Chicago, Illinois",
	    "Charleston, South Carolina",
	    "Las Vegas, Nevada",
	    "Seattle, Washington",
	    "San Francisco, California",
	    "Washington, D.C.",
	    "New Orleans, Louisiana",
	    "Palm Springs, California",
	    "San Diego, California",
	    "St. Louis, Missouri",
	    "Sedona, Arizona",
	    "Honolulu, Hawaii",
	    "Miami Beach",
	    "Branson, Missouri",
	    "Boston, Massachusetts",
	    "Savannah, Georgia",
	    "Orlando, Florida",
	    "Portland, Oregon",
	    "Lahaina, Hawaii",
	    "Saint Augustine, Florida",
	    "Nashville, Tennessee",
	    "Los Angeles, California",
	    "San Antonio, Texas",
	    "Austin, Texas.",

];

Array of Listing types

There are 2 types of listing in this template:
 var listingTypes = [
   "On sale",
   "Looking for"
];

Price ranges

You can edit the following array as you wish, it’s a list of price ranges that users can select in order to filter a products search:
 var priceRanges = [
	    "Any price", // Mandatory element, it must stay at first position
	    
	    "From 30",
	    "From 50",
	    "From 100",
	    "From 150",
	    "From 200",
	    "From 500",
	    "From 1000",
];

Ads

This template can show Leaderboard and Square ads, usually from (Google Ads), so you have to replace the following code with your own ads code in the PHP files that contain it:

	img src="img/ad-leaderboard.png">

	img src="img/ad-square.png">

Utility Functions

Unless you are familiar with iOS programming, you should leave the code below this comment as it is:
 // TABLES & COLUMNS NAMES

DBase Backend

The backend of this template is DBase, you have to install it on your own VPS server - AWS Lightsail is strongly recommemnded - and configure it by following the README instructions.

PLEASE NOTE: If you already bought the iOS or Android version of this template, you don’t need to create a new database, just set the $DATABASE_PATH into the DBase.php file
IMPORTANT: Please also note that if you want to edit the code to make this template work with a different backend (Firebase, Parse, SQL, etc.), you must do it on your own, and I will not be responsible for any bug you may encounter after editing the original source code, nor I can offer support to fix issues

Google Sign In

  • Go to console.cloud.google.com/apis/credentials on your browser, log in with your Google account
  • Create a Project (unless you already have one)
  • Click the + CREATE CREDENTIALS button
  • Select the OAuth client ID option
  • On the next page, select Web application, choose a name for your Client ID
  • Click the + Add URI button and type your domain’s address (ex: https://yourdomain.com). Lastly, click the Create button:
  • Once your Client ID has been created, you will be bale to copy it form a popup window.
    Paste it in the $GOOGLE_SIGNIN_KEY variable of the DBase.php file
     $GOOGLE_SIGNIN_KEY = ''; 
    
    Remember to also paste that key in the same variable of the _config.php file of the DBase backend

Useful stuff


DBase backend
Download FileZilla
Download Sublime Text
Get familiar with HTML, CSS and PHP on W3School

F.A.Q.

Should I use the DBase API to make this template work?

The code of this app template is written using the DBase SDK for Android – included in the project – so you must download and install the DBase backend in your won VPS server to make it work the way it is.
If you’re an experienced developer and want to implement a different backend in the code, you can still buy this app and do it on your own, since UI/UX is already built.

Anyway, as mentioned earlier, please note that I will not be responsible for any bug encountered after editing the original source code to implement a different backend or extra features not included in the original source code

If I buy this app template, can I use for multiple projects?

No, only 1 app/purchase.
In case you want to publish more than 1 application using this template, you must purchase a License for each project you want to publish on the App/Play Store, either the Regular ot the Extended one

Can I use the DBase API for different projects/apps than this one?

Yes, you can use it in any other application or project

What kind of support is offered?

Free support is offered in case of bugs encountered in the original template, either in the code or the UI design.
In case you have edited the code – and so created bugs because of your editing – I may apply some fee to fix your bugs by a remote connection through AnyDesk, or by you sending me your source code for verification.
This doesn't apply in case you changed the code to implement a different backend than DBase

I’ve performed all configurations mentioned in this Guide, but something is wrong. What should I do?

  • • Check if you have SSL enabled in your hosting provider’s website
  • • Check if you’re using either Chrome, Sarafi, Edge or Firefox browsers
  • • Check if you’ve set the correct website path/URL in the DBase.php file

What hosting provider is best?

Based on my experience and tests, AWS Lightsail is the best VPS server provider. I am unable to guarantee you that the files of this template will properly work on other hosting providers.

Support

PLEASE NOTE: I can offer FREE support for bugs/errors encontered in the original code.

Email me
DM me on Twitter