Skip to content

calebd-anderson/open-chemistry-lab-backend

 
 

Repository files navigation

Backend API - Interactive Periodic Table Web Application

chem-icon

Features

  • Interactive periodic table of elements.
  • Experiment with chemistry.
  • Create an account:
    • Create flash cards.
    • Test your knowledge with a quiz automatically generated from your discovered compounds.

Development

Configure Java SDK 21 LTS

Important

The version of Java used by the project must match the version output by ./mvnw --version

Tip

Set JAVA_HOME to the location where your Java JDK is installed

Build system is Maven

# test
./mvnw test
# generate a .jar
./mvnw clean package
# skip tests
./mvnw clean package -DskipTests
# run
./mvnw spring-boot:run
# override default dev,local profiles
./mvnw spring-boot:run -Dapp.profiles=test

Manually build container image with Docker

docker build -t chemlab .
docker run --rm -p 8080:8080 chemlab

Configure a local instance of MongoDB

Testing

Repository layer tests leverage MongoDB Testcontainers. A container runtime will need to be present before running repository tests.

Secrets kept using sops and age

decrypt secrets

$ sops -d src/main/resources/application.enc.yml > src/main/resources/application.yml

add recipient

  1. generate an age key pair: age-keygen -o key.txt
  2. add the key pair to a location where sops will find it
  3. add the age public key to .sops.yaml
  4. run updatekeys:
sops updatekeys src/main/resources/application.enc.yml

encrypt secrets after changes to application.yml

sops encrypt src/main/resources/application.yml > src/main/resources/application.enc.yml

Frontend built with Angular 20

Credits

This project was built with help from:

About

Chemistry Machine Processing with PubChem

Topics

Resources

Stars

Watchers

Forks

Languages

  • Java 59.7%
  • PHP 21.8%
  • HTML 16.2%
  • Shell 1.6%
  • Dockerfile 0.4%
  • Python 0.2%
  • CSS 0.1%