Giter Club home page Giter Club logo

mapt's Introduction

Mapt

Shape file sharing application, testing out RMWC as a component framework

Dev Environment

The development environment is containerised using the docker-compose.yml file. This file mounts both the frontend and backend source code directories. This means hot reloading still works in the containerised environment.

Setup

The setup requires node, pre-commit and docker-compose as dependencies. I am using node v14.8.0 In order to setup the development environment you should run:

make setup

This will run yarn-install for the front-end libraries, this isn't in the container but in my experience it helps with my IDE (pyCharm) with code completion. It will then also run yarn-install in the root directory to install the openapi code generator to help keep the front-end client in sync with the backend as you update it. It will then build the Docker images for both the frontend and backend.

Environment Variables

The setup process will have also created two .env files in the frontend and backend directories. Currently the required entries in frontend/.env are:

REACT_APP_MAPBOX_ACCESS_TOKEN=

And in the backend they are:

# None yet!

Running the Application

To run the application simply run:

make run-stack

Once you have supplied the required environment variables

Add a Backend Dependency

As the development environment is containerised the Docker image needs to rebuilt after running pip install in the container. To add a new (or multiple) dependency use the command:

make pip-install <MY_PACKAGE> <MY_PACKAGE_2>

This command will execute pip-install in the container and then refresh the requirements.txt which is mounted in the docker-compose.yml file

Add a Frontend Dependency

To do this run:

make yarn-add <MY_PACKAGE>

Again this will run in the container but will also run yarn install locally because otherwise your local node_modules will be out of sync with the containers

Updating the Frontend OpenAPI client

This application make use of the fact that FastAPI generates an OpenAPI spec for you when you define the API. To refresh the frontend/src/client package first up the stack and then type:

make regen-openapi-client

ESLint should be able to pretty easily pick up if there has been a breaking change (such as field removal)

Linting

To run all the linters this project uses pre-commit. To run the linters run:

make lint

mapt's People

Contributors

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