GithubHelp home page GithubHelp logo

demo-vehicle-administration's Introduction

Vehicle Administration

This project is built for fun and should show an application for vehicle administration.

How-To run

Requires Docker and Docker Compose installed on your machine.

Simply run the following command:

docker compose up -d

This should build the frontend as well as the backend part and run it inside the Docker containers together with a PostgreSQL database.

You should be able to access the Vehicle Administration App via http://localhost:9090. As admin user I already added MrT with the obvious password of aTeam related to the TV show.

Any e-mail sent will be automatically fetched by the MailHog. You can access those e-mails via the MailHogs web-frontend running at http://localhost:8025.

When you change something inside the code it requires to rebuild the related Docker image of the related service for the change to become available to another Docker Compose run.

How-To run frontend and backend manually

Backend: Run main inside TestBackendApplication - This will automatically spin up a required Docker Container with a PostgreSQL for you.

Web Frontend:

  1. Change line for baseUrl inside useApi
  2. Run npm start

Backend

The backend has been set up with the Spring Initializer and contains a Spring Boot Kotlin application.

Web Frontend

The web frontend is a React app, setup with create-react-app.

Shortcuts

I did some shortcuts intentionally since I think that they are not really necessary for a demo and might be just time-consuming for me. Such shortcuts are:

  • Authentication - I've just used basic auth which is just easy to use inside a demo app. Usually I'd go with OAuth2.
  • CORS - I've disabled CORS so that I can easily switch ports of the frontend part. Usually I'd add a specific CORS configuration which contains the real frontend URL
  • Frontend-Config - I've hardcoded the backend API URL just for convenience. I skipped setting up specific environments to use.
  • CSS - I'm not a good web designer, therefore I skipped the most parts of beautiful design and concentrated on the functional parts.
  • Using docker-compose - I wanted to provide a demo which can be run with one command. I could have chosen k8s deployments, but I thought it would be easier to just do a docker compose up -d.
  • Default roles and users - I added an application event listener which executes after the application has started. This listener will initialize some things including the default roles and users. Usually, I'd do this with Liquibase or something similar and not with an application listener. For me, it was easier to use JPA for the data schema and the listener for my initial test data.
  • Skipping the tests at build - When using Testcontainers it can be difficult to execute the tests within a Docker multi-stage-build. To avoid malfunction I just skipped them and executed them manually within IntelliJ to ensure my logic works as expected.
  • React project setup - I just used the create-react-app to set up the React frontend. Usually I'd put some more love into the project setup, but I think this isn't as important as the function I built.
  • Plaintext user password in DB - Usually, this is a very severe security issue and should never happen. Passwords should be hashed with salt so that they can't be reproduced or read from any system. For simplicity reasons I skipped hashing of passwords.

demo-vehicle-administration's People

Contributors

stefanhufschmidt avatar

Stargazers

 avatar

Watchers

 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.