Giter Site home page Giter Site logo

timeline's Introduction

Timeline

Preparation / Configuration

分别复制 config/client-template.tsconfig/server-template.tsconfig/client.tsconfig/server.ts,配置您的客户端和服务端。

Bun

本项目基于 Bun 开发,您需要全局安装 Bun:

npm install -g bun

PostgreSQL

本项目依赖于 PostgreSQL 数据库。

编辑 config/server.ts,填写连接到 PostgreSQL 数据库的配置信息:

export const serverConfig: ServerConfig = {
  database: {
    user: 'your_postgresql_user',
    password: 'your_postgresql_password',
    host: '127.0.0.1',
    port: 5432,
    database: 'timeline',
  },
}

其中,数据库需要手动创建。例如使用 psql 工具创建名为 timeline 的数据库:

CREATE DATABASE timeline;

开发环境下将使用添加 _dev 后缀名的数据库。因此,如果您需要进行二次开发,还应当创建名为 timeline_dev 的数据库:

CREATE DATABASE timeline_dev;

Bilibili Collections

添加需要同步的 Bilibili 收藏夹:

export const serverConfig: ServerConfig = {
  services: [
    {
      type: SyncServiceType.BILIBILI_COLLECTION,
      id: 'MyBilibiliCollections',
      label: 'My Bilibili Collections',
      mediaId: '75618059',
    },
  ],
}

Feed

添加需要同步的站点 Feed:

export const serverConfig: ServerConfig = {
  services: [
    {
      type: SyncServiceType.FEED,
      id: 'MyBlog',
      label: 'My Blog Articles',
      syntax: 'atom',
      url: 'https://blog.example.com/atom.xml',
    },
  ],
}

Github Issue Comment

需要提供 Github Personal Access Token(在此创建):

export const serverConfig: ServerConfig = {
  githubPersonalAccessToken: 'ghp_yourGithubPersonalAccessToken',
}

添加需要同步评论的 Issue:

export const serverConfig: ServerConfig = {
  services: [
    {
      type: SyncServiceType.GITHUB_ISSUE_COMMENT,
      id: 'GithubIssueComments',
      label: 'My Github Issue Comments',
      owner: 'github_repo_owner',
      repo: 'github_repo_name',
      issueNumber: 1,
    },
  ],
}

Other Configurations

export const serverConfig: ServerConfig = {
  /** 服务端监听端口 */
  listeningPort: 4000,
  /** 同步 Timeline 信息的 Cron 规则;这里表示每小时的 0 和 30 分钟执行一次同步操作 */
  syncInterval: '*/30 * * * *',
}

Development

Client

bun run dev:client

Server

bun run dev:server

Deployment

Client

bun run build:client

Server

bun run start:server

timeline's People

Contributors

lolipopj avatar

Stargazers

 avatar

Watchers

 avatar

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.