Coder Social home page Coder Social logo

bkosm / fakers Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 2.0 16.2 MB

Fake Polish persona database system, including a generator, graphql api server and js client.

Home Page: https://bart-kosmala.github.io/fakers/

License: MIT License

Shell 0.54% HTML 0.95% CSS 4.07% JavaScript 5.28% C# 38.65% Elixir 47.76% PLpgSQL 1.84% Python 0.91%
graphql postgresql phoenix absinthe ecto react dataloader geolocation-api

fakers's Introduction

fakers

About

Polish fake persona database system. It produces people according to the following database diagram:

It generates convincing email addresses based on given person's data, a valid PESEL number and real-world addresses with usable coordinates.

To deploy the system you need:

  • PostgreSQL,
  • .NET Core (at least 3.1),
  • Erlang/OTP,
  • Elixir.

Database

The database definition contains a separate postgres user, tables, indexes and triggers. Ubuntu deployment is automated and provided here. On Windows similar procedures apply. After installing Postgres (remember the master password) launch an administrator PowerShell and:

psql -f "./init.sql"
psql -U fakers_u -d fakers_db -f "./tables.sql"
psql -U fakers_u -d fakers_db -f "./triggers.sql"

That should prepare what's needed to start the generator.

Generator

Written in C# - .NET Core 3.1. Generates person data and persists it in the database. The generator application depends on two external APIs:

  • https://api.namefake.com/polish-poland/ - provides Polish names used as seed for the generator,
  • https://api.geoapify.com/v1 - provides geolocation data for real coordinates.

To start generating people data make sure to have a local Postgres database defined as in Database section and run:

cd generator
dotnet run --project EntityGenerator

It will loop forever until an interrupt is sent. At this point you can start the server to make it internet-available.

Geoapify note

As of now, a key is provided within the app. It allows for up to 100K requests/month and is a standard free tier service.

When deploying it in your own environment please obtain your own key and modify generator/ExternalAPI/GetDataFromJson.cs's _geoKEY accordingly.

This will likely change after presentation (23.12.2020) and a separate key will be required.


ORM Server

Written in Elixir. Provides all CRUD operations on the database via GraphQL.

To get it up and running:

cd server
mix deps.get
mix phx.server

These commands will start the server at your local port 4000.

Client

Written in React.js. It provides info on the project and uses a GraphiQL component to provide a visual way to present and modify data. The client application is hosted here. To deploy your own you need node.js and npm.

Simply npm start in the client directory.

You can feed the client a GraphQL API initially with url parameter - for example:

bart-kosmala.github.io/fakers?api=https://swapi-graphql.netlify.app/.netlify/functions/index

To integrate the client with deployed application simply pass the server's address. At this point it should be:

bart-kosmala.github.io/fakers?api=http://localhost:4000

Hosting

The application was deployed for presentation purposes on AWS free tier services. Feel free to invest in some long-term hosting to provide constant access.

Authors

  • Bartosz Kosmala
  • Roch Goszczyński
  • Jordan Kondracki
  • Mateusz Kuźniak
  • Hubert Knioła

2020 SEM 5 @ PUT

fakers's People

Contributors

bkosm avatar groszczu avatar hubert-kniola avatar jor-kon avatar mateuszkuzniak avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

fakers's Issues

Problemy z klientem

  • przypisanie zewnętrznego API nie działa w deployu
  • okno z graphiqlem nie otwiera się wraz ze stroną

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.