GithubHelp home page GithubHelp logo

anna-liepina / explore-sa-node Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 950 KB

License: MIT License

Dockerfile 0.26% Makefile 3.36% JavaScript 15.14% TypeScript 81.25%
docker graphql hacktoberfest makefile typescript educational learn-to-code nonprofit

explore-sa-node's Introduction

master heroku
tests tests tests
coverage coverage coverage

'Explore Me SA GraphqQL' [server applicaion]

This project is centered around parsing various datasets, including UK government data on property sales, police reporting data, and post code data. The goal is to harness geographical information to establish connections between postcodes using latitude and longitude.

The primary objective is to develop a scalable GraphQL backend capable of swiftly delivering requested results. This endeavor seeks to illuminate intricate aspects of GraphQL use, addressing challenges like the N+1 problem and scaling scenarios where more than one database is required for both write and read nodes.

Key features of the project include a robust automated Quality Assurance (QA) system, incorporating anonymized data seeding for comprehensive QA testing. The project also explores the flexibility of JavaScript, pushing the boundaries of the language. Notably, it delves into the constraints of default V8 object fields, which are capped at around ~8.4 million, while highlighting the superior handling capacity of the Map data structure.

Additionally, the project incorporates a queue system to enhance the efficiency of data processing. In essence, project serves as a practical demonstration of diverse and advanced aspects of software development, reflecting a commitment to excellence and innovation.

  • GraphQL live demo [currently unavailable]
  • Web Application example of how data can be consumed
    • Web Application live demo [currently unavailable]

software requirements

if you're using make commands, docker and docker-compose are required, and local node.js with npm are optional

used technologies

used services

where to get data-sets

how to install

  • with make commands no steps additional are required, otherwise you need to execute $ npm i

how to run tests

  • $ make test or $ npm test
    • optional 'jest' CLI params, examples:
      • to collect coverage, example: $ npm test -- --coverage, report will be located in ./coverage directory
      • to execute tests only in a specific file, for example: $ npm test src/graphql/user.test.js

how to set up a database

  • database configuration is located in the file src/orm-config.js
  • to get database schema up to date: $ npm run sql db:migrate, you can also create a database via ORM npm run sql db:create
  • to seed the database with 'test' data: $ npm run sql db:seed:all

how to run in 'development' mode

  • $ make or $ npm start

how to run in 'production' mode

  • $ make serve, there is no npm equivalent
  • if you only need to generate static assets
    • $ make build or $ npm run build - generated assets will be located in ./build directory

how to run containers with different variables using 'make'

  • make PORT=18081

gitflow

  • heroku -> current production, contains production specific changes, trigger production deploment on every push
  • master -> most upto date production ready, all pull requests in to this branch got mandatory check 'ci/circleci: jest'
  • feature branches -> get merged into the master branch when they are ready and mandatory checks passed
  • CI executes tests in an isolated environment

used environment variables

Variable Default Value Type Description
PORT 8081 number The port on which the application will be available.
SSL_KEY string The absolute path to the SSL key (e.g., /home/ubuntu/private.key).
SSL_CERT string The absolute path to the SSL certificate (e.g., /home/ubuntu/certificate.crt).
*** *** *** If a replica's config is specified, non-replica connections are used only for writes.
DB_HOSTNAME 127.0.0.1 string The host on which the database can be reached.
DB_USERNAME root string The username for connecting to the database.
DB_PASSWORD password string The password for the database user.
DB_PORT 3306 number The port on which the database can be reached.
DB_NAME explore string The name of the database schema.
DB_DIALECT mysql string The database dialect, one of mysql / sqlite / postgres.
DB_REPLICA_HOSTNAME 127.0.0.1 string The host of the database replica for read-only operations.
DB_REPLICA_USERNAME root string The username for connecting to the database replica for read-only operations.
DB_REPLICA_PASSWORD password string The password for the user connecting to the database replica for read-only operations.

data processors

NPM command corresponding JS file
parse:postcodes src/parse:postcodes
parse:postcodes:lsoa src/parse:postcodes:lsoa
parse:incidents src/parse:markers:and:incidents
parse:properties src/parse:markers:and:properties
parse:areas src/parse:areas
parse:timelines src/parse:timelines

example: npm run parse:postcodes -- --file=/media/data/postcodes.csv

supported databases

database version adapter main purpose
MySQL 8 mysql2 production
PostgreSQL 11 pg production
SQLite 4 sqlite3 QA Automation & CI
  • if you use MySQL 5.7+ you need to make sure it can work with mysql native password

  • PostrgeSQL and SQLite are partially supported because some of the queries are not fully engine-agnostic, and some functions do not exist in SQLite for example

explore-sa-node's People

Contributors

anna-liepina avatar eugene-matvejev avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.