GithubHelp home page GithubHelp logo

donnyhyon / shoppinglistapi Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 663 KB

React frontend, SpringBoot backend, Postgres DB. Dockerised

Java 47.84% HTML 7.44% CSS 2.08% JavaScript 40.67% Dockerfile 1.09% Shell 0.87%

shoppinglistapi's Introduction

Build Status

Scripts for local dev

./start-fresh.sh pulls, builds docker DB containers. Packages jar backend + tests.

./quick-start.sh Must have DB image and JAR file compiled.

./tear-down.sh Down and deletes the containers, cleans-up dangling images.

Run Tests

cd backend && mvn clean test

Running with only db dockerised (localdev)

cd database && docker build -t db:latest .

docker run -p5432:5432 -it db:latest

cd ../backend && mvn clean package

mvn spring-boot:run

cd ../frontend && npm start

Running using Docker

Need to make sure a back-end jar file is created. To do this cd backend && mvn clean package

Then cd .. back up to project root to run docker compose up --build

Access the front end at localhost:3000

Stopping docker and removing images

docker compose down --rmi all

Just build docker images

docker compose up --build

Info only: Running docker manually (i.e no dockerfile)

  1. Pull down latest postgres image from dockerhub docker pull postgres
  2. Create a new container if not already done so.

docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres

  1. If container already created, start the container

docker start <container name>

Info only: Other commands

Remove container docker rm -f <container name>

Create new react app npx create-react-app frontend

Create docker image docker build -t shopping-list:latest .

Run docker iamge docker run -p8080:8080 -it shopping-list:latest

Useful docker flags: -it run in ineractive mode --rm , removes containers when docker down, Note the 2 "--" before the flag...

Check status of docker containers docker ps -a

Check docker network docker network ls

docker network create <network name>

docker inspect <network name>

shoppinglistapi's People

Contributors

donnyhyon avatar donny-os 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.