Skip to content

ICP-Latam/ICPDI-Motoko-tco-icp-sales-chatbot

 
 

Repository files navigation

TCO ICP Sales Chatbot

Install

git clone [email protected]:mariogarcia-ar/tco-icp-sales-chatbot.git
cd tco-icp-sales-chatbot

# nvm install
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
nvm install v18.17.0 
nvm use v18.17.0 

# install packages
npm install 

Backend

dfx start --background

Frontend

rm -rf dist && dfx cache delete && dfx deploy

Candidate Interface

npm run generate

Blogs

Create Blog

dfx canister call tco_icp_sales_chatbot_backend createBlog '(
    "1", 
    record {
        title = "How to promote brands";
        image = "/img/blogs/1.webp";
        excerpt = "When you enter into any new area of science, you almost reach";
        date = "23.12.2022";
    }
)'

Read Blog by Id

dfx canister call tco_icp_sales_chatbot_backend showBlog '("blog4")'

Read All Blogs

dfx canister call tco_icp_sales_chatbot_backend getBlogs '()'

Update Blog

Success

dfx canister call tco_icp_sales_chatbot_backend updateBlog '(
    "1", 
    record {
        title = "How to promote brands updated";
        image = "/img/blogs/1.webp";
        excerpt = "When you enter into any new area of science, you almost reach";
        date = "23.12.2022";
    }
)'

Blog not found.

dfx canister call tco_icp_sales_chatbot_backend updateBlog '(
    "100", 
    record {
        title = "How to promote brands updated";
        image = "/img/blogs/1.webp";
        excerpt = "When you enter into any new area of science, you almost reach";
        date = "23.12.2022";
    }
)'

Remove Blog by Id

dfx canister call tco_icp_sales_chatbot_backend destroyBlog '("1")'

Products

Create Product

dfx canister call tco_icp_sales_chatbot_backend createProduct '(
    "1", 
    record {
        title = "How to promote brands";
        image = "/img/products/1.webp";
        price = 123.5;
    }
)'

Read Product by Id

dfx canister call tco_icp_sales_chatbot_backend showProduct '("product4")'

Read All Products

dfx canister call tco_icp_sales_chatbot_backend getProducts '()'

Update Product

Success

dfx canister call tco_icp_sales_chatbot_backend updateProduct '(
    "1", 
    record {
        title = "How to promote brands updated";
        image = "/img/products/1.webp";
        excerpt = "When you enter into any new area of science, you almost reach";
        date = "23.12.2022";
    }
)'

Product not found.

dfx canister call tco_icp_sales_chatbot_backend updateProduct '(
    "100", 
    record {
        title = "How to promote brands updated";
        image = "/img/products/1.webp";
        excerpt = "When you enter into any new area of science, you almost reach";
        date = "23.12.2022";
    }
)'

Remove Product by Id

dfx canister call tco_icp_sales_chatbot_backend destroyProduct '("1")'

About

Automated Sales Agent on ICP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 47.9%
  • CSS 19.9%
  • JavaScript 16.7%
  • Motoko 8.6%
  • PHP 6.9%