ReadCache is an innovative application designed to help users save, organize, and manage articles, links, and content for future reading or sharing within a community platform. It utilizes Go for the backend, Flutter for the frontend, Postgres for the database, and AWS for cloud services. The app is designed to be intuitive and user-friendly, with a clean and minimalistic UI. It is also highly scalable and can be easily extended to support additional features and functionalities.
UI Repo - https://github.com/imrishuroy/read-cache-ui
- Save Links: Users can easily save articles or links from the internet to read later or share with the community.
- Organize Content: Categorize and organize saved content based on user-defined tags or categories for efficient retrieval.
- Set Reading Reminders: Set reminders or create to-dos to schedule reading specific articles or links on preferred dates.
- User Interactions: Engage with a community by sharing, liking, and commenting on saved content.
- Secure Storage: Ensure the security and privacy of user data through robust encryption and authentication mechanisms.
- Cloud Integration: Utilize AWS services for scalable cloud hosting, ensuring reliability and accessibility.
- Backend: Go (Golang)
- Frontend: Flutter
- Database: Postgres
- Cloud Services: AWS (Amazon Web Services)
- Clone the backend repository.
- Install required dependencies using
go get
. - Configure environment variables for database connections and AWS credentials.
- Run the server using
go run main.go
.
- Clone the frontend repository.
- Install Flutter SDK and necessary dependencies.
- Set backend API endpoints in the Flutter app to communicate with the backend server.
- Run the app using
flutter run
.
- Install Postgres and create a new database for ReadCache.
- Set up necessary tables and relations as defined in the backend code.
- Configure database connection strings in the backend server.
- Set up an AWS account and configure necessary services like S3 for storing user content securely.
- Manage AWS credentials and access policies for secure interactions between the app and AWS services.
docker pull postgres
docker run --name read-cache -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=IWSIWDF2024 -d postgres
brew install golang-migrate
brew install sqlc
docker pull sqlc/sqlc
docker run --rm -v "%cd%:/src" -w /src sqlc/sqlc generate
( Tip - Run in CMD )
migrate create -ext sql -dir db/migration -seq add_tags
https://docs.sqlc.dev/en/stable/tutorials/getting-started-postgresql.html
https://github.com/golang-migrate/migrate - For running migration scripts
Go Gin - https://go.dev/doc/tutorial/web-service-gin
Go Viper - https://github.com/spf13/viper
Install https://github.com/uber-go/mock
Add mockgen to path
install gomock in your project - go get github.com/golang/mock/gomock
Run mockgen -package mockdb -destination db/mock/store.go github.com/imrishuroy/read-cache/db/sqlc Store
1. Build image
docker build -t read-cache:latest .
2. Run Container
docker run --name read-cache-api -p 8080:8080 read-cache:latest
3. To Run Container in Production
docker run --name read-cache-api -p 8080:8080 -e GIN_MODE=release read-cache:latest
3 To overide default network ip of running database container
docker run --name read-cache-api -p 8080:8080 -e GIN_MODE=release -e DB_SOURCE="postgres://root:IWSIWDF2024@172.17.0.2:5432/read_cache_db?sslmode=disable" read-cache:latest
4. To list running container
docker ps
4. To remove docker image
docker rmi <image-name>
5. To remove docker container
docker rm <container-name>
7 To inspect docker container image
docker container inspect <container-name>
8 To see docker network
docker network ls
9 To inspect network
docker inspect <network-name>
DB_SOURCE=postgres://${RDS_USERNAME:db-user}:${RDS_PASSWORD:password}@${RDS_HOSTNAME:localhost}:${RDS_PORT:5432}/${RDS_DB_NAME:read-cache-db}?sslmode=disable
chmod +x start.sh make start.sh executable
https://github.com/remast/service_sonar
CROS https://github.com/rs/cors https://stackoverflow.com/questions/29418478/go-gin-framework-cors