https://github.com/axeldeveloper/rails-app-easy-live
Projeto api rails - desafio easyLive
https://github.com/axeldeveloper/rails-app-easy-live
Last synced: 5 months ago
JSON representation
Projeto api rails - desafio easyLive
- Host: GitHub
- URL: https://github.com/axeldeveloper/rails-app-easy-live
- Owner: axeldeveloper
- Created: 2025-07-31T12:35:58.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-02T02:53:53.000Z (11 months ago)
- Last Synced: 2025-08-02T04:55:10.720Z (11 months ago)
- Language: Ruby
- Size: 64.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Projeto de desafio easy live
- rails 8
- api rest
- sidekiq
- postgres
# Create project
```sh
$ rails new rails-app-easy-live --api -T --database=postgresql
$ cd rails-app-easy-live
$ bundle install
$ gem install foreman
# Ele define comandos que são executados em paralelo com uma única linha de terminal
$ touch Procfile.dev
# is content in file
web: bundle exec rails server -p 3000
worker: bundle exec sidekiq -C config/sidekiq.yml
# ✅ Gerar o modelo
$ rails generate model User name:string external_id:integer:uniq
$ rails generate model Post title:string body:text external_id:integer:uniq user:references
$ rails generate model Comment body:text translated:text status:string external_id:integer:uniq post:references
$ rails generate model Keyword word:string:uniq
rails generate model UserMetrics total_comments:integer approved_comments:integer rejected_comments:integer user:references
$ rails dv:create
$ rails db:migrate
# or
$ rails db:setup
```
# Important `Create .env file`
```sh
# Database Configuration
POSTGRES_DB=rails_app_easy_live_development
POSTGRES_USER=postgres
POSTGRES_PASSWORD=
DATABASE_URL=
# Redis Configuration
REDIS_URL=redis://localhost:6379/0
# Rails Configuration
RAILS_ENV=development
RAILS_MASTER_KEY=$(cat config/master.key)
```
# Run - start app
```sh
# run docker compose for redis and postgresql database
$ docker compose up --build
# run rails app and worker sidekiq
$ foreman start -f Procfile.dev
# OR
$ rails server -p 3000
$ bundle exec sidekiq -C config/sidekiq.yml
```
# Observação
libretranslate requer uma api paga
Visit https://portal.libretranslate.com to get an API key