# Lottery program
Annual dinner lottery program, 3D sphere raffle, support for configuration of prize information, import participants information by `Excel`, and export lottery results by `Excel`
If programm is helpful for youððð, it will be greatful to comment us withâ**star**â ððððð¥°ððð
[ç¹å»è·³è½¬è³ä¸æ使ç¨ææ¡£](https://github.com/moshang-xc/lottery/blob/master/README-ZH_CN.MD)
> Try it now: [https://moshang-xc.github.io/lottery/](https://moshang-xc.github.io/lottery/)
## Technology Stack
Technology stack: Node + Express + Three.js
Server: Express + Node
Web Page: Three.js, References to the official 3D example of `Three.js`
## Function Description:
1. The result can ben save and downloaded to excel synchronouslyð
2. The winner will not participate in the drawing, and the drawing person can be drawn again if he/she not on siteð
3. Refresh or trun off the server will save the winner data and will not resrt the lottery data, only by click the reset button on the page can the lottery data be resetð§§
4. The number of prizes is able to configureð
5. After all the prizes have been drawn, you can continue to draw special prizes(For example:Red pockets, additional prizes, etc). By default, one is extracted at onceð§¨
## Preview
> Try it now: [https://moshang-xc.github.io/lottery/](https://moshang-xc.github.io/lottery/)
![lottery.gif](https://raw.githubusercontent.com/moshang-xc/blog/master/share/lottery.gif)
![index.jpg](https://raw.githubusercontent.com/moshang-xc/blog/master/share/index.jpg)
![start.jpg](https://raw.githubusercontent.com/moshang-xc/blog/master/share/start.jpg)
![end.jpg](https://raw.githubusercontent.com/moshang-xc/blog/master/share/end.jpg)
## Install
```
git clone https://github.com/moshang-xc/lottery.git
cd lottery
# Server plugin installation
cd server
npm install
# Front-end plugin installation
cd ../product
npm install
# Package
npm run build
# Running
npm run serve
# Developing & debugging
npm run dev
```
## Directory Structure
```
Lottery
âââ product
â âââ src
â â âââ lottery
â â â âââ index.js
â â âââ lib
â â âââ img
â â âââ css
â â âââ data
â âââ package.json
â âââ webpack.config.js
âââ server
â âââ config.js
â âââ server.js
â âââ package.js
```
> 1. product is Front-end page directory
> 4. server is Server directory
> 5. config is Profile for prize information
## Configuration Information
### Lottery personnel list information configuration
The lottery list information is in the **`server/data/user.xlsx`** file, information could only fill in base on the format, file name and title are not able to revise
### Prize information configuration
Prize information is filled in the **server/config.js** file, and the file name cannot be modified.
**The configuration of the prizes is described as follows:**
| Parameter | Value Type | Description |
| --------- | ---------- | ------------------------------------------------------------ |
| type | Number | Type of prize, unique identifier, 0 is the placeholder for the default special prize, other prizes cannot be used |
| count | Number | Prizes amount |
| text | String | Prizes name |
| title | String | Prizes description |
| img | String | Image URL of the prize, image is under**img** catalog |
```js
// Prize information, the first item is reserved and cannot be modified. Other items can be modified as required
// Prize in
let prizes = [{
type: 0,
count: 1000,
title: "",
text: "Special Price"
},
{
type: 1,
count: 2,
text: "Special Price"
title: "Mystery jackpot"
img: "../img/secrit.jpg"
},
{
type: 2,
count: 5,
text: "First prize"
title: "Mac Pro",
img: "../img/mbp.jpg"
}
...
];
```
### The configuration of the number of prizes drawn each time
**EACH_COUNT**It is used to configure the number of lottery draws each time, which corresponds to the prizes one by one. For example, the number of lottery draws corresponding to the above prize configuration is as followsï¼
```js
const EACH_COUNT = [1, 1, 5];
```
Configuration above means the order of the number of prizes to be drawn at one time isï¼one special prize per time, one grand prize per time and 5 first prize per time.
### Enterprise Identity Configuration
This identification is used to display on the lottery card.
```js
const COMPANY = "MoShang";
```
## Docker Deployment plan
### Summary
This project is support to deploy by Docker. Docker is a platform with lightweight containerization, allows you to quickly deploy, test and run the applications. This text will introduce how to deploy the project by Docker.
### System Requirement
Before you use the Docker to deploy the project, you need to ensure you have download below software:
- Docker (Please refer Docker official file to get the installation instructions)
- Docker Compose
### Installation
1. Download and unzip the source code for the project
2. Access the project directory after unzipped the file
3. Execute the following command to build the Docker mirror image:
```
./build.sh [TAG]
```
It will use Dockerfile to set up the Docker mirror image named `lottery:[TAG]`. If no tag is specified, the 'latest' tag is used by default
4. Execute the following command to run the local container:
```
./dev.sh [TAG]
```
This will start the container and deploy the application in the Docker container. You can test loacally to ensure all running fulently.
Please be pay attention that all applicaiton in the container will monitor port 8888 and port 443.
5. Execute the following command to tag the Docker mirror image and push it to the remote Docker repository
```
./tagpush.sh [TAG]
```
It will tag the Docker mirror image and push it to the remote Docker repository, please build up your repo at https://hub.docker.com/ if you want to us Docker official hub.
6. Ensure it has a file named `docker-compose.yml` and add below information:
```
version: '3.8'
volumes:
lottery_log:
services:
lottery:
container_name: lottery
expose:
- 8888
ports:
- "28458:8888"
- "443:443"
volumes:
- "lottery_log:/var/log"
image: "panda1024/lottery:[TAG]"
restart: always
```
Kindly take note that `[TAG]` should be replaced with the name of the mirror image you pushed to the Docker repository
7. Run the following command in the project directory on the server to deploy the application using Docker Compose:
```
docker-compose up -d
```
This will start a Docker Compose stack and deploy the project into it. Note that port 8888 and port 443 of the container are mapped to port 8888 and port 443 on the server. If you wish to use a different port, please change the `docker-compose.yml` file accordingly.
## License
MIT
没有合适的资源?快使用搜索试试~ 我知道了~
基于 Express + Three.js的 3D 球体抽奖程序
共43个文件
js:17个
jpg:6个
json:5个
需积分: 0 3 下载量 60 浏览量
2024-09-04
11:18:44
上传
评论
收藏 2.4MB ZIP 举报
温馨提示
年会抽奖程序,基于 Express + Three.js的 3D 球体抽奖程序,奖品,文字,图片,抽奖规则均可配置,抽奖人员信息Excel一键导入,抽奖结果Excel导出,给你的抽奖活动带来全新酷炫体验 可将抽奖结果进行保存实时下载到 excel 中 已抽取人员不在参与抽取,抽中的人员不在现场可以重新抽取 刷新或者关掉服务器,会保存当前已抽取的数据,不会进行数据重置,只有点击界面上的重置按钮,才能重置抽奖数据 每次抽取的奖品数目可配置 抽取完所有奖品后还可以继续抽取特别奖(例如:现在抽取红包,追加的奖品等),此时默认一次抽取一个 安装 cd lottery # 服务端插件安装 cd server npm install # 前端插件安装 cd ../product npm install # 打包 npm run build # 运行 npm run serve # 开发调试 npm run dev
资源推荐
资源详情
资源评论
收起资源包目录
lottery-master.zip (43个子文件)
lottery-master
README-ZH_CN.MD 6KB
LICENSE 1KB
docker-compose.yml 247B
Dockerfile 946B
tagpush.sh 96B
.gitignore 45B
product
webpack.config.js 2KB
src
lib
three.min.js 539KB
ajax.js 1KB
CSS3DRenderer.js 7KB
tween.min.js 5KB
TrackballControls.js 16KB
lottery
canvas.js 3KB
prizeList.js 9KB
config.js 1KB
index.js 20KB
index.css 9KB
data
music.mp3 1.96MB
img
mbp.jpg 7KB
secrit.jpg 12KB
ipad.jpg 44KB
edifier.jpg 23KB
huawei.png 49KB
kindle.jpg 42KB
spark.jpg 37KB
css
animate.min.css 17KB
index.html 1KB
webpack.dev.js 399B
package.json 1KB
package-lock.json 355KB
postcss.config.js 73B
README.MD 7KB
server
.vscode
launch.json 561B
data
users.xlsx 14KB
server.js 6KB
package.json 688B
package-lock.json 86KB
config.js 1KB
index.js 84B
test.js 729B
help.js 3KB
build.sh 125B
dev.sh 146B
共 43 条
- 1
资源评论
码农网络科技
- 粉丝: 3
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 在不同操作系统下编译Android源码需要更改一些Android源码的配置项,脚本用于自动化更改配置项.zip
- 基于vue3的春节烟花许愿代码.zip学习资料
- YoloV8.2.10的YOLOV8的Segmentation权重文件
- YoloV8.2.10的YOLOV8的Pose权重文件
- 2002 年 Python 周模板 - 4 月 25 日至 29 日 LINUXTips.zip
- 烟花爆炸效果学习代码.zip学习资料开发
- 微信抢红包助手.zip学习资料参考资料程序
- YoloV8.2.10的YOLOV8的Classification权重文件
- 探索Python科学计算:SciPy库的深入指南
- 深入解析栈溢出:原因、影响与解决方案
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功