Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dveeden/demoblog
https://github.com/dveeden/demoblog
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/dveeden/demoblog
- Owner: dveeden
- Created: 2023-07-18T12:00:12.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-07T11:56:24.000Z (about 1 year ago)
- Last Synced: 2023-11-07T12:39:17.589Z (about 1 year ago)
- Language: Go
- Size: 7.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
To run this:
Run a local TiDB database on port 40000
```
tiup playground v7.2.0
```Create the database schema and initial data
```
mysql --comments -h 127.0.0.1 -P 4000 -u root
...
source 0001_schema.sql
source 0002_data.sql
```Now build and run the code
```
go build
./demoblog
```And finally open the webpage in your browser.
```
xdg-open http://127.0.0.1:8080/
```# TODO
- General
- Show the number of likes on posts
- Show the number of likes on comments
- Storing a cached version of the rendered markdown? Could be used for the summary on the index page.
- TiCDC & Kafka for comments, likes, heartbeat (alert?)
- Analytics
- Number of comments per author
- Most liked posts/comments```
SELECT
p.title,
p.likes,
SUM(c.likes) 'comment likes'
FROM
posts p
JOIN
comments c ON c.post_id=p.id
GROUP BY
p.id
ORDER BY
p.likes+SUM(c.likes) DESC
LIMIT 5;
```
- Average length of comment, post
- Comments per hour of day# Things to try
- Block writes
```sql
BEGIN;
SELECT * FROM ticker FOR UPDATE;
DO SLEEP(10);
ROLLBACK;
```This should show increase in the ticker latency. Other things like DDL etc should not show this.
- Add/remove TiFlash replicas
- Add/remove index on `comments.post_id`
- Try foreign keys