Code Monkey home page Code Monkey logo

cloudpress's Introduction

CloudPress: 基于云开发的开源博客系统

快速开始

  1. 创建腾讯云账号: 前往腾讯云官网

  2. 开通 CloudBase:前往TCB 控制台

  3. 新建云开发环境:根据需要选择付费策略,每个用户都可以创建「免费环境」

  4. 开通内容管理:进入新创建的云开发环境,开通「内容管理」,等待 5 分钟左右

  5. 获取云环境 ID、访问密钥:进入新创建的云开发环境,获取环境 ID;进入访问密钥,获取SecretIdSecretKey

  6. 环境搭建

  • 全局安装 CloudBase CLI 和 Next.js
npm i -g @cloudbase/cli next
  • 从 GIT 下载代码
git clone https://github.com/dongyuanxin/cloudpress.git
  1. 设置配置文件
cd cloudpress/
touch .env

配置文件格式:

ENV_ID=你的云环境ID
TCB_SECRET_ID=你的访问密钥SecretId
TCB_SECRET_KEY=你的访问密钥SecretKey

复制一份配置文件到frontend/

cp .env frontend/.env
  1. 初始化数据表
npm run login # CLI 登录 CloudBase
npm run init:db # 初始化数据表结构,包括文章、通知、全局配置等
  1. 部署发布
npm run deploy:frontend
  1. 本地开发
cd ./frontend
npm run dev

cloudpress's People

Contributors

dependabot[bot] avatar dongyuanxin avatar pandaiiz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cloudpress's Issues

Cloudbase部署

按照文档步骤部署失败,命令不对。我找了官方的部署文档也部署失败了,这个项目应该如何部署?

Windows下的一些问题

  1. 需要提前安装一下@cloudbase/cli 和 next

$ npm i -g @cloudbase/cli next

  1. 三个脚本都运行失败了,修改了一下兼容Windows下的git操作

"scripts": {
"commit": "git-cz",
"init:db": "node ./bin/init-db",
"login": "sh ./bin/login.sh",
"deploy:frontend": "sh ./bin/deploy-frontend.sh",
"zip:service": "cd service/ && zip service.zip -r ./ -x node_modules/\* dist/\* test/\* && cd -"
},

  1. frontend下运行npm start想本地调试,服务跑不起来

Support api ratelimit

应用场景

对某些耗资源的 API 进行保护

实现思路

  • 基于缓存模块 #20
  • 框架层使用Guard

Support process cache

应用场景

  • 耗时长,消耗大的API。例如:根据关键词查询API
  • 不稳定的API
  • 对数据实时性要求不高的API。例如:访客量和浏览量

实现思路

  • 底层使用LRU
  • 框架层使用module进行封装
  • 作用域:针对不同Service,生成独有的缓存实例,防止不同service的缓存键重复冲突

Init CMS and Cloudpress collections' schema

Fixs

  • 集合名称新增 cloudpress + 数据表版本号: cloudpress-<collectionVersion>-<collectionName>

Features

  • cms数据配置集合 tcb-cms-contents
collectionName<string>
createTime<Date>
updateTime<Date>
label<string>
fields<FiledSchema[]>

FiledSchema:

fieldLabel: string
filedName: string
fileType: string
hidden?: boolean
isRequired: boolean
helpText?: string
  • 文章数据集合 cloudpress-v1-passages

  • 通知数据集合 cloudpress-v1-notices

  • 页面信息集合 cloudpress-v1-infos

  • 网站信息集合 cloudpress-v1-site-infos

Nestjs Server deployed on cloudfunction can't be updated

Fixs

  • 云函数部署Nestjs server后,无法更新

Solutions

  • 方案1:在云函数新架构下的环境中尝试

  • 方案2: 回退策略

    • 创建:cli部署
    • 更新:
      1. cli删除存量函数
      2. cli新建同名
  • 方案3: 容器化部署(Serverless 云应用)

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.