# Cancer cellbank and NFT(T-03,T-04) --- ## cellbank website ### PostgreSQL #### Create a PostgreSql database 相關指令  ---- #### PGadmin4  * 觀念流程圖 ----  * 成功將DB中的數值存取成功 ----  * [PGadmin4 資料庫更新慢解決方式](https://stackoverflow.com/questions/43963403/pgadmin4-is-very-slow-to-open-empty-tables-of-database) ---- #### Project ongoing ---- ##### flask website * framework:flask * backend language:python 3 * DB:postgreSQL ---- ###### pipenv 實作 * [pip install易錯問題 下載時就要在變數環境中改動](https://stackoverflow.com/questions/64511066/python-3-9-pip-install) * 如以下圖  ---- * pipenv安裝成功  * flask安裝成功   * psycopg2 安裝  * flask-sqlalchemy安裝  * gunicorn安裝--->之後若要 deploy 到 ==heroku== 需要用到  ---- * [pipenv管理套件工具使用](https://medium.com/@chihsuan/pipenv-%E6%9B%B4%E7%B0%A1%E5%96%AE-%E6%9B%B4%E5%BF%AB%E9%80%9F%E7%9A%84-python-%E5%A5%97%E4%BB%B6%E7%AE%A1%E7%90%86%E5%B7%A5%E5%85%B7-135a47e504f4)  --- ### flask實作細節 #### flask安裝 * [flask基本介紹](https://ithelp.ithome.com.tw/articles/10222132) ---- #### flask應用架構  ---- #### flask連上伺服器  ---- #### app get/post  ---- #### 網站程式測試server是否正常  ---- * 重新整理網站browser,會發給後端程式一個要求,後端程式會紀錄新的連線  * 後端程式按ctrl+c連線才會停下來  * [How to setup environment variables for `flask run` on Windows?](https://stackoverflow.com/questions/51119495/how-to-setup-environment-variables-for-flask-run-on-windows) --- #### Flask-SQLAlchemy * [使用documentaton](https://flask-sqlalchemy.palletsprojects.com/en/2.x/quickstart/) * [ Flask-SQLAlchemy 資料庫操作](https://www.maxlist.xyz/2019/11/10/flask-sqlalchemy-setting/) * 成功讓資料庫得到我從前端介面成功輸入的資料  * Mailtrap 收到send_email.py寄送出的信(包含我在前端頁面寫下的資訊)   * 同時pgADMIN4也可以看到資料庫裡多一筆剛傳入的資料  --- ### Heroku * Flask網站架設--->deploy 到 heroku雲端主機 * 確定上架到heroku   * 從heroku上建好DB  * 拿到production DB url  * 為了在heroku上啟動專案 * 創建procfile使用gunicorn套件--->第一個參數:app.py取app 第二個參數固定打app  * 推到 heroku local repository  * 設定git remote  * 成功上架heroku masterbranch成功  ---- * ==常見問題== * 如果當掉了,要重連pgADmin4中資料庫的連線,重新開啟--->卡關很久 *  *  * 回到server---> * app.py連線到DB check有無schema table---> * ==TypeError: __init__() takes 1 positional argument but 5 were given==---> * Heroku 卡很久 連不上(==未解決why??==) *  * Requested runtime (Python 3.9.6) is not available for this stack (heroku-20) * [stack overflow解法--->其實就小心runtime.txt大小寫因為case sensitive](https://stackoverflow.com/questions/57216239/requested-runtime-python-3-7-3-is-not-available-for-this-stack-heroku-18)  * [The local psql command could not be located](https://devcenter.heroku.com/articles/heroku-postgresql#set-up-postgres-on-windows)  --- ### 串 gmail API   * [flask mail](https://pythonhosted.org/Flask-Mail/) ==寄送gmail通知== ### DB diagram * [學習資料](https://dbdiagram.io/d) ### bitbucket * [協作工具](https://bitbucket.org/shawn90830/cancerfree/create-file/6685fbfd0b95384e0940cd37cf09d1606d31de06/?at=master) ### get/post差別 * [get/post區別](https://totoroliu.medium.com/http-post-%E5%92%8C-get-%E5%B7%AE%E7%95%B0-928829d29914) ### python #### __init__ * [ __ __init__ __ in Python](https://www.geeksforgeeks.org/__init__-in-python/) * [繼承](https://www.geeksforgeeks.org/__init__-in-python/) --- ### Accepting Payments in Flask Using Stripe * [stripe API 串接金流](https://easonwang.gitbook.io/web_advance/jin-liu-chuan-jie/stripe-chuan-jie) * [stripe API文件](https://stripe.com/docs/api) * [stripe CLI](https://stripe.com/docs/development) * [How to Run an EXE File From Command Prompt](https://www.wikihow.com/Run-an-EXE-File-From-Command-Prompt) * [Install Stripe CLI on Windows 10 Using Scoop Windows Package Manager](https://www.youtube.com/watch?v=DTr2mLY_8gs) * 在stripe上的拍賣產品  * price api id  #### Final Goals ==用flask框架架站連結opensea 顯示cancerfree網站數量的增減== --- ## NFT ### NFT 基礎入門概念 * [實作NFT接到ERC-721公鍊 使用solidity](https://www.youtube.com/watch?v=YPbgjPPC1d0&t=968s&ab_channel=DappUniversity) * [2021 快速建立 ERC721 標準智能合約並且 Mint NFT](https://yulinchou.medium.com/2021-%E5%BB%BA%E7%AB%8B-erc721-%E6%A8%99%E6%BA%96%E6%99%BA%E8%83%BD%E5%90%88%E7%B4%84-%E4%B8%A6%E6%89%93%E9%80%A0%E8%87%AA%E5%B7%B1%E7%9A%84-nft-99afaca68530) * [智能合約 smart contract很好懂入門影片](https://www.youtube.com/watch?v=ZE2HxTmxfrI&ab_channel=SimplyExplained) * [NFT很好懂4分鐘短片](https://www.youtube.com/watch?v=FkUn86bH34M&ab_channel=SimplyExplained) * [乙太坊查閱文件](https://ethereum.org/en/developers/docs/intro-to-ethereum/) * [中文版solidity好懂教學短片 建議1.5倍速觀看 ](https://youtu.be/z2FEikbDqoA) ### 實作紀錄 #### 在remix上實作第一份CancerFree.sol NFT  ---- #### 在IPFS(星際檔案系統)上 上傳第一份Cancercell  ---- ##### IPFS JSON檔  ---- #### 和faucet service乞討完付完0.4eth的gas fee 後  ---- #### Deploy 成功  ---- #### mint成功  ---- #### 檢查有無出現在 rinkeby etherscan 上的 Transaction 網址 ==若有-->代表成功mint==  #### 上架到opensea上囉  ---- ## 實作筆記(大家可以把心得打在上面) ---- ## 留言區(問題討論) *  * --->==編輯有問題的話可以按最上面那一排的"?"== *  * --->==內容有問題也可以按右上角的問號鍵 打下問題內容== ## 未整理 Products內容較多 (不需要培養) Guest,memeber,VIP 可以修改內容 中英文 react restfulAPI Postsgre 有membership 功能可以買東西即可 會員買細胞 剩多少細胞 狀態如何 參考網站內容 著名文字 Shopping website 認知細胞網站construction 區塊鏈 data先放100顆癌病毒 ethereum ECR721 testify 放到testnet上看到 cz001 ---> 10個copy的nft(publish 1個 image) Drug screening Clinical celline 名字 凍管 str opensea ipfsswarm
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up