{"id":17516884,"url":"https://github.com/lolipopj/timeline","last_synced_at":"2026-04-10T11:02:24.943Z","repository":{"id":258388314,"uuid":"855096988","full_name":"LolipopJ/timeline","owner":"LolipopJ","description":"What did I do \u0026 say?","archived":false,"fork":false,"pushed_at":"2025-03-14T14:43:05.000Z","size":553,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T22:42:42.168Z","etag":null,"topics":["bun","elysiajs","nextjs","react","tailwindcss","timeline"],"latest_commit_sha":null,"homepage":"https://timeline.towind.fun","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LolipopJ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-10T09:53:22.000Z","updated_at":"2025-03-14T14:43:08.000Z","dependencies_parsed_at":"2025-01-06T08:47:32.793Z","dependency_job_id":null,"html_url":"https://github.com/LolipopJ/timeline","commit_stats":null,"previous_names":["lolipopj/timeline"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LolipopJ%2Ftimeline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LolipopJ%2Ftimeline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LolipopJ%2Ftimeline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LolipopJ%2Ftimeline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LolipopJ","download_url":"https://codeload.github.com/LolipopJ/timeline/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246112638,"owners_count":20725300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bun","elysiajs","nextjs","react","tailwindcss","timeline"],"created_at":"2024-10-20T08:10:30.325Z","updated_at":"2026-04-10T11:02:24.936Z","avatar_url":"https://github.com/LolipopJ.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Timeline\n\n## 前置准备\n\n本项目基于 Bun 开发，服务端依赖于 PostgreSQL 数据库。\n\n全局安装 Bun：\n\n```bash\nnpm install -g bun\n```\n\n分别复制 `configs/client.example.ts` 和 `configs/server.example.ts` 为 `configs/client.ts` 和 `configs/server.ts`，配置您的客户端和服务端。\n\n编辑 `configs/server.ts`，填写连接到 PostgreSQL 数据库的配置信息：\n\n```ts\nexport const serverConfig: ServerConfig = {\n  database: {\n    user: 'your_postgresql_user',\n    password: 'your_postgresql_password',\n    host: '127.0.0.1',\n    port: 5432,\n    database: 'timeline',\n  },\n}\n```\n\n其中，数据库需要手动创建。例如使用 `psql` 工具创建名为 `timeline` 的数据库：\n\n```sql\nCREATE DATABASE timeline;\n```\n\n开发环境下将使用添加 `_dev` 后缀名的数据库。因此，如果您需要进行二次开发，还应当创建名为 `timeline_dev` 的数据库：\n\n```sql\nCREATE DATABASE timeline_dev;\n```\n\n## 配置项目\n\n### 管理员用户\n\n当您以管理员用户登录到站点时，您可以访问所有服务端路由，看到您设为私密的时间线项。配置管理员用户：\n\n```ts\nexport const serverConfig: ServerConfig = {\n  admin: {\n    secretKey: 'change_this_field_to_your_secret_key',\n    accounts: [\n      {\n        username: 'admin_username',\n        password: 'admin_password',\n      },\n    ],\n  },\n}\n```\n\n假设您的站点域名为 `www.timeline.com`，访问 `www.timeline.com?login` 即可唤起登录窗口，输入账号 `admin_username` 和密码 `admin_password` 即可以管理员身份登录到站点。\n\n如果想退出登录，可以访问 `www.timeline.com?logout`，或手动清除站点的 Cookies。\n\n### 同步 Bilibili 收藏夹\n\n添加需要同步的 Bilibili 收藏夹：\n\n```ts\nexport const serverConfig: ServerConfig = {\n  services: [\n    {\n      type: SyncServiceType.BILIBILI_COLLECTION,\n      id: 'MyBilibiliCollections',\n      label: 'My Bilibili Collections',\n      mediaId: '75618059',\n    },\n  ],\n}\n```\n\n### 同步 Bilibili 作品\n\n添加需要同步的 Bilibili 用户上传的创作：\n\n```ts\nexport const serverConfig: ServerConfig = {\n  services: [\n    {\n      type: SyncServiceType.BILIBILI_WORK,\n      id: 'MyBilibiliWorks',\n      label: 'My Bilibili Works',\n      userId: '15487659',\n    },\n  ],\n}\n```\n\n### 同步站点订阅\n\n添加需要同步的站点 Feed：\n\n```ts\nexport const serverConfig: ServerConfig = {\n  services: [\n    {\n      type: SyncServiceType.FEED,\n      id: 'MyBlog',\n      label: 'My Blog Articles',\n      syntax: 'atom',\n      url: 'https://blog.example.com/atom.xml',\n    },\n  ],\n}\n```\n\n### 同步 Github 议题的评论\n\n需要提供 Github Personal Access Token（[在此创建](https://github.com/settings/tokens/new?scopes=repo)）：\n\n```ts\nexport const serverConfig: ServerConfig = {\n  githubPersonalAccessToken: 'ghp_yourGithubPersonalAccessToken',\n}\n```\n\n添加需要同步评论的 Issue：\n\n```ts\nexport const serverConfig: ServerConfig = {\n  services: [\n    {\n      type: SyncServiceType.GITHUB_ISSUE_COMMENT,\n      id: 'GithubIssueComments',\n      label: 'My Github Issue Comments',\n      owner: 'github_repo_owner',\n      repo: 'github_repo_name',\n      issueNumber: 1,\n    },\n  ],\n}\n```\n\n### 同步 QQ 空间说说\n\n同步 QQ 空间说说依赖 **[ffmpeg](https://www.ffmpeg.org/)** 对视频文件进行切片，请确保系统运行内存足够，避免异常跳出。\n\n添加需要同步的 QQ 空间，例如：\n\n```ts\nexport const serverConfig: ServerConfig = {\n  services: [\n    {\n      type: SyncServiceType.QZONE_TALK,\n      id: 'MyQQZone',\n      label: 'My QQ Zone',\n      qqNumber: '408550000',\n      from: new Date('2018-01-01'),\n    },\n  ],\n}\n```\n\n\u003e 访问接口 `/qzone-login` 要求您以管理员身份登录站点。\n\n为了获取请求 QQ 空间说说接口所需的登录态信息，您需要访问服务端的 `/qzone-login?qqNumber=${qqNumber}` 路由，扫码并登录到 QQ 空间。确认登录后，重启服务端或是等待下一次事务即可同步说说。\n\n### 其它配置项\n\n```ts\nexport const serverConfig: ServerConfig = {\n  /** 服务端监听端口 */\n  listeningPort: 4000,\n  /** 同步 Timeline 信息的 Cron 规则；这里表示每小时的 0 和 30 分钟执行一次同步操作 */\n  syncInterval: '*/30 * * * *',\n}\n```\n\n## 项目开发\n\n### 客户端开发\n\n启动客户端，默认监听 `localhost:3000`。\n\n```bash\nbun run dev:client\n```\n\n修复客户端代码质量问题：\n\n```bash\nbun run lint:client\n```\n\n### 服务端开发\n\n启动服务端，默认监听 `localhost:4000`：\n\n```bash\nbun run dev:server\n```\n\n修复服务端代码质量问题：\n\n```bash\nbun run lint:server\n```\n\n## 项目部署\n\n### 客户端部署\n\n编译构建客户端静态资源：\n\n```bash\nbun run build:client\n```\n\n构建后的静态资源存放在 `client/out` 目录。\n\n### 服务端部署\n\n启动服务端生产环境：\n\n```bash\nbun run start:server\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flolipopj%2Ftimeline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flolipopj%2Ftimeline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flolipopj%2Ftimeline/lists"}