All Projects → orbiting → backends

orbiting / backends

Licence: AGPL-3.0 License
monorepo for republik, publikator and assets backends based on NodeJS providing the GraphQL API used to power republik.ch.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
typescript
32286 projects
PLpgSQL
1095 projects

Projects that are alternatives of or similar to backends

Jmeter Elasticsearch Backend Listener
JMeter plugin that lets you send sample results to an ElasticSearch engine to enable live monitoring of load tests.
Stars: ✭ 72 (+80%)
Mutual labels:  kibana, backend
Arisu
☔ Translation made with simplicity, yet robust. Made with ❤️ in TypeScript.
Stars: ✭ 15 (-62.5%)
Mutual labels:  backend
backend
Laravel 8 backend for a genealogy website.
Stars: ✭ 82 (+105%)
Mutual labels:  backend
Mentro-Community-Blog
A blogging website for the mentrozens community with topics focused on Web development and Open Source.
Stars: ✭ 26 (-35%)
Mutual labels:  backend
commun
🎩 Fully-featured framework for REST APIs and GraphQL from JSON Schema with TypeScript and MongoDB
Stars: ✭ 97 (+142.5%)
Mutual labels:  backend
next-ts-graphql-apollo-starter
An opiniated Next powered starter which include support for Apollo with GraphQL SSR support, codegen, styled component / system, framer motion and Cypress
Stars: ✭ 18 (-55%)
Mutual labels:  apollo
articlelist
🐣 Filter für Artikellisten
Stars: ✭ 20 (-50%)
Mutual labels:  backend
agollo
agollo is a golang client for ctrip apollo config center 🚀
Stars: ✭ 140 (+250%)
Mutual labels:  apollo
apollo-progressive-fragment-matcher
A smart alternative to the introspection fragment matcher.
Stars: ✭ 21 (-47.5%)
Mutual labels:  apollo
basil
An experimental Magento 2 theme
Stars: ✭ 18 (-55%)
Mutual labels:  apollo
vaadin-stepbystep-demo-contacts
Step by step demo Vaadin 8 app with simple JPA backend
Stars: ✭ 13 (-67.5%)
Mutual labels:  backend
SITreg
SAP Event Registration app backend
Stars: ✭ 26 (-35%)
Mutual labels:  backend
analysis-net
Static analysis framework for .NET programs.
Stars: ✭ 19 (-52.5%)
Mutual labels:  backend
upper
Upper is a open source back-end framework based on the Dart language.
Stars: ✭ 39 (-2.5%)
Mutual labels:  backend
pern-stack-auth
📋 Repair. PERN stack todo app with jwt user authentication
Stars: ✭ 17 (-57.5%)
Mutual labels:  backend
bcoin-es
Bitcoin with Elasticsearch and Kibana analytics
Stars: ✭ 27 (-32.5%)
Mutual labels:  kibana
graphql-ruby-persisted queries
Persisted queries for graphql-ruby
Stars: ✭ 119 (+197.5%)
Mutual labels:  apollo
graphql-workshop
Hands on workshop about GraphQL with React and Apollo 🚀
Stars: ✭ 43 (+7.5%)
Mutual labels:  apollo
student-management-system
Management system for students of our free coding school.
Stars: ✭ 110 (+175%)
Mutual labels:  backend
docker-elk
ELK Stack on Docker
Stars: ✭ 43 (+7.5%)
Mutual labels:  kibana

@orbiting/backends Build Status Coverage Status

This repo contains all the backend code in use at Republik. For easier development the previously separate repos republik-backend, publikator-backend, assets-backend and backend-modules where merged into this monorepo.

For a guide on how to start the frontends see: docs/how-to-run

Components

The components in this repo are split into two subfolders:

  • servers: contains runnable servers
  • packages: contains code shared between the servers

How to run / Development

1. Clone

git clone [email protected]:orbiting/backends.git && cd backends

2. Prerequisites

You must have Node.js (10+), yarn, docker and docker-compose installed (alternatively to docker you can install the external services natively).

Docker

The included docker-compose.yml starts all external-services. Currently that's: postgresql, redis, elasticsearch (and kibana). The data is persisted in ./docker-data/.

docker-compose up [-d]
Postgresql in docker

We recommend you install the postgresql client tools on your machine to interact with the database. The tests scripts also depend on the clients being installed.

# linux
sudo apt install postgresql-client-12

When postgresql in running in docker client tools like psql or createdb/dropdb don't automatically connect to it. They try to access postgresql via a local socket, when instead you want them to connect via network to localhost. To make your life easier, you can add the following environment variables to ~/.bashrc / ~/.zshrc so the client tools connect to localhost per default.

export PGHOST=127.0.0.1
export PGUSER=postgres

alternativ: install natively

show more

As an alternative to docker(-compose) you can install the external-services natively:

On macOS with homebrew:

brew install postgresql redis nvm elasticsearch
nvm install 14
nvm alias default 14
npm install -g [email protected]
brew services start postgresql
brew services start redis
brew services start elasticsearch

Docker Kibana accessing native Elasticsearch

docker run -p 5601:5601 -e ELASTICSEARCH_HOSTS=http://host.docker.internal:9200 docker.elastic.co/kibana/kibana-oss:6.7.0

Note:

  • Elasticsearch and Kibana versions must match, ckeck ES version at http://localhost:9200/
  • ELASTICSEARCH_HOSTS must be accessible within docker.

2. ENVs

Copy the .env.example files to .env (in root and servers/assets/). The default values should be enough to get started.

cp .env.example .env
cp servers/assets/.env.example servers/assets/.env

3. Install

yarn install

4. Setup

yarn dev:setup

5. Run

yarn dev

This kicks on foreman which then launches all the servers locally. All servers greets you with Cannot GET / on the root route. The API server has a graphical API explorer available at /graphiql:

Next steps

more about ENVs

In development environment variables are loaded from ./.env. No ENV variabeles are loaded from any file in production, you yourself are responsible to set all required ENVs in the production environment.

Checkout .env.example, servers/assets/.env.example for which ENVs are required and their descriptions. Check the packages' README for further config options.

You will quickly run into errors and limitations if you run with the example envs. You probably want to do the following two rather soon:

  1. MailChimp and Mandrill
    • MAILCHIMP_URL, MAILCHIMP_API_KEY, MANDRILL_API_KEY in .env
    • MAILCHIMP_* in .env (less important)
  2. S3 Bucket
    • AWS_* in the root .env

Special setup: develop on two hosts

The following setup enables to start the servers (backends and republik-frontend) on one machine (A) and access it from another (B). This can come handy if you want to develop the backend on A and the app on B (where B can be a physical device).

Please not that due to how "Docker for Mac" works (docker is run in a hidden VM), it's not possible to bind containers to the host's network-interface, therefore this setup only works on linux.

Machine A (servers)

  1. Get the IP of your machine in the local network, use it in the next step as LOCAL_IP
ip addr
  1. Adapt hostnames in the environment variables:
  • in backends/.env
FRONTEND_BASE_URL=http://republik.test
ASSETS_SERVER_BASE_URL=http://assets.republik.test

LOCAL_IP=192.168.1.88

CORS_ALLOWLIST_URL=http://republik.test
COOKIE_DOMAIN=.republik.test
  • in republik-frontend/.env
API_URL=http://api.republik.test/graphql
API_WS_URL=ws://api.republik.test/graphql
API_ASSETS_BASE_URL=http://republik.test
PUBLIC_BASE_URL=http://republik.test
  1. Start the DNS-Server and reverse proxy:
docker-compose -f docker-compose-test-network.yml up [-d]
  • bind: You now have a DNS server running locally. It resolves all requests of *.republik.test to LOCAL_IP.
  • traefik: routes requests based on SNI (check: traefik.toml)
    • http://republik.test -> http://localhost:3010
    • http://api.republik.test -> http://localhost:5010
  1. Run backend services with docker (in backends/):
docker-compose up [-d]
  1. Refresh published articles, due to changed ASSETS_SERVER_BASE_URL (in backends/):
yarn pull:elasticsearch
redis-cli
> FLUSHALL
  1. Run the backend servers (in backends/):
yarn dev
  1. Run the frontend server (in republik-frontend/):
npm run dev
  1. Test You should be able to access http://api.republik.test/graphiql and http://republik.test

Machine B (app)

  1. To resolve the hostnames:
  • Find the IP of Machine A, let's say its 192.168.1.88
  • change your network config to use this IP as your DNS resolver.
  1. Adapt hostnames in the environment variables (in app/.env.dev):
API_URL=http://api.republik.test/graphql
API_WS_URL=ws://api.republik.test/graphql
FRONTEND_BASE_URL=http://republik.test
  1. Test

You should be able to access http://api.republik.test/graphiql and http://republik.test

  1. Setup simulators/emulators

At least the android emulator doesn't use the hosts dns resolver

  • configure the DNS resolver manually (see step 1) inside the simulator
  • test in the webbrowser that http://republik.test is accessible.
  • run the app as usual (in app/)
yarn run-android

Postfinance Import

see packages/republik-crowdfundings/lib/scheduler/payments/README.md.

Licensing

The source code and it's documentation is licensed under GNU AGPLv3+.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].