Coder Social home page Coder Social logo

unchaptered / coffee-selector Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 1.7 MB

강도, 산미, 취향 등에 선택에 따라 캡슐커피를 추천해주는 사이트

Python 25.14% HTML 39.10% CSS 9.69% JavaScript 26.08%
flask dotenv flask-bcrypt pymongo

coffee-selector's Introduction

Coffee-selector

사이트 방문하기 - coffee-selector.shop
유투브 영상 보기 - www.youtube.com/watch?v=PZmnmWDcpUE


기여자

  1. SilverTree
  2. crystal025
  3. JeungHoSub
  4. unchaptered

폴더 구조

root
├ static
│ ├ css
│ └ js
├ templates
│ ├ components
│ ├ layout
│ └ pages
├ src/modules
├ database.py
└ app.py

모듈 리스트

모듈명 설명
flask 프레임워크
Jinja2 탬플릿 엔진
python-dotenv 환경변수 출력 모듈
PyJWT JWT 토큰 모듈
Bcrypt-Flask 비밀번호 암호화 모듈(단방향)

CDN 링크 모음

  1. Bootstrap CSS
  2. JQUery, Pooper, BootStrap JS
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
    integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
    crossorigin="anonymous">

<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
    integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
    crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
    integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
    crossorigin="anonymous"></script>

coffee-selector's People

Contributors

cesdea avatar jeunghosub avatar new-crystal avatar unchaptered avatar

Watchers

 avatar  avatar

Forkers

cesdea

coffee-selector's Issues

env 조건추가

결과 기록을 저장할려고 데이터베이스 하나 늘립니다.
이름은 COLLECTION_SELECT

Flask-Brypt 를 이용한 비밀번호 암호화

일반적인 암호화에는 두 가지가 있습니다.

  1. 단방향 암호화 : 암호화를 해서 복호화(원래 글자로 되돌리기) 가 불가능한 구조
  2. 양방향 암호화 : 암호호와 복호화가 모두 가능한 구조

비밀번호 암호화는 보편적으로 단방향 암호화 를 사용하며, 관련 레퍼런스가 많은 Flask-Bcrypt 모듈을 설치하였습니다.

Official Docs : https://github.com/mahenzon/flask-bcrypt

src/modules/bcrpyt.py 를 확인해보면 다음과 같이 두 개의 함수가 구현되어 있습니다.

from flask_bcrypt import Bcrypt

def getBcrypt(app: any) -> Bcrypt:
    """
    FLask 전용 암호화 모듈인 Brypt-Flask 를 이용하였습니다.

    함수 실행시 암호화 모듈이 리턴됩니다.

    공식문서 : https://github.com/mahenzon/flask-bcrypt
    """
    return Bcrypt(app)


def getHashPw(brcypt: Bcrypt, pw: str):
    """
    getBcrypt 함수를 통해서 생성된 Brypt 모듈을 사용하여 암호화 pw 를 생성합니다.

    기존의 내장 함수는 Binary 타입의 변수를 떨구기 때문에,

    decode('ascii) 부분으로 문자열 타입으로 변환하였습니다.
    """
    return brcypt.generate_password_hash('pw').decode('ascii')

jinja2에서 list array변수 참조하는 방법

{% for arr in list %}

{{ arr.name }}
{{ arr.desc }}
{{ arr.option }}
{% endfor %}
이런식으로 list는 배열로 취급해서 arr를 받아오고 arr를 리스트로 취급해서 사용한다.

네스프레쏘 사이트 웹크롤링해서 값들 Mongodb에 저장

작성자 란에 오류가 발생하여 다른 사람으로 변경되어 있습니다.
원 작성자는 JeungHoSub 님이십니다.

웹개발 종합반 강의 중 웹크롤링 부분 다시 보면서 따라하고 있는데,

coffees = soup.select('#PLPListContainer > div')

for coffee in coffees:
a = coffee.select_one('div.cn_card__image > a > img')
if a is not None:

아직 이 정도고 더 보완하겠습니다~


    • 커피 값 셀렉터 -

[커피_이름]

#PLPListContainer > div:nth-child(6) > nb-plp-category > article > nb-container:nth-child(2) > section > div > div > div.cb-plp-category--center > div > nb-plp-product-card:nth-child(7) > div.cn_card__content > h3 > a

[커피_설명]

#PLPListContainer > div:nth-child(6) > nb-plp-category > article > nb-container:nth-child(2) > section > div > div > div.cb-plp-category--center > div > nb-plp-product-card:nth-child(7) > div.cn_card__content > p

[용량]

#PLPListContainer > div:nth-child(6) > nb-plp-category > article > nb-container:nth-child(2) > section > div > div > div.cb-plp-category--center > div > nb-plp-product-card:nth-child(7) > div.cn_card__content > h3 > p.ml-sizes

[강도]

#PLPListContainer > div:nth-child(6) > nb-plp-category > article > nb-container:nth-child(2) > section > div > div > div.cb-plp-category--center > div > nb-plp-product-card:nth-child(7) > div.cn_card__content > nb-intensity > div > div.intensity

[산미]

#PLPListContainer > div:nth-child(6) > nb-plp-category > article > nb-container:nth-child(2) > section > div > div > div.cb-plp-category--center > div > nb-plp-product-card:nth-child(7) > div.cn_card__content > nb-intensity > div > div.acidity

[가격]

#PLPListContainer > div:nth-child(6) > nb-plp-category > article > nb-container:nth-child(2) > section > div > div > div.cb-plp-category--center > div > nb-plp-product-card:nth-child(7) > div.cn_card__content > div > div > p.cn_card__priceWrapper--current > span

[캡슐 수]

#PLPListContainer > div:nth-child(5) > nb-plp-category > article > nb-container:nth-child(2) > section > div > div > div.cb-plp-category--center > div > nb-plp-product-card:nth-child(7) > div.cn_card__content > div > div > p.cn_card__priceWrapper--items.showSleeve

Flask 사진 업로드 문제

flask가 html이나 css에서 내부 파일인 사진을 올리려고하면 오류가 나오는데
해결방법은 서버에서 상대 주소로 사진을 보내서 쓰는것이다.

회원가입/로그인 기능 구현

/api/join 에서의 회원 가입 기능을 구현하고 있습니다.

  • [✅][데이터 형 파싱]
  • [❌][매개변수 유효성 검사]
  • [✅][중복값 검사]
  • [✅][값 생성]
  • [❌][분기별 반환값 제어]

기술 문서 리스트 `GitHub 문법`, `트러블 슈팅`, `Pyhton 구현 설명`

원문 링크 > Click

  • 기술 문서
    • Github 문법 > Click
    • Github 커밋 규칙 > Click
    • Jinja2 설명 > Click
    • Troulbe 이슈 리스트 > Click
      • Git 사용 어려움 > Click
      • Git pull 할 때마다, Python 인터프리터 연결이 해제되는 경우 > Click
      • Nespresso 사이트 크롤링 거부 > Click
      • 팀원들 간에 특정 변수가 달라져야 했던 이유 > Click
      • MongoDB Atlas 함수가 작동하지 않았던 경우 > Click
      • PyJwt.decode 가 AWS 에서만 에러가 일으키는 경우 > Click
    • Javascript 함수 설명
    • Pyhton 구현 설명
  • 프로젝트 기간 : 2022-07-11 ~ 2022-07-14 (4일 간)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.