This is the collection service of newsbot to pull articles from the web.
James Tombleson
ada453e08a
* updated db, added dto for ListSources, and added delete source * updated from model > models * updated to models * sources now sends back a standard message * updated subscription routes to have beter logid and swagger details * moved the dto objects back to modles given they are not bound to the database * cleaned up how we return the error * cleaned up swag and updated models to take from the base apistatusmodel. less human errors this way * cleaned up swag and updated models * swag updated * updated queue to return a router and also renamed it as it will hold all queue info later on * removed config tag * added subscription details route * article routes have been moved to support dto * updated discordwebhooks to use dto * updated discordwebhookqueue to return details on the items via dto * removed the example routes * updated sources to use dto * subscriptions moved to dto * generated swag |
||
---|---|---|
.github/workflows | ||
.vscode | ||
database | ||
docs | ||
domain | ||
dto | ||
routes | ||
services | ||
.gitignore | ||
docker-compose.yaml | ||
Dockerfile | ||
go.mod | ||
go.sum | ||
main.go | ||
makefile | ||
README.md | ||
sqlc.yaml |
newsbot.collector.api
This is the collection service of newsbot to pull articles from the web.
Deployment
- Create a copy of the docker compose file and make it local
- Update the
docker-compose.yaml
with your secrets - Run migrations
2.
docker compose run api /app/goose -dir "/app/migrations" up
- Run app
docker compose up -d
- Once the app is running go to the swagger page and validate that you see the seeded sources.
http://localhost:8081/swagger/index.html#/Source/get_config_sources
curl -X 'GET' 'http://localhost:8081/api/config/sources' -H 'accept: application/json'
- Add any new sources
- Add a Discord Web Hook
curl -X 'POST' 'http://localhost:8081/api/discord/webhooks/new?url=WEBHOOKURL&server=SERVERNAME&channel=CHANNELNAME' -H 'accept: application/json' -d ''
- Create your subscription links
- This is a link between a source and a discord web hook. Without this, the app will not send a notification about new posts.
Errors
- pq: permission denied to create extension "uuid-ossp"
- Might need to grant your account
ALTER USER root WITH SUPERUSER;
to create the 'uuid-ossp' for uuid creations
- Might need to grant your account