Code Monkey home page Code Monkey logo

land-live-api's Introduction

Land Live+ MVP (Django Backend)

๐Ÿ‘‹ Welcome to Land Corporation's first MVP!

This is a Minimal Viable Product (MVP) that consists of reservation system and KakaoTalk notification features along with visual guide line to help users understand the work flow. Main purpose of this MVP is to test whether there exists market needs for live-streaming tour for Real Estate while investing as minimum development as possible.

Note that this is a MVP which does not contain any real-time streaming feature. Actual real-time streaming feature will be developed on next cycle; prototyping.


Background

Please refer here


Installation

Use the package manager yarn to install land-live-web

pip install -r requirements


Usage

python manage.py migrate
python manage.py runserver

And open http://localhost:8000/


Look & Feel

To see how it looks, please visit ๐Ÿ‘‰ landcorp.io


Django Admin

  • Django Admin page for Tour list ORM

  • Django Admin page for Tour detail


Troubleshooting

1. Mysql Insert throws error when sending emoji in POST payload

Problem

    err.raise_mysql_exception(self._data)
  File "/Users/jinj/.virtualenvs/landapp/lib/python3.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
    raise errorclass(errno, errval)
django.db.utils.DataError: (1366, "Incorrect string value: '\\xF0\\x9F\\x98\\x8A\\xF0\\x9F...' for column 'content' at row 1")

Solution

  • MySQL DB Setting
    • utf8mb4_unicode_ci, utf8mb4

  • Table Setting

    • Room
    • Feedback ALTER TABLE <table_name> CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
  • Django Setting

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'OPTIONS': {
            'charset': 'utf8mb4',
            'use_unicode': True, },
    }

2. AWS ElasticBeanstalk: Custom Domain + HTTPS setting

Background

After done with AWS EB basic setup, url will look like http://land-liveplus-env-prod.ap-northeast-2.elasticbeanstalk.com/. This is the url with no TLS enabled that AWS just assigned.

We Need to apply custom domain + TLS enabled like https://api.landcorp.io, https:/dev-api.landcorp.io

Solution

3. AWS ElasticBeanstalk: RDS for Production setup

Background

  • EB+RDS automatic setup is not suitable for production mode.

  • It isn't ideal for a production environment because it ties the lifecycle of the database instance to the lifecycle of your application's environment.

  • You need to decouple RDS This enables you to connect multiple environments to a database, terminate an environment without affecting the database, and perform seamless updates with blue-green deployments.

Solution

  • Please refer to AWS docs -> https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/rds-external-defaultvpc.html

  • Create PostgreSql database

    • You will need to create only default security group but this will be changed soon
  • Create new Security Group

    • Go to the newly created database, click VPC security groups in Security tab
    • Below is the Inbound rules for automatically created of EB <> RDS. Refer this to make modification

  • Please be cautious when setting up Source, numerous Security groups are located in one EB/EC2. Please refer to the existing Security groups of EC2 and their connection rule in land-liveplus-env-dev to configure.
    • In on sentence, just connect security group ID of EC2.
  • For Type setting -> PostgreSql should be setup, not All TCP
  • Remove default in RDS security group and add new
  • RDS security group โ†’ EB environment
    • Refer to the doc. Please be catious that this is to add existing RDS to security group
  • Append RDS related environment variables
    • Please refer to the doc. Do it at EB configuration
  • Done!


Guide

Please refer here

Contributing

  • All rights reserved to Land Corporation, Inc.
  • Main developer: @JinJis


License

MIT

land-live-api's People

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.