repositorypackage
0.0.0-20240521122035-4c65e4122d55
Repository: https://github.com/dotpep/rss-feed-aggr.git
Documentation: pkg.go.dev
# README
RSS feed aggregator
Backend REST API server in golang, that allows aggregate data from RSS feeds and add different RSS feeds for podcast, blog, post etc that will automatically collect those posts from feeds with scrapper and download/save them into database so that we can view them later.
Usage Instruction
Requirements
- Golang > 1.20
- PostgreSQL > 14.0
Run Localy Step-by-step
- Rename
.env.example
to.env
and configure your environment variables - To run server first time:
go build
after:go build | .\rss-feed-aggr.exe
in powershell, in bash replace|
to&&
:go build && .\rss-feed-aggr.exe
or just run builded executable file. - Create database in PostgreSQL using PgAdmin or CLI.
- Change
DB_URL
in.env
file with these structure: DB_URL=postgres://username:password@localhost:5432/db_name?sslmode=disable
- Install two CLI tools that allow working with ORM and Migrations
- (additional)
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
(ORM) check withsqlc version
go install github.com/pressly/goose/v3/cmd/goose@latest
(DB Migrations) check withgoose --version
- (additional)
- To apply goose migrations:
cd sql/schema
- up:
goose postgres postgres://username:password@localhost:5432/db_name up
- down:
goose postgres postgres://username:password@localhost:5432/db_name down
- (additional) sqlc Generator ORM (SQL query in
sql/queries/
to Golang code tointernal/database
):sqlc generate
Routers/Endpoints
Tech stack
- Golang
- PostgreSQL
Dependency Third-party Packages/Modules
github.com/go-chi/chi
REST API router/endpoint HTTP maker lightweight service docsgithub.com/go-chi/cors
router CORS middleware rulesgithub.com/joho/godotenv
load.env
file as environment variablegithub.com/lib/pq
postgresql drivergithub.com/pressly/goose
CLI tool for Migrations with Raw SQL docsgithub.com/sqlc-dev/sqlc
CLI tool for Generate Golang Code with Raw SQL docsgithub.com/google/uuid
UUID generator
TODO
- Add Docker, makefile
- OpenAPI, Swagger API docs
- Connect PostgreSQL database, and ORM(generating go code sqlc)/Migrations (goose) future with raw SQL query
- Authentication w/ API keys
- Aggregation scraper/worker