{"id":24059905,"url":"https://github.com/danielres/mytribe","last_synced_at":"2026-04-11T17:34:10.034Z","repository":{"id":43727083,"uuid":"92765059","full_name":"danielres/myTribe","owner":"danielres","description":"a directory of friends for local/remote communities | highly experimental | ORM-less | nodejs + react + redux | docker-cloud CD + CI | lean event-sourcing","archived":false,"fork":false,"pushed_at":"2022-02-21T15:11:40.000Z","size":387,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-09T06:40:24.754Z","etag":null,"topics":["ci","create-react-app","docker","docker-cloud","docker-compose","droplet","functional","functional-programming","jest","knexjs","nodejs","orm-less","react","redux"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielres.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-29T18:26:23.000Z","updated_at":"2022-04-08T03:51:06.000Z","dependencies_parsed_at":"2022-08-22T13:01:01.099Z","dependency_job_id":null,"html_url":"https://github.com/danielres/myTribe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielres%2FmyTribe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielres%2FmyTribe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielres%2FmyTribe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielres%2FmyTribe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielres","download_url":"https://codeload.github.com/danielres/myTribe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240865394,"owners_count":19870118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","create-react-app","docker","docker-cloud","docker-compose","droplet","functional","functional-programming","jest","knexjs","nodejs","orm-less","react","redux"],"created_at":"2025-01-09T06:37:13.067Z","updated_at":"2026-04-11T17:34:05.002Z","avatar_url":"https://github.com/danielres.png","language":"JavaScript","readme":"# Docker-Node-React test project\n\nWarning: this Readme is outdated. Stay tuned for updates !\n\nThis project is a personal experiment for running a javascript app with decoupled frontend and backend using Docker.\n\nThe whole application is composed of several independent layers assembled together using docker-compose:\n\n\n- in all environments:\n  - the `web` container is the core of the application\n  - the `db` container provides a postgresql database\n\n- in production only: \n  - `https-portal` enables https on the whole application\n  - the `auth` container has to be used on a subdomain of the app, and provides authentication using various providers like Facebook\n\nThis whole stack can be executed locally for development and remotely in production using `docker-compose` commands.\nIn production, this whole stack can be hosted for example on Digital Ocean's cheapest instance (5$/month).\n\nThis might hopefully become a very convenient base for rapid development of simple applications with a small amount of users, with the ability to scale up easily if necessary.\n\nThe app is composed of:\n\n- a `web` container with: \n  - a frontend (create-react-app)\n  - a backend (express.js)\n- a `db` container (postgres)\n\nAnd, in production:\n\n- an `https-portal` enabling https for the whole app\n- `login-with`: a microservice in charge of Facebook authentication (can easily configured for more auth providers like Google, Twitter, ...)\n\nDeployment:\n\n- [TODO]\n\n## Configuration:\n\nThe app needs a number of environment variables to be set:\n\n- used in all environments:\n  - `PGPASSWORD`\n  - `PGUSER`\n  - `PGDB`\n\n- used in production only:\n  - `HTTPSDOMAINS`\n  - `LW_JWT_SECRET`\n  - `LW_SESSION_SECRET`\n  - `LW_SUBDOMAIN`\n  - `LW_FACEBOOK_APPID`\n  - `LW_FACEBOOK_APPSECRET`\n\nIn development, these needed env variables are set automatically, reading from the `.env` file.\n\nIn production, you need to define these variables yourself. \n\nHere is an example launch command for production:\n\n```bash\nPGPASSWORD=\"myDbPassword\" \\\nPGUSER=\"myDbUser\" \\\nPGDB=\"myDbName\" \\\nHTTPSDOMAINS=\"mydomain.com -\u003e http://web:3001, login.mydomain.com -\u003e http://auth:3000\" \\\nLW_JWT_SECRET=\"someComplicatedString\" \\\nLW_SESSION_SECRET=\"someOtherComplicatedString\" \\\nLW_SUBDOMAIN=\"login.mydomain.com\" \\\nLW_FACEBOOK_APPID=\"123444445555555\" \\\nLW_FACEBOOK_APPSECRET=\"js4nvt3eog7mp49042240f350790be3e\" \\\ndocker-compose -f docker-compose.production.yml up\n```\n\n## Setting up the Docker host\n\nRecommended host system: a Digital Ocean's standard droplet with Ubuntu 14.04. (newer Ubuntu versions are not well suppoprted by `docker-machine`)\n\nIf you want to use a minimal Digital Ocean droplet for 5$/month (512 mb RAM, 20Gb Disk).\n\n`docker-machine create --driver digitalocean --digitalocean-access-token=YOUR_DIGITALOCEAN_ACCESS_TOKEN --digitalocean-size 512mb YOUR_DOCKER_MACHINE_NAME`\n\nThis is the cheapest option available and comes with limitations that require some little tweaks. The main problem is that the droplet doesn't have enough RAM to be able to complete the `npm install` (or `yarn install`) command. \n\nLuckily, they provide more than enough hard disk space for us to set up a 1Gb swapfile, which solves our probem.\n\n### Setting up the swapfile (tested on the Digital Ocean Ubuntu 14.04 droplet):\n\nAccess the host's terminal through ssh, then run the following command on the host:\n\n`fallocate -l 1G /swapfile \u0026\u0026 chmod 600 /swapfile \u0026\u0026 mkswap /swapfile \u0026\u0026 sudo swapon /swapfile \u0026\u0026 swapon --show`\n\nWith `docker-machine`, from your own machine:\n\n`docker-machine ssh YOUR_DOCKER_MACHINE_NAME \"fallocate -l 1G /swapfile \u0026\u0026 chmod 600 /swapfile \u0026\u0026 mkswap /swapfile \u0026\u0026 sudo swapon /swapfile \u0026\u0026 swapon --show\"`\n\nThis will create the swapfile needed for the build to complete.\n\n## Running commands through Docker\n\n- [TODO, but in short: check package.json for ready to use npm scripts going through Docker]","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielres%2Fmytribe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielres%2Fmytribe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielres%2Fmytribe/lists"}