Code Monkey home page Code Monkey logo

caresteouvert_backend's Introduction

Ça reste ouvert - Back-end

Install

Requires :

  • NodeJS >= 9
  • PostgreSQL >= 10
  • PostGIS >= 2.5
  • A properly initialized Ça reste ouvert database (with countries_subcountries table)

Then run these commands :

cd caresteouvert_backend/
npm install
psql -d mydb -f src/init.sql
npm run start:api # Launch API listening process
npm run start:osm # Launch OSM data sending process

Environment variables

  • DATABASE_URL : connection string for PostgreSQL database
  • DELAY_OSM : optional, delay between two calls to either notes or features updates (in milliseconds)
  • OSM_API_URL : OSM API endpoint to use (for example https://master.apis.dev.openstreetmap.org)
  • OSM_API_KEY : OSM API key
  • OSM_API_SECRET : OSM API secret key
  • OSM_USER : OSM user name
  • OSM_PASS : OSM user password
  • OSM_LANG : language used for OpenStreetMap notes and changesets (code used in src/locales.json)

Docker

The back-end can be deployed using Docker. It consists of three containers:

To deploy using Docker Compose:

  1. Copy env.example to .env and set environment variables.
  2. Run docker-compose up to build and run the containers.
  3. Open http://localhost:8080/ to check that it returns {"status":"OK"}.

Notes:

  • On the first run, the database will be created automatically. It is a known issue that the worker fails in this case, because it tries to access the database before it exists.
  • To reset the database, run docker-compose down --volumes.

License

Copyright (c) "Ça reste ouvert" 2020

Released under the AGPL v3 terms, see the LICENSE file to read the full text.

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.