backend for xcvr appview
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

add postgres and test migrations

+40 -2
+15
docker-compose.yml
··· 1 + services: 2 + db: 3 + image: postgres:15 4 + restart: unless-stopped 5 + environment: 6 + POSTGRES_USER: xcvr 7 + POSTGRES_PASSWORD: secret 8 + POSTGRES_DB: xcvrdb 9 + ports: 10 + - "15432:5432" 11 + volumes: 12 + - dbdata:/var/lib/posgresql/data 13 + 14 + volumes: 15 + dbdata:
+4 -1
lexicons/org/xcvr/feed/channel.json
··· 7 7 "key": "tid", 8 8 "record": { 9 9 "type": "object", 10 - "required": ["title", "createdAt"], 10 + "required": ["title", "createdAt", "host"], 11 11 "properties": { 12 12 "title": { 13 13 "type": "string", ··· 22 22 "createdAt": { 23 23 "type": "string", 24 24 "format": "datetime" 25 + }, 26 + "host": { 27 + "type": "string" 25 28 } 26 29 } 27 30 }
+4 -1
lexicons/org/xcvr/feed/defs.json
··· 4 4 "defs": { 5 5 "channelView": { 6 6 "type": "object", 7 - "required": ["uri", "creator", "title", "connectedCount"], 7 + "required": ["uri", "host", "creator", "title", "connectedCount"], 8 8 "properties": { 9 9 "uri": { 10 10 "type": "string", 11 11 "format": "at-uri" 12 + }, 13 + "host": { 14 + "type": "string" 12 15 }, 13 16 "creator": { 14 17 "type": "ref",
+2
migratedown
··· 1 + #!/bin/bash 2 + migrate -path migrations -database "postgres://xcvr:secret@localhost:15432/xcvrdb?sslmode=disable" down
+2
migrateup
··· 1 + #!/bin/bash 2 + migrate -path migrations -database "postgres://xcvr:secret@localhost:15432/xcvrdb?sslmode=disable" up
+10
migrations/001_init.up.sql
··· 1 + CREATE TABLE channels ( 2 + uri TEXT PRIMARY KEY, 3 + cid TEXT NOT NULL, 4 + did TEXT NOT NULL, 5 + host TEXT NOT NULL, 6 + title TEXT NOT NULL, 7 + topic TEXT, 8 + created_at TIMESTAMPTZ NOT NULL, 9 + indexed_at TIMESTAMPTZ NOT NULL DEFAULT now() 10 + );
+1
migrations/002_init.down.sql
··· 1 + DROP TABLE channels;
+2
psql
··· 1 + #!/bin/bash 2 + docker exec -it xcvr-backend-db-1 psql -U xcvr -d xcvrdb