{"id":44536928,"url":"https://github.com/betterde/ecms","last_synced_at":"2026-02-13T18:50:16.232Z","repository":{"id":42952763,"uuid":"242105593","full_name":"betterde/ecms","owner":"betterde","description":"E-Commerce Management System","archived":false,"fork":false,"pushed_at":"2025-09-15T01:02:07.000Z","size":4985,"stargazers_count":2,"open_issues_count":10,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-15T02:43:33.132Z","etag":null,"topics":["ecms","element-ui","nginx"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/betterde.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-21T09:46:31.000Z","updated_at":"2025-09-15T00:58:43.000Z","dependencies_parsed_at":"2022-08-19T07:52:00.426Z","dependency_job_id":null,"html_url":"https://github.com/betterde/ecms","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/betterde/ecms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betterde%2Fecms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betterde%2Fecms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betterde%2Fecms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betterde%2Fecms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/betterde","download_url":"https://codeload.github.com/betterde/ecms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/betterde%2Fecms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29414285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecms","element-ui","nginx"],"created_at":"2026-02-13T18:50:11.299Z","updated_at":"2026-02-13T18:50:16.225Z","avatar_url":"https://github.com/betterde.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://res.cloudinary.com/betterde/image/upload/v1588045292/github/projects/ecms/signin-view-no-border.png\" width=\"100%\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://res.cloudinary.com/betterde/image/upload/v1588045796/github/projects/ecms/dashboard.png\" width=\"100%\"\u003e\n\u003c/p\u003e\n\n![ECMS](https://github.com/betterde/ecms/workflows/ECMS/badge.svg)\n\n## ECMS\n\n一个面向代购的简单电商管理系统。前端采用 [Vue Cli 3](https://cli.vuejs.org/)搭建的开发环境，UI 使用的是 [Element UI](https://element.eleme.io/)，统计图表使用 [Antv G2](https://g2.antv.vision/en/)，后端 API 采用 Laravel 实现。\n\n- [x] 数据分析\n- [x] 订单管理\n- [x] 商品信息管理\n- [x] 库存管理\n- [x] 客户信息管理\n- [x] 采购订单导出 Excel\n- [X] 集成 Google 登录 (服务器和客户端都能访问 Google 服务器的情况下可以开启)\n- [x] 邀请注册\n- [x] 操作日志\n- [x] 客户下单流程\n- [] 微信小程序\n- [] 客户管理后台\n- [] 代理商管理\n- [] 支付系统\n\n## API\n\n```bash\ncomposer install --optimize-autoloader --no-dev # 安装项目依赖\n\ncp .env.example .env # 复制一份配置文件模板，然后根据实际环境修改配置文件\n\nphp artisan config:cache # 优化配置加载\n\nphp artisan route:cache # 优化路由加载\n\nphp artisan migrate # 迁移数据表信息\n\nphp artisan jwt:secret # 生成 JWT Secret\n```\n\n## 创建系统管理用户\n\n```bash\nphp artisan create:user\n\n Please enter your name:\n \u003e Admin\n\n Please enter your email:\n \u003e admin@example.com\n\n Please enter your password:\n \u003e \n\n Please enter your password again:\n \u003e \n\n Do you wish to continue? (yes/no) [no]:\n \u003e yes\n\nUser created successfully!\n+--------------------------------------+--------+---------------------+---------------------+\n| ID                                   | Name   | Email               | Created at          |\n+--------------------------------------+--------+---------------------+---------------------+\n| 1f8db157-ed9b-4886-9776-0e1bdd2fb2be | Admin  | admin@example.com   | 2020-05-15 14:48:46 |\n+--------------------------------------+--------+---------------------+---------------------+\n```\n\n## Web\n\n如果需要将 SPA 和 API 分开部署，需要注释 `routes/web.php` 中的路由：\n```php\nRoute::view('{path?}', 'index')-\u003ewhere('path', '[\\/\\w\\.-]*');\n```\n\n\n这里并没有采用 Laravel 自带的 Vue 脚手架，也是便于将前端和 Laravel 进行拆分。\n\n```bash\nyarn # 安装依赖\nyarn build # 打包前端资源\n```\n\n如果需要将 Vue SPA 单独部署，只需要将打包后的 `resources/views/index.blade.php` 拷贝到前端资源目录中，并改名为 `index.html`，再将 `public` 目录下生成的 `js,css,fonts` 等目录同时拷贝到前端资源目录中。目录结构如下：\n```\n.\n├── css\n├── favicon-128.png\n├── favicon-16.png\n├── favicon-32.png\n├── favicon-48.png\n├── favicon-64.png\n├── favicon.ico\n├── fonts\n├── index.html\n└── js\n```\n\n## Nginx\n\n```\nserver {\n    listen 80;\n    server_name ecms.example.com;\n    root /example.com/public;\n\n    add_header X-Frame-Options \"SAMEORIGIN\";\n    add_header X-XSS-Protection \"1; mode=block\";\n    add_header X-Content-Type-Options \"nosniff\";\n\n    index index.html index.htm index.php;\n\n    charset utf-8;\n\n    location / {\n        try_files $uri $uri/ /index.php?$query_string;\n    }\n\n    location = /favicon.ico { access_log off; log_not_found off; }\n    location = /robots.txt  { access_log off; log_not_found off; }\n\n    error_page 404 /index.php;\n\n    location ~ \\.php$ {\n        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;\n        fastcgi_index index.php;\n        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;\n        include fastcgi_params;\n    }\n\n    location ~ /\\.(?!well-known).* {\n        deny all;\n    }\n}\n```\n以下是前后端完全分离的 Nginx 配置文件：\n\n```\nserver {\n    listen 80;\n    server_name ecms.example.com;\n    return 301 https://$host$request_uri;\n}\n\nserver {\n    listen 443 ssl http2;\n    server_tokens off;\n    server_name ecms.example.com;\n    ssl_certificate /etc/nginx/cert/fullchain.cer;\n    ssl_certificate_key /etc/nginx/cert/example.com.key;\n\n    # Recommendations from https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html\n    ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;\n    ssl_ciphers '!aNULL:kECDH+AESGCM:ECDH+AESGCM:RSA+AESGCM:kECDH+AES:ECDH+AES:RSA+AES:';\n    ssl_prefer_server_ciphers on;\n    ssl_session_cache shared:SSL:10m;\n\n    # disable any limits to avoid HTTP 413 for large image uploads\n    client_max_body_size 0;\n\n    # required to avoid HTTP 411: see Issue #1486 (https://github.com/docker/docker/issues/1486)\n    chunked_transfer_encoding on;\n\n    add_header Strict-Transport-Security max-age=15768000;\n\n    # OCSP Stapling ---\n    # fetch OCSP records from URL in ssl_certificate and cache them\n    ssl_stapling on;\n    ssl_stapling_verify on;\n\n    ssl_trusted_certificate /etc/nginx/cert/ca-bundle.trust.crt;\n\n    location / {\n        index index.html;\n        root /web/sites/php/ecms/spa;\n        try_files $uri $uri/ /index.html;\n    }\n\n    location /api {\n        index index.php;\n        root /web/sites/php/ecms/api/public;\n        try_files $uri $uri/ /index.php?$query_string;\n    }\n\n    location ~ \\.php$ {\n        root /var/local/web/sites/php/ecms/api/public;\n        fastcgi_pass php-fpm:9000;\n        fastcgi_index index.php;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        include fastcgi_params;\n    }\n}\n```\n\u003e 这个配置文件是基于 Docker 部署的，如果直接在服务器上部署，可以将f `astcgi_pass` 修改为响应的 PHP-FPM 监听地址或 unxi\n\n## Swagger\n\nYAML 文件存放在 `public/swagger/{version}.yaml`，访问 URI: /swagger/{version}。 \n\n\u003e 这里我并没有采用在控制器里写注释，而是直接将 API 写在 YAML 文件中。避免 Controller 过于冗长。\n\n你也在 `RouteServiceProvider` 取消注册 swagger 的路由，来关闭该功能。\n\n## 赞助商\n\n[![jetbrains](https://res.cloudinary.com/betterde/image/upload/v1588046151/github/sponsor/jetbrains.svg)](https://www.jetbrains.com/?from=ecms)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetterde%2Fecms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbetterde%2Fecms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetterde%2Fecms/lists"}