https://github.com/zahidalidev/daily
https://github.com/zahidalidev/daily
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zahidalidev/daily
- Owner: zahidalidev
- License: agpl-3.0
- Created: 2020-03-19T22:28:36.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-19T22:29:28.000Z (about 6 years ago)
- Last Synced: 2025-02-26T22:27:42.459Z (over 1 year ago)
- Size: 80.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Daily
Curated dev news delivered to your new tab π©π½βπ»
Made by developers for developers β€οΈ
Hi there π! So you probably here because you want to understand deeper what's going on behind the scenes of Daily... This is exactly the place for you so calm down and keep on reading π!
## Don't know Daily!?
Daily is a dev news curator delivering relevant updates to your new tab. It gathers and ranks articles from tens of different sources to help you optimize your time and boost your knowledge.
### Check us out:
- [Website](https://www.dailynow.co)
- [Chrome Web Store](https://bit.ly/chromedaily)
- [Firefox Add-ons](https://bit.ly/firefoxdaily)
- [Product Hunt](https://www.producthunt.com/posts/daily-2-0)
## Projects
Daily might look pretty simple on the surface but actually it is powered by several services, some might be big and legacy and other micro and easy to maintain. We would like to guide you through the different repositories so you can get by the codebase.
### Community & Docs
* [daily](https://github.com/dailynowco/daily) - This is the repository you are currently at and it is actually the repository with overall documentation, community ideas, suggestions and whatnot.
### Frontend
* [daily-apps](https://github.com/dailynowco/daily-apps) - Monorepo with all the frontend related projects since Daily 2.0, our Vue components library, API encapsulation library, obviously Daily extension and others.
* [daily-go](https://github.com/dailynowco/daily-go) - Our Daily Go webapp, with a story like interface (called toilet mode) and user's bookmarks.
### Backend
* [daily-api](https://github.com/dailynowco/daily-api) - Started as a monolith API service and slowly has been split apart to different services. Currently the target domain is to manage content related data such as posts, feeds, tags, etc.
* [daily-redirector](https://github.com/dailynowco/daily-redirector) - Service for redirecting visitors from Daily custom links to the original link.
* [daily-gateway](https://github.com/dailynowco/daily-gateway) - API gateway which receives all traffic and forward it to the relevant services after authenticating and authorizing the request.
* [daily-monetization](https://github.com/dailynowco/daily-monetization) - Serving ads from different providers including CodeFund, BuySellAds and self-hosted campaigns.
* [daily-functions](https://github.com/dailynowco/daily-functions) - Monorepo with Cloud Functions which mostly take care of ingesting new content but also web push and others.
## Want to help?
Looking to contribute to Daily? Awesome! We are glad to hear it, check out our [guidelines](https://github.com/dailynowco/daily/blob/master/CONTRIBUTING.md).
## Architecture
## Tech Stack
We use Vue for web application development and Netlify for hosting them.
Backend wise most of the services and cloud functions are written in Node and some minor services are written in Go (wanted to learn Go, perfect chance π). Everything is Docker-based and deployed to the almighty Kubernetes cluster with Helm charts.
MySQL is the database which powers everything and Google Pub/Sub is used for inter-service communication.
Lastly, we use CircleCI for running the CI/CD pipelines.
## Setting up local environment
Before proceeding to setting up your own Daily environment, make sure to go over the [projects description](#projects) and [the architecture](#architecture) to make sure you understand the system and its components.
Daily services are fully dockerized and publicly available on a `gcr.io` repository. This means that all you need is docker on your system and we are good to go. If you don't have docker already you can [check out this guide](https://docs.docker.com/install/).
Follow the instructions to install everything:
1. Create a network so the services can communicate with each other.
`docker network create daily`
1. Start a MySQL instance (contains the relevant databases already), it exposes port `3306` so you can use any MySQL client to connect and inspect the data. The root user is `root` and password is `12345`.
`docker run -d --name daily-mysql -p 3306:3306 --network daily gcr.io/daily-ops/mysql`
1. Run [Daily Gateway](https://github.com/dailynowco/daily-gateway) service, it exposes port `4000`. Obviously, the OAuth credentials are for our staging environment and don't provide any real Daily user information.
`docker run -d --name daily-gateway -p 4000:4000 --network daily -e MYSQL_USER=root -e MYSQL_PASSWORD=12345 -e MYSQL_DATABASE=gateway -e MYSQL_HOST=daily-mysql -e COOKIES_DOMAIN=localhost -e COOKIES_KEY=topsecret -e GITHUB_CLIENT_ID=7b514cee17923d0acedc -e GITHUB_CLIENT_SECRET=064d875c7b370d271be839242538c87ab8bb6f92 -e GOOGLE_CLIENT_ID=750405661228-fmeg35uuaopbcnc4c6m6g51755s355bm.apps.googleusercontent.com -e GOOGLE_CLIENT_SECRET=MMv_wZAS6Etoleg-sn__BlDC -e URL_PREFIX=http://localhost:4000 -e JWT_SECRET='|r+.2!!!.Qf_-|63*%.D' -e JWT_AUDIENCE='Daily Staging' -e JWT_ISSUER='Daily API Staging' -e CORS_ORIGIN='http://,chrome-extension://,moz-extension://' -e PORT=4000 -e API_URL=http://daily-api:5000 -e API_SECRET=topsecret gcr.io/daily-ops/daily-gateway`
1. Run [Daily API](https://github.com/dailynowco/daily-api) service, it exposes port `5000`.
`docker run -d --name daily-api -p 5000:5000 --network daily -e DEFAULT_IMAGE_URL=https://storage.cloud.google.com/devkit-assets/placeholder.jpg -e DEFAULT_IMAGE_PLACEHOLDER='data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QCYRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUAAAABAAAARgEoAAMAAAABAAIAAIdpAAQAAAABAAAATgAAAAAAAABIAAAAAQAAAEgAAAABAAWQAAAHAAAABDAyMTCgAAAHAAAABDAxMDCgAQADAAAAAQABAACgAgAEAAAAAQAAAAqgAwAEAAAAAQAAAAYAAAAA/+ECz2h0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8APD94cGFja2V0IGJlZ2luPSfvu78nIGlkPSdXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQnPz4KPHg6eG1wbWV0YSB4bWxuczp4PSdhZG9iZTpuczptZXRhLyc+CjxyZGY6UkRGIHhtbG5zOnJkZj0naHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyc+CgogPHJkZjpEZXNjcmlwdGlvbiB4bWxuczpleGlmPSdodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyc+CiAgPGV4aWY6WFJlc29sdXRpb24+NzI8L2V4aWY6WFJlc29sdXRpb24+Ci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AgBAgEBPwGsdL6JUnsMc6Admdc8nNnD+ft6ezJJplldJoKdgjRLoqWjp5//xAAdEAACAQQDAAAAAAAAAAAAAAABAgMREiEjABMi/9oACAEBAAY/AirQXybKSdrrQNHanhcExSbAThqlHUi0rz//xAAXEAEBAQEAAAAAAAAAAAAAAAABERAx/9oACAEBAAE/IRRs0xVxiFhHGC//2gAMAwEAAgADAAAAEGP/xAAWEQEBAQAAAAAAAAAAAAAAAAABEBH/2gAIAQMBAT8QNAUSVjBHQudd/8QAFhEBAQEAAAAAAAAAAAAAAAAAARAh/9oACAECAQE/EEkCGWNRJa8Ww//EABcQAQADAAAAAAAAAAAAAAAAAAEQESH/2gAIAQEAAT8QpeTsA40GpPBD/9k=' -e DEFAULT_IMAGE_RATIO=1.7 -e MYSQL_USER=root -e MYSQL_PASSWORD=12345 -e MYSQL_DATABASE=devkit -e MYSQL_HOST=daily-mysql -e URL_PREFIX=http://localhost:4000 -e PORT=5000 -e GATEWAY_URL=http://daily-gateway:4000 -e GATEWAY_SECRET=topsecret gcr.io/daily-ops/daily-api`
1. Populate database with seed data.
`docker exec daily-api npx knex seed:run`
That's it! :clap: Now you have a running environment waiting for you to try it out. Each project explains what services are needed and how to dive into the actual code and contribute.
\* Please note that currently not all services are ready (or needed) for local environment so Daily Redirector and Daily Monetization services are not available for you. Don't worry it just means that if you click on an article you will get error 404 and that you will not see ads on your local environment.
## Contributors β¨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

Ido Shamun
π€ π» π

Tsahi Matsliah
π€ π¨

Ram Subramanian
π€

Sigfried Seldeslachts
π

Ornataweaver
π€

Jundi Alwan
π€

Glub0t
π

Edouard
π€

Sevket Yalcin
π

Brahma Teja Ponnuru
π

Mia Durand
π€

Vishal Sutnar
π€ π

Itai Terner
π

Justin Tan
π»

Gatej Andrei
π»

Zaerald Denze Lungos
π»

Jianchun Wang
π

Randal Vance Cunanan
π»

Andrii Tynok
π»

Darko
π

Sergio Faya FernΓ‘ndez
π

N D
π

James Kerrane
π π

Darren Pinder
π€

zvikarp
π€

wowkanwowka
π

JohannesBe
π

Adan Huerta
π€

paulz1
π€
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!