Git Product home page Git Product logo

buggy's Introduction

Buggy

Youtube link sharing newfeed.

Use Rails7 (Ruby3.1.1) + Stimulus for js (quite interesting)

Database: Postgresql

Run

By docker on port 5432.

docker compose up

Rails setup

./bin/rails db:create
./bin/rails db:migrate
./bin/rails db:seed:replant
./bin/rails db:rollback STEP=x

Model observe: Annotate

./bin/bundle add annotate --group development
./bin/rails g annotate:install

User management: Devise

./bin/bundle add devise
./bin/rails g devise:install
./bin/rails g devise User
./bin/rails g devise:views

Add username to user (for login by email/username)

./bin/rails g migration add_username_to_users username:string:uniq
./bin/rails db:migrate

Formatting: Rubocop

./bin/bundle add rubocop rubocop-rails rubocop-rspec -g development -g test

Interface CSS: Tailwindcss

./bin/bundle add tailwindcss-rails
./bin/rails tailwindcss:install

Create page and controller

Controller: Home

./bin/rails g controller Home index

Model: Medium

./bin/rails g model Medium title:string url:string:not_null description:text user:references
./bin/rails db:migrate

Controller: Sharing

./bin/rails g controller Sharing create

Pagination: Kaminari

./bin/bundle add kaminari
./bin/rails g kaminari:config
./bin/rails g kaminari:views default -e erb

Test: RSpec

# Gemfile
gem 'rspec-rails', '~> 6.0.0.rc1'

./bin/bundle

./bin/rails g rspec:install

./bin/bundle add factory_bot_rails

# for integration test
./bin/bundle add apparition launchy capybara--group test

Generate test model

./bin/rails g rspec:model user
./bin/rails g rspec:model medium

Test

./bin/bundle exec rspec

Other

HttpClient: Faraday

./bin/bundle add faraday faraday-net_http

Sample image

signup home login

home-logged-in share-youtube-url share-youtube-url-done

showmore-showless pagination

buggy's People

Contributors

hoangnguyen679 avatar

Stargazers

Hoàng Anh Tú  avatar Hoang Pham avatar

Watchers

James Cloos avatar  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.