Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erivandosena/crud-ruby
Basic crud project in Ruby language
https://github.com/erivandosena/crud-ruby
crud-application docker docker-compose linux nginx passenger ruby ruby-on-rails tailwind
Last synced: 5 days ago
JSON representation
Basic crud project in Ruby language
- Host: GitHub
- URL: https://github.com/erivandosena/crud-ruby
- Owner: erivandosena
- License: mit
- Created: 2023-07-07T08:54:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-17T11:09:28.000Z (over 1 year ago)
- Last Synced: 2024-10-09T10:44:20.422Z (27 days ago)
- Topics: crud-application, docker, docker-compose, linux, nginx, passenger, ruby, ruby-on-rails, tailwind
- Language: Ruby
- Homepage:
- Size: 788 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Project Ruby
[![Status](https://img.shields.io/badge/status-active-success.svg)]() [![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)
---
Aplicação de crud básico em Ruby
## 📝 Table of Contents
- [](#)
- [Docker:](#docker)
- [Compose V2 (para Compose V1 use: docker-compose ...):](#compose-v2-para-compose-v1-use-docker-compose-)
- [Break down into end to end tests](#break-down-into-end-to-end-tests)
- [And coding style tests](#and-coding-style-tests)
- [🎈 Usage ](#-usage-)
- [🚀 Deployment ](#-deployment-)
- [⛏️ Built Using ](#️-built-using-)
- [✍️ Authors ](#️-authors-)
- [🎉 Acknowledgements ](#-acknowledgements-)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](https://softcover.s3.amazonaws.com/636/ruby_on_rails_tutorial_7th_edition/images/figures/mvc_detailed.png)
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
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See [deployment](#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
```bash
curl https://releases.rancher.com/install-docker/20.10.sh | sh
```
#### To Install Docker in WSL/2
```bash
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.
```bash
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
```bash
git remote add origin https://github.com/erivandosena/crud-ruby.git
git branch -M main
git push -u origin main
```Clean Docker Workspace local
```bash
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.
##### Build image:
```bash
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 ...):
```bash
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
```##### Run image:
```bash
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
```Image Docker: https://hub.docker.com/r/erivando/app-crud-ruby
- [SQLite](https://www.sqlite.org/index.html) - Database
- [Express](https://expressjs.com/) - Server Framework
- [VueJs](https://vuejs.org/) - Web Framework
- [NodeJs](https://nodejs.org/en/) - Server Environment- [@erivandosena](https://github.com/erivandosena) - Idea & Initial work
- Hat tip to anyone whose code was used
- Inspiration
- References