Giter VIP home page Giter VIP logo

elementsrecorder's Introduction

Installation

You'll need JDK 17 to run this project. You can install a working JDK with sdkman. The version that has been used for development is the 17.0.2.8.1-amzn.

To ensure everything's working properly, run

  • ./mvnw clean install
  • ./mvnw test

Infrastructure

Docker images are stored in a private registry on the raspberry. It's not secured at the moment, so we have to use the insecure-registry flag.

If you have a running minikube cluster, delete it.

minkube should be started with this tag: mk start --insecure-registry "192.168.1.21/32"

Raspberry setup

docker build -t 192.168.1.21:5000/elements-recorder-api .
docker push 192.168.1.21:5000/elements-recorder-api
  • Install k3s (pay attention to a message saying something about adding ...memory... to /boot/cmdline.txt if you're on a raspberry)
  • create a dedicated namespace on k3s
  • apply db-pv and db-svc files: k apply -f db-pv.yml
  • create the database
    • enter the container hosting the db: k exec -ti pod-name -- bash
    • connect to the database: psql -h localhost -p 5432 -U elements_recorder_app -W
    • create the database: create database elements_recorder_db
  • apply app-deployment: k apply -f app-deployment.yml

Docker troubleshooting

If you consistently see that your changes are not reported to your containers, consider deleting all the images and run the following command

docker-compose up --build --force-recreate

Publish a new version

  • docker build --no-cache -t 192.168.1.21:5000/elements-recorder-api .
  • docker tag 192.168.1.21:5000/elements-recorder-api:latest 192.168.1.21:5000/elements-recorder-api:3b4e07b3 where 3b4e07b3 is the latest commit
  • docker push 192.168.1.21:5000/elements-recorder-api:3b4e07b3
  • edit _infra/app-deployment.yml deployed in your environment with the path to the latest image

Access local db

  • sudo -u postgres -i
  • \l to list databases
  • Don't forget the ; at the end of your queries!!

Backup prod db

In the Raspberry

  • Connect to db pod: k exec -it elements-recorder-db-757fbf45ff-jsmd2 -- bash
  • cd to the folder of your choice cd /home
  • Run the backup command pg_dump elements_recorder_db -U elements_recorder_app > db.sql
  • Copy the dump from the pod to the Raspberry: k cp elements-recorder-db-757fbf45ff-jsmd2:home/db.sql /db.sql

On your computer

  • Copy the file from the Raspberry to your local machine: scp [email protected]:/home/qlassalle/ElementsRecorder/db.sql .

Features to add

  • Rating should have a maximum
  • Expired JWT should not throw any exception ...

Bugs to fix

  • Timestamps for dates aren't set on adding and updating

Things that I'd like to have on this project

  • CI/CD including
    • automated deployment on AWS
    • good integration tests with Docker
  • Gradle as a build tool
  • Fancy badges on Github repo

elementsrecorder's People

Contributors

qlassalle avatar

Watchers

 avatar

elementsrecorder's Issues

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.