👋 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.
Please refer here
Use the package manager yarn to install land-live-web
pip install -r requirements
python manage.py migrate
python manage.py runserver
And open http://localhost:8000/
To see how it looks, please visit 👉 landcorp.io
- Django Admin page for
Tour list
ORM
- Django Admin page for
Tour detail
1. Mysql Insert throws error when sending emoji in POST payload
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")
- 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
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
- (Prerequisite) EB + PostgreSql (not decoupled) Setup Complete
- Custom Domain
record routing setup
- https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-beanstalk-environment.html#routing-to-beanstalk-environment-create-resource-record-set
- Since we can use
Region
(if using the latest EB) alias can be mapped - Create
hosted zone
atRoute53
- dev-api.landcorp.io --> A type
- ElasticBeanstalk's existing URL as
value
- (if already done, skip) Change Name Servers in Google Domains to that of Route53
- Check
dev-api.landcorp.io
- Need to wait for about 30mins
- HTTPS Setup
Please refer https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/configuring-https-elb.html
- Register wildcard certificate for at
certificate manager
(*.landcorp.io)- https://ap-northeast-2.console.aws.amazon.com/acm/home?region=ap-northeast-2#/firstrun/
- both
landcorp.io
,*.landcorp.io
need to be created - CNAME will be popped up. Just register to Route53 by clicking button.
- In EB GUI, setup https listener in Application Load Balancer section
- Please refer to the docs above
- http → https redirect setup
- https://aws.amazon.com/premiumsupport/knowledge-center/elb-redirect-http-to-https-using-alb/
- Don't change at EB console. Please go to EC2 console, load balancer panel and change
Default Action
- Register wildcard certificate for at
- Success!
3. AWS ElasticBeanstalk: RDS for Production setup
-
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.
-
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
- You will need to create only
-
Create new
Security Group
- Go to the newly created database, click
VPC security groups
inSecurity
tab - Below is the Inbound rules for automatically created of EB <> RDS. Refer this to make modification
- Go to the newly created database, click
- Please be cautious when setting up
Source
, numerousSecurity groups
are located in one EB/EC2. Please refer to the existing Security groups of EC2 and their connection rule inland-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
- Please refer to the doc. Do it at
- Done!
Please refer here
- All rights reserved to Land Corporation, Inc.
- Main developer: @JinJis