Skip to content

MUSTMIIZ11/chameleon

Repository files navigation

Chameleon: Course Project of MIIZ11 Software Engineering

Owner: Lulin Deng, Kan Ni, Zhiyao Xie

example workflow codecov


It is a website of create your own character graph in books. Currently under active development...

!!! Notice to the developers !!! :

Please commit changes to your own branch, and pull request.

Do not directly commit to the main branch.

TODO LIST:

Welcome page

Button

  • Logo: 主页上的logo跳转主页(index.html)

  • community: 主页community主页跳转到community.html

  • tools: tools按钮跳转login.html

  • bookshelf: 跳转顺序:bookshelf.html->login.html->bookshelf.html

  • get start: 跳转顺序:login.html —> community.html

Login page

Button

  • Sign in:数据库记录三条登陆信息

  • Sign up:注册

Community page

Button

  • Logo: 跳转到index.html

  • community: 跳转到community.html

  • tools: 跳转顺序:login.html —> tools.thml

  • bookshelf: 跳转顺序login.html —> bookshelf.html

Tools page

  • upload botton: 点击upload,作品发布到社区

  • save: 点击save,存到本地

  • share:点击share,生成二维码,扫码可以下载到手机(方便pre的时候show一下

Bookshelf page

  • 时间不够这个page就删了吧要不... wait for version 2.0

How to develop 进行本地开发

# 1.安装项目依赖
# cd到chameleon项目下
python -m pip install -r requirements
# 运行服务
# export DJANGO_ENV=devlopment 设置了环境变量,通过该环境变量,我们的配置使用了远程mysql数据库
export DJANGO_ENV=devlopment && python manage.py runserver 8080

# export DJANGO_ENV="" 将DJANGO_ENV置空,通过该环境变量,配置使用本地sqlite
export DJANGO_ENV="" && python manage.py runserver 8080

# 如果有新的app创建,并且要更新数据库,这时候需要执行下面的命令
python manage.py migrate

# 进行单元测试 Unit test command
export DJANGO_ENV="test" && python ./manage.py test
export DJANGO_ENV="test" && python ./manage.py test tools

# Converage test command
export DJANGO_ENV="test" && coverage run --source='.' manage.py test&& coverage xml
# 本地查看coverage报告的命令
coverage report -m

Useful commands

python manage.py startapp xxx  # 创建一个app 名字叫"xxx"


# 创建tools app,会在项目根目录下面创建tools目录
python manage.py startapp tools

# 如果有新的app创建,并且要更新数据库,这时候需要执行下面的命令
python manage.py migrate

管理员界面:http://127.0.0.1:8080/admin/   账号admin 密码admin

Project Online Address: http://159.75.82.228:9090/
JENKINS: http://159.75.82.228:8080/job/chameleon/

# docker commands
# docker run --name mysql -v mysql-volume:/var/lib/mysql -e MYSQL_DATABASE=chameleon_db_dev -e MYSQL_ROOT_PASSWORD=chameleon -p 3306:3306 -d mysql
# sudo docker run --name  "$RUN_NAME" -v /home/ubuntu/img/img:/code/chameleon/static/map_img  -p 9090:9090 -d"$CONTAINER"

Database Design

User

Attribute Type KEY Whether can be NULL Comments
id int PRIMARY KEY No Auto increase primary key
username char(128) No user name
password varchar(255) No password set by user
createtime datetime Yes account create time

Map

Attribute Type KEY Whether can be NULL Comments
id int PRI No Auto increase key
map_name char(128) No map name
map_url text No map url
user_id int Yes user id(indicate which user create this map)
like int No The likes this map get
createtime datetime Yes Creation time

TroubleShooting

遇到数据库表冲突的问题解决方案:
mysql -uroot -p -h 159.75.82.228
#password: chameleon
DELETE FROM django_migrations WHERE app = 'community'
DROP table communicy;
python manage.py makemigrations
python manage.py migrate;

Project Workflow

New Branch(Feature/BugFix/Main) -> Code Review(Pull Requests) -> Continuous Integration(Github Actions) -> Continuous Deployment(Github webook + Jenkins)

Workflow

Load Test

https://github.com/nikan1996/Webenchmark is similar to Apache Benchmark , use it to make a test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •