Documentation
Documentation
Navigation
Edge)
Requirements
node(12.13.0 or later)
yarn
PHP 7.4
MySQL 8
ext_curl
editor: Visual Studio Code(recommended)
How it works
api
shop
admin
NextJs
Typescript
Tailwindcss
NextJs
Typescript
Tailwindcss
React Hook Form
React-Query
API
API
Laravel
Getting Started
Installation Video
Prerequisites
PHP 7.4
Composer
simplexml
PHP's dom extension
mbstring
GD Library
Frontend
node(12.13.0 or later)
yarn
Getting Started
DB_HOST=localhost
DB_DATABASE=chawkbazar_laravel
DB_USERNAME=root
DB_PASSWORD=
Prerequisites
Docker
Installation
Video
https:!"www.youtube.com/watch?v=Cb_jb2N2UYM
running
Navigate to api then sail down to stop the
cd admin/rest
cd shop
For Admin :
yarn dev:admin-rest
admin/{chosen-directory-name} )
** Note: **
file.
For Shop :
For Shop :
Shop config
yarn dev:shop-rest
yarn dev
Admin dashboard
Analytics Dashboard
Product Management
Product Management
Coupon Management
Coupon Management
Customer Management
Tax Management
In Tax menu you will get the Tax list and you
can add, remove or modify Tax from there.
Shipping Management
Shipping Management
In shipping menu you will get the shipping list
In shipping menu you will get the shipping list
and you can add, remove or modify shipping from
there.
Settings Management
Customization
Customization
[your-frontend-
project]/src/settings/site.settings.ts
currencyCode: "USD";
CSS styles:
open [your-frontend-project]/tailwind.config.js
Go to Tailwindcss
Icons:
open [your-frontend-project]/src/components/icons
Menu
Menu
https:!"www.youtube.com/watch?v=ewNGG_i3r-Y&feat
ure=emb_title
Data Structure
Banner
Banner
https:!"www.youtube.com/watch?v=AMOexuHTKa0
Data Structure
Data Mapping
homeOneBanner
homeOneHeroBanner
[1]
[2]
[3]
homeTwoHeroBanner
[1]
[2]
[3]
homeThreeBanner
[1]
[2]
homeThreeMasonryBanner
[1]
[2]
[3]
[4]
[5]
bannerGrid
[1]
[2]
[3]
promotionBanner
[1]
[2]
[3]
promotionBannerTwo
[1]
[2]
[3]
bannerDataOne
[1]
[2]
[3]
bannerDataTwo
[1]
[2]
[3]
homeThreeProductsBanner
[1]
[2]
homeFourBanner
[1]
[2]
[3]
homeFourGridBanners
[1]
[2]
[3]
homeFiveBanner
[1]
Brand
Utilities
Utilities
cd [your-frontend-project]/src/utils/
API Integration:
For example:
NEXT_PUBLIC_REST_API_ENDPOINT=
'{put_your_api_url_here}'
Data Fetching
“[your-frontend-project] = admin [ rest ] or
shop
[your-frontend-rest-project]/src/data/
React-Query
Uses Example:
Query
const {
isFetching: loading,
isFetchingNextPage: loadingMore,
fetchNextPage,
hasNextPage,
isError,
data,
error,
} = useProductsQuery({
type: "grocery",
text: "",
category: "grocery",
});
Mutation
const {
mutate: createProduct,
isLoading: creating,
} = useCreateProductMutation();
function handleSubmit(inputVaues) {
createProduct(
{
...inputValues,
},
{
onError: (error: any) => {
Object.keys(error?.response?.data).forEach((field:
any) => {
setError(field, {
type: "manual",
message: error?.response?.data[field]
[0],
});
});
},
}
}
);
}
Deployment
Domain Setup
To use Cloudflare,
Login to Server
https:!"www.youtube.com/watch?v=cESkbAmmDPc
Access Server
Install NodeJS
Install Yarn
Install PM2
Setup Server
Introduction
Nginx is one of the most popular web servers in
the world. In this deployment tutorial, we're
going to use Nginx to host our website. In this
tutorial, we're going to use ubuntu 20.04 to
host chawkbazar
sudo mysql
CREATE DATABASE chawkbazar;
FLUSH PRIVILEGES;
mkdir /var/www/chawkbazar
chawkbazar-api
sudo rm /etc/nginx/sites-enabled/default
server {
listen 80;
server_name YOUR_DOMAIN.com;
charset utf-8;
# For API
location /api {
alias /var/www/chawkbazar/chawkbazar-
api/public;
location @api {
rewrite /api/(.*)$ /api/index.php?/$1 last;
}
location /admin{
proxy_pass http://localhost:3002/admin;
proxy_http_version 1.1;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-
fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
$realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
deny all;
}
}
sudo nginx -t
Secure Server
Install API
cd /var/www/chawkbazar/chawkbazar-api
cp .env.example .env
Edit .env
nano .env
composer install
Edit admin/rest/next.config.js ,
yarn
Shop
NEXT_PUBLIC_REST_API_ENDPOINT="https://YOUR_DOMAIN/
api"
Admin
NEXT_PUBLIC_REST_API_ENDPOINT="https://YOUR_DOMAIN/
api"
Image Config
Build Project
yarn build:admin-rest
And for the shop ,
yarn dev:shop-rest
yarn build:shop-rest
yarn
Vercel
“
[your-frontend-project]` = `admin` [`rest`] or
`shop
vercel.com
Frontend
Step 1:
NEXT_PUBLIC_REST_API_ENDPOINT=
'{put_your_api_url_here}'
Step 2:
vercel
** NOTE: ** for deploying to vercel you need to
install vercel-cli on your machine for more
information please visit here
Social Login
yarn build:shop-rest
yarn build:admin-rest
yarn build:shop-rest
yarn build:admin-rest
Configuration
Twilio Configuration:
MessageBird:
FrontEnd Demo
Dashboard:
Attributes:
Products:
Order:
Staff:
WithDraw:
User Roles:
Super Admin:
Super Admin:
Store Owner:
Staff:
Withdraw Payment:
Simple Product
Attributes csv
products csv
variation options csv