GithubHelp home page GithubHelp logo

harishbakka / daily Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dailydotdev/daily

0.0 1.0 0.0 6.92 MB

Curated dev news delivered to your new tab ๐Ÿ‘ฉ๐Ÿฝโ€๐Ÿ’ป

Home Page: https://www.dailynow.co

License: GNU Affero General Public License v3.0

daily's Introduction

Daily Logo

Daily

Curated dev news delivered to your new tab ๐Ÿ‘ฉ๐Ÿฝโ€๐Ÿ’ป
Made by developers for developers

Chrome Web Store users Mozilla Web Store users Chrome Web Store rating Twitter Storybook

๐Ÿ—ž Daily

Daily is an open source browser extension which provides curated dev news to your new tab.

It gathers and ranks articles from tens of unique sources to help developers stay updated with the most relevant developer news. You can bookmark items, sync your data across devices, and read when you want. It works offline as well and has a progressive web app (PWA) for mobile.

Daily is:

  • ๐ŸŒŸ Well-maintained: We are working continuously to introduce new features, fix bugs, and improve user experience โ€” 40+ releases on average in a year.
  • โ™พ Constantly Updated: Daily's article feed is constantly updated. As soon as new articles get published, they start appearing in Daily.
  • ๐Ÿงต Open Source: Daily is completely open source. You can see the code to learn how it works, and contribute to help it improve.

Daily
๐Ÿ“บ Watch Intro Video โ†’

๐Ÿ“Œ Get Daily

Daily is currently available for Google Chrome, and Firefox. There's also a progressive web app (PWA) for mobile devices. Download for:

Download for Chrome Download for Firefox Download for Mobile

๐Ÿ“ฏ Philosophy

We, as developers, spend a lot of time looking for valuable articles and blog posts. It's hard to catch up with all the latest happenings โ€” coz it's frustrating and consumes a ton of time.

That's why built Daily to help you:

  • ๐Ÿ‘จโ€๐Ÿ’ป Stay up-to-date
  • โณSave time
  • ๐Ÿ“ฐ Read articles at one click

๐ŸŒฒ Daily Projects

Daily might look simple on the surface but actually it is powered by a complex and robust system of different applications. It contains several services, some are big, others are micro and easy to maintain. Below is the list of different projects that we maintain under Daily.

๐Ÿ™Œ Community & Docs

  • daily - This is the repository you are currently at. It serves as a central place for all the projects. It contains documentation, community ideas, suggestions, and whatnot.

๐ŸŽจ Frontend

  • daily-apps - Monorepo with all the frontend related projects since Daily 2.0 โ€” Vue components library, API encapsulation library, Daily extension and everything related to frontend.

  • daily-go - Progressive web app (PWA) called Daily Go for mobile devices. It comes with a story like interface, called toilet mode. You can also manage your bookmarks on it.

๐Ÿ— Backend

  • daily-api - A monolith API service, being slowly split apart to different services. It manages content related data such as posts, feeds, tags, etc.
  • daily-redirector - Service for redirecting visitors from Daily custom links to the original link.
  • daily-gateway - API gateway which receives all traffic and forward it to the relevant services after authenticating and authorizing the request.
  • daily-monetization - Serving ads from different providers including CodeFund, BuySellAds and self-hosted campaigns.
  • daily-functions - Monorepo with Cloud Functions which mostly take care of ingesting new content but also web push and others.

๐Ÿ› Architecture

Daily architecture

๐Ÿ—‚ Tech Stack

Below is a list of technologies we use at Daily.

  • ๐ŸŽจ Frontend: Vue.js
  • ๐ŸŒณ Services: Node.js & Golang
  • โ˜๏ธ Cloud: Google Cloud Platform Pub/Sub | SQL | Serverless
  • โ™พ CI/CD: CircleCI
  • ๐ŸŽฉ Deployment: Kubernetes with Helm charts
  • ๐Ÿ” Search: Algolia
  • ๐ŸŽ› Data Feed: Superfeedr
  • ๐Ÿ“จ Email Service: SendGrid
  • ๐Ÿšจ Push Notifications: OneSignal

๐Ÿš€ Running Daily Locally

Let's setup Daily locally. First you need to setup the services required to run the Daily applications, then you can run the application you want. Follow up the setups below to quickly get started.

โš™๏ธ Setting Up Daily Services

โ†’ STEP #0

  • Go through the projects description and the architecture to familiarize yourself with the system and its components.
  • Make sure Docker is installed on your machine. Take a look at the official guide for installation. After installation, run the following command in your terminal for a double check.
docker -v
# Docker version 18.09.2, build 6247962     // Expected result

โ†’ STEP #1

The first step is to create a network, so the different services of Daily can communicate with each other.

Daily services are fully dockerized and publicly available on a Google Cloud Registry (GCR) repository. We are going to use them to complete the setup.

Run the following command to create a network. It will be instant. We will use the name of the network, daily in this case, to connect our services.

docker network create daily

# 465691b49f0ba36020f0533e174c019382e82c4a827432132d0e045282dfc995     // Expected result

โ†’ STEP #2

Second step in this process is to start a MySQL instance with appropriate databases. We are going to use our database service for this purpose.

We will grab the image from GCR, run it, and connect to our network daily. 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.

Run the following command to accomplish this task:

docker run -d --name daily-mysql -p 3306:3306 --network daily gcr.io/daily-ops/mysql

The command will take a while depending upon your internet speed. See the GIF to follow up.

Setting up MySQL

โ†’ STEP #3

The next step is to run the Daily Gateway service and connect it with our daily network. This service exposes port 4000 when your run it.

To start Daily Gateway service, run the following command in your terminal. Again, depending upon your internet connection, it may take a while.

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

The OAuth credentials are for our staging environment and don't provide any real Daily user information.

Yes, we have a GIF for you showing how it should go ideally.

Setting up Daily Gateway

โ†’ STEP #4

We have MySQL service in running with Daily gateway service. Next, we need to run the Daily API Service and connect it to our network. It exposes port 5000.

Run the following command your terminal to start it.

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/4A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it -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

Ideally, this is how it should work:

Setting up Daily API

โ†’ STEP #5

Last step is to populate your database using the seed data. We use knex.js for this purpose. All you need to do is, run the following command in your terminal:

docker exec daily-api npx knex seed:run

# npx: installed 160 in 10.92s     // Expected result
# Using environment: development
# Ran 1 seed files

That's it! ๐Ÿฅ‚

Now you have all the required services running. Each project's repo explains what services are needed and how to get started with them.

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.

It means that if you click on an article you will get error 404 and that you will not see ads on your local environment.

๐ŸŽจ Setting Up Daily Apps

Now, let's quickly setup Daily chrome extension to elaborate how you can setup each Daily application.

โ†’ STEP #1

Clone the daily-apps repo and run the following commands in your terminal to bootstrap.

Yes, we use lerna for this purpose.

npx lerna bootstrap

# npx: installed 698 in 89.279s     // Expected result
# ...
# lerna success Bootstrapped 4 packages

npx lerna run build

# Done in 29.19s.     // Expected result
# lerna success run Ran npm script 'build' in 4 packages in 48.5s:
# lerna success - @daily/components
# lerna success - @daily/extension
# lerna success - @daily/moderator
# lerna success - @daily/services

โ†’ STEP #2

Go to packages/extension in the daily-apps folder. Run the following command to start it in development mode. It will watch for all the file changes and generate the output in dist folder.

yarn serve

# ...
# DONE  Build complete. Watching for changes...      // Expected result

โ†’ STEP #3

By now, you will have unpacked Daily extension in your dist folder. Follow the steps listed below to load the extension.

  1. Go to chrome://extensions path in your Chrome browser.
  2. Enable Developer mode from the top right section.
  3. Click on Load Unpack button and select your dist folder.

That's it! Your extension has been loaded in your browser. Happy hacking! โœŒ๏ธ

Daily in development mode

For Firefox, you can follow this guide. Similarly, you can run all the other Daily apps. Each app has a readme file in its repo to help you get started.

๐Ÿ™Œ Want to Contribute?

We are open to all kind of contributions. If you want to:

  • ๐Ÿค” Share an idea
  • ๐Ÿ› Report an issue
  • ๐Ÿ“– Improve documentation
  • ๐Ÿ‘จโ€๐Ÿ’ป Contribute to the code

You are more than welcome. Before contributing, kindly check our guidelines.

๐Ÿค” FAQs

We have compiled a list of FAQs. You can find it here.

๐ŸŽฉ Core Team

Meet the core team of Daily.

Feel free to reach us out and say hi ๐Ÿ‘‹.

๐Ÿ’ฌ What Do You Think of Daily?

Twitter @dailydotdevย  Tweet us @dailydotdev to share your thoughts and stay up-to-date.

Facebook @dailydotdevย  Like us to know what's happening at Daily and share your reviews.

Daily at ProductHuntย  Checkout our ProductHunt page and let's know what you think.

Daily Websiteย  Visit our home for all useful links.

Daily at ChomeStoreย  See our Chrome Store page to grab the extension or share your feedback.

Daily at Firefoxย  Check our Firefox Add-on and share your thoughts.

๐Ÿ“‘ License

Licensed under AGPL-3.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.