Skip to content

SyafiqTermizi/masak2

Repository files navigation

Backend Test Front End Test

masak2

Setting Up Locally

Prerequisites

  1. Make sure you have NodeJS and NPM installed
  2. Make sure you have Docker and docker-compose installed

Setting Up Backend App Locally

  1. Copy the content .env.example file to .env and change its values accordingly
  2. On your terminal run docker-compose up.
  3. To run migration, open another terminal and run docker exec -it <container_name> sh
  4. Then run poetry run masak2/manage.py migrate

Setting Up Frontend

  1. Install all front end deps by running npm install
  2. To start transpiling all JSX and CSS run npm run start

Running Test On Backend

  • While the backend docker container is running, run ``docker exec -it <container_name> sh` on a separate terminae
  • Then, type in poetry run pytest ./masak2 --cov-report html --cov=masak2

Running Test For Frontend

npm run test

Generating New Django Apps

django-admin startapps <APP_NAME>

Preparing for prod

  1. Build frontend
npm run build
  1. Collect static
docker-compose up
docker exec -it <container_name> sh
poetry run masak2/manage.py collectstatic --settings config.settings.prod
  1. Build docker container
docker build -t docker.pkg.github.com/syafiqtermizi/masak2/masak2:latest -f docker/prod.Dockerfile .
  1. Push docker container to registry

    docker login https://docker.pkg.github.com -u syafiqtermizi
    
    • Push the image
    docker push docker.pkg.github.com/syafiqtermizi/masak2/masak2:latest
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published