Skip to content

erivandosena/crud-ruby

Repository files navigation

Ruby logo

Project Ruby

Status License


Aplicação de crud básico em Ruby

📝 Table of Contents

🧐 About

Quando o Rails recebe a URL, ele primeiro procura a URI no arquivo, que define, por padrão, todas as rotas da aplicação. Cada URI válido é mapeado para uma função localizada dentro de um Controlador, que é invocado para fornecer uma resposta à solicitação.

Ruby on Rails

Things you may want to cover:

  • Ruby version

  • System dependencies

  • Configuration

  • Database creation

  • Database initialization

  • How to run the test suite

  • Services (job queues, cache servers, search engines, etc.)

  • Deployment instructions

🏁 Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Docker
Linux Debian
Ruby on Rails
Tailwind CSS
Nginx Server
Passenger

Install Docker

curl https://releases.rancher.com/install-docker/20.10.sh | sh

To Install Docker in WSL/2

echo 'sudo gpasswd -a $USER docker' >> ~/.bashrc
echo 'sudo chmod 666 /var/run/docker.sock' >> ~/.bashrc
echo 'sudo /etc/init.d/docker start' >> ~/.bashrc
source ~/.bashrc

Installing

A step by step series of examples that tell you how to get a development env running.

echo "# crud-ruby" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/erivandosena/crud-ruby.git
git push -u origin main

Send to repository

git remote add origin https://github.com/erivandosena/crud-ruby.git
git branch -M main
git push -u origin main

Clean Docker Workspace local

docker stop $(docker ps -qa)
docker rm -f $(docker ps -qa)
docker rmi -f $(docker images -qa)
docker volume rm -f $(docker volume ls -q)
docker network rm $(docker network ls -q)

End with an example of getting some data out of the system or using it for a little demo.

🔧 Running the tests

Build image:
docker build -f ./Dockerfile -t erivando/app-crud-ruby:latest --build-arg VERSION=1.0.0 --build-arg COMMIT_SHA=$(git rev-parse HEAD) --no-cache .
docker tag erivando/app-crud-ruby:latest erivando/app-crud-ruby:v1.0.0
docker login
docker push erivando/app-crud-ruby:v1.0.0
Compose V2 (para Compose V1 use: docker-compose ...):
docker compose build --no-cache && docker compose up -d
docker compose exec app-crud bash
docker compose logs -f -t app-crud
docker compose down

Break down into end to end tests

Explain what these tests test and why

Give an example

And coding style tests

Explain what these tests test and why

Give an example

🎈 Usage

Run image:
docker run -it --rm -d -p 8030:80 --name app-crud --network=bridge erivando/app-crud-ruby:latest
docker exec -it app-crud /bin/bash
docker logs -f --tail --until=2s app-crud
docker rm -f app-crud

🚀 Deployment

Image Docker: https://hub.docker.com/r/erivando/app-crud-ruby

⛏️ Built Using

✍️ Authors

🎉 Acknowledgements

  • Hat tip to anyone whose code was used
  • Inspiration
  • References