Code Monkey home page Code Monkey logo

dailydevapps's Introduction

daily.dev App Suite

Everything you see on daily.dev ๐Ÿ‘€

Build Status License StackShare

Open in Gitpod

This monorepo contains daily.dev's application suite. The repo includes the web app and the extension, along with shared components for the two. The decision was made to allow faster iterations and to keep features parity in both platforms.

Technology

  • NPM for managing dependencies.
  • Node v16.15.0 (a .nvmrc is presented for nvm users).
  • lerna for managing the monorepo.

Projects

eslint-config

Shared settings for eslint for all the projects in this repo.

extension

The browser extension project. Includes webpack configuration for browser extensions and the dedicated components just for the extension.

prettier-config

Shared settings for prettier for all the projects in this repo.

shared

The main project with most of the components that are used in the applications. Every component that need to be used in both platforms should be placed in this project. This includes the design system components, custom hooks, and many more.

webapp

The web app project. It is a Next.js project and it has more pages than the extension. Such as registration page, article page, profile page, etc. For more information click here.

Local Environment

To spin up a full-blown local environment, we use Garden. It deploys the required services to a local/remote kuberentes cluster.

Prerequisites

  • Install garden using their getting started tutorial. Make sure to follow step 3 to provision a local kubernetes cluster.
  • Git clone this repo: git clone [email protected]:dailydotdev/apps.git.
  • Git clone the api and gateway services for hot reloading support (optional).
  • Ensure that you set the Docker Desktop kubernetes to docker-desktop (See image below)

Kubernetes docker desktop setup

Deploy

It's time to spin up the environment using garden. Run the following in the apps repo using your favorite terminal:

  • garden deploy. Deploys all services, runs migrations, and everything needed.
  • garden exec api "node bin/import.js". Seeds the database with sample data.

You should see your ingress URL in the terminal if everything is done correctly. image

Put the ingress URL in your browser and viola, you should see the webapp running in all its glory. ๐Ÿคฏ

Port forwarding

If you want to connect to the database or any other service, we can use the kubectl port forward command. For example, if we want to connect to postgres: kubectl --context docker-desktop -n apps-default port-forward service/postgres 5432:5432 (make sure to use the right context).

Now you can use your favorite SQL client to connect to postgres using localhost:5432.

Hot reload

Garden supports hot reload (code synchnronization in garden's terms), which makes local development so better! Follow these steps to enable hot reload:

  • Clone the api and gateway repos before you proceed as mentioned above.
  • Run: garden link source api ../daily-api. Make sure to adjust the api repo path according to your setup.
  • Run: garden link source gateway ../daily-gateway. Make sure to adjust the gateway repo path according to your setup.
  • Open project.garden.yml in the apps repo and uncomment the definition of the dev variable (lines 13-14).
  • Run: garden dev

That's it! Now anything you change will get synchronized into the kubernetes service and will reload it. ๐Ÿง™โ€โ™‚๏ธ

Garden Dashboard

Garden comes with a built-in dashboard that can show you the status of the deployment and logs of each service. Run garden dashboard and it will generate a URL that you can use to access the dashboard.

If you use garden dev, it will automatically run the dashboard as well.

Update Remote Dependencies

By default, garden will not make sure your dependencies (api, gateway, and db services) are up-to-date with the latest source. It uses whatever is available from the last time it fetched them.

To update everything, run: garden update-remote all. Think of it as the equivalent of git pull for garden.

Teardown

To teardown the environment and delete everything. Run: garden delete environment.

Want to Help?

So you want to contribute to daily.dev app suite and make an impact, we are glad to hear it. ๐Ÿ˜

Before you proceed we have a few guidelines for contribution that will make everything much easier. We would appreciate if you dedicate the time and read them carefully: https://github.com/dailydotdev/.github/blob/master/CONTRIBUTING.md

Bootstrap Project

After cloning the project, please make sure to run the following commands to bootstrap the project:

npm i -g lerna
lerna bootstrap

Firefox Review

  • Install node v16.15.0 and npm v8.5.5
  • Install lerna as a global package npm i -g lerna
  • Bootstrap project lerna bootstrap
  • Change working directory to extension project cd packages/extension
  • Build Firefox version npm run build:firefox
  • Firefox build should be located at dist

dailydevapps's People

Contributors

idoshamun avatar dependabot-preview[bot] avatar rebelchris avatar sshanzel avatar kirillkurko avatar ayadotdev avatar dependabot[bot] avatar nimrodkra avatar jonatan5524 avatar ombratteng avatar mahdhir avatar dhaiwat10 avatar anishde12020 avatar thebigtine avatar mathewsmachado avatar mingo023 avatar miralsuthar avatar nazeeh21 avatar ndagistanley avatar

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.