Git Product home page Git Product logo

chameleon's Introduction

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

chameleon's People

Contributors

lulindeng avatar nikan1996 avatar xzhiyao avatar 735946969 avatar kanni2022 avatar

Stargazers

 avatar

Watchers

 avatar

chameleon's Issues

添加测试支持

  • 后端单元测试

  • 前端单元测试

  • 前端自动化测试

  • 后端手动测试

  • 前端手动测试

Task: Support common navigation bar

任务描述: 不同的页面有共同的导航栏, 如果在纯粹的html 下,我们需要复制粘贴 几份导航栏的代码到不同页面中。

任务目标: 一份导航栏的代码 Navigation_code.html , 每个页面只需要插入这份代码就行 (类似js,css的插入)

任务方法: 使用Django的Template。

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.