GithubHelp home page GithubHelp logo

laraschmitt / parkplatztransform-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from parkplatz-transform/parkplatztransform-api

0.0 0.0 0.0 99 KB

๐Ÿšซ ๐Ÿš—

Dockerfile 2.61% Python 91.15% Mako 2.07% Shell 4.17%

parkplatztransform-api's Introduction

Parkplatz Transform

Park Platz Transform API, intended to be consumed by the Park Platz Transform app, admin and potential 3rd parties.

Technology Overview:

Name Documentation
FastAPI docs
PostgresSQL docs
PostGIS docs

Swagger Documentation:

Autogenerated API documentation can be found here

Authentication:

In the current implementation the authentication system is implemented using a concept of "magic links" or "password less" auth.

A client makes a request with an email address and a JWT token is generated and signed by the server using a secret key. The JWT is delivered to the email address as part of a verification link.

An endpoint on the server verifies that a JWT was signed with the same secret key and matches an email given to that key. From then on, authenticated requests can be made with this JWT. Clients requesting access to protected GraphQL queries should include the JWT token as part of a Authentication: Bearer <Token> header.

The key expires after 2 weeks and must be verified within two hours of being generated. There is currently no concept of roles, however this should be discussed.

โ†“ CreateUser Mutation with email parameter

โ†“ Generate signed token

โ†“ Email token verify link

โ†“ Verify token was signed by server in given time frame

Development:

Clients apps can likely develop against the production backend, however if you would like to work on the backend, you can follow the steps bellow:

You will need to create a .env file in the root directory of this project once you've cloned this repository. It should look something like the following:

SECRET_KEY=averysecretkey
DATABASE_URL=postgresql://postgres:postgres@postgres/postgres
MAILGUN_DOMAIN=<MAILGUN_DOMAIN>
MAILGUN_API_KEY=<MAILGUN_API_KEY>

The easiest way to run the API locally is by using docker and docker compose. Docker is setup for development only. Simply run the following in the project directory:

docker-compose build

To build the containers and install dependencies

docker-compose up

To start the database and web server

The web server will be available on localhost:8023

Deployment

The application is currently deployed on Heroku and depends on the following third party services:

  • Mailgun API for sending magic link emails
  • Heroku Postgres with PostGIS extension installed

The application uses continuous integration and will automatically deploy the main branch on any commits.

parkplatztransform-api's People

Contributors

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