这是一个展示全球电影票房排行榜的网页应用,基于60s项目提供的60s电影 API和TMDB API,实时展示电影数据和精美海报。
This is a web application that displays global movie box office rankings, utilizing the 60s Movie API from the 60s Project and TMDB API to showcase real-time movie data and beautiful posters.
- 🔄 实时显示全球电影票房排行榜 | Real-time global box office rankings
- 🖼️ 使用TMDB API获取高质量电影海报 | High-quality movie posters from TMDB API
- 📱 响应式设计,适配各种设备 | Responsive design for all devices
- ⏱️ 自动定时刷新数据 | Automatic data refresh
- 🔒 后端代理服务器,保护API密钥安全 | Backend proxy server for API key security
- 效果截图
- 🌐 前端 | Frontend:原生JavaScript (ES6+)、HTML5 & CSS3
- 🖥️ 后端 | Backend:Node.js、Express
- 🔌 API:TMDB API、60s项目API (来自60s项目) | 60s Movie API (from 60s Project)
- 📦 依赖管理 | Package Management:npm
- 🟢 Node.js 14.x 或更高版本 | Node.js 14.x or higher
- 📦 npm 6.x 或更高版本 | npm 6.x or higher
-
克隆或下载本项目到本地 | Clone or download this project
git clone https://github.com/nodesire7/box-office-top.git cd box-office-top -
安装依赖 | Install dependencies
npm install
-
创建配置文件 | Create configuration file
# 创建.env文件并添加TMDB API密钥 # Create .env file and add TMDB API key echo "TMDB_API_KEY=YOUR_TMDB_API_KEY_HERE PORT=3000 API_BASE_URL=https://api.example.com" > .env
-
启动服务器 | Start server
npm start
-
访问应用 | Access application 在浏览器中打开 | Open in browser: http://localhost:3000
-
安装Node.js和npm | Install Node.js and npm
- 访问 | Visit Node.js官网
- 下载并安装最新LTS版本 | Download and install latest LTS version
- 安装时勾选自动安装npm和添加到PATH选项 | Select npm installation and PATH addition
-
按照通用步骤操作 | Follow general steps
-
安装Node.js和npm | Install Node.js and npm
# 使用nvm安装(推荐)| Using nvm (recommended) curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash source ~/.bashrc nvm install --lts
-
按照通用步骤操作 | Follow general steps
-
PM2后台运行(可选)| PM2 background running (optional)
npm install -g pm2 pm2 start server.js --name "movie-box-office"
- 安装Node.js管理器 | Install Node.js manager
- 创建Node项目 | Create Node project
- 上传或克隆项目 | Upload or clone project
- 配置环境变量 | Configure environment variables
- 设置项目参数 | Set project parameters
- 项目路径 | Project path
- 启动文件 | Start file: server.js
- 端口 | Port: 3000
- 运行配置 | Runtime config
- 安装Node.js应用 | Install Node.js application
- 配置项目环境 | Configure project environment
- 上传项目文件 | Upload project files
- 配置环境变量 | Configure environment variables
- 设置应用参数 | Set application parameters
- 访问 | Visit TMDB官网
- 注册并登录 | Register and login
- 申请API密钥 | Apply for API key
- 配置项目 | Configure project
特别感谢60s项目提供的电影票房API支持。
Special thanks to the 60s Project for providing the Maoyan Movie API support.
-
创建环境变量文件 | Create environment file
# 创建.env文件 | Create .env file cat > .env << EOL PORT=3000 API_BASE_URL=your_api_base_url TMDB_API_KEY=your_tmdb_api_key EOL
-
启动服务 | Start service
docker-compose up -d
-
访问应用 | Access application 在浏览器中打开 | Open in browser: http://localhost:3000
-
构建镜像 | Build image
docker build -t movie-box-office . -
运行容器 | Run container
docker run -d \ -p 3000:3000 \ -e PORT=3000 \ -e API_BASE_URL=your_api_base_url \ -e TMDB_API_KEY=your_tmdb_api_key \ --name movie-box-office \ movie-box-office
-
访问应用 | Access application 在浏览器中打开 | Open in browser: http://localhost:3000
