Skip to content

AirLabJP/first_app

Repository files navigation

FirstApp 🚀

A modern, full-stack Ruby on Rails application built with cutting-edge technologies.

Rails Ruby TailwindCSS Hotwire

✨ Features

  • 🎨 Modern UI - Beautiful, responsive design with TailwindCSS
  • Hotwire - SPA-like experience with Turbo and Stimulus
  • 🧪 Comprehensive Testing - RSpec with FactoryBot and SimpleCov
  • 🔒 Security - Built-in security scanning with Brakeman
  • 📊 Code Quality - RuboCop linting with Rails and RSpec rules
  • 🚀 CI/CD Ready - GitHub Actions workflow for automated testing

🛠 Tech Stack

Backend

  • Ruby 3.3.0
  • Rails 7.1
  • SQLite3 (Development & Test)
  • Puma Web Server

Frontend

  • Hotwire (Turbo + Stimulus)
  • TailwindCSS 3.x
  • Import Maps for JavaScript
  • SassC for CSS preprocessing

Testing & Quality

  • RSpec - Testing framework
  • FactoryBot - Test fixtures
  • Faker - Fake data generation
  • SimpleCov - Code coverage (80% minimum)
  • Capybara + Selenium - System testing
  • RuboCop - Code linting
  • Brakeman - Security scanning
  • bundler-audit - Dependency vulnerability scanning

📋 Prerequisites

  • Ruby 3.3.0
  • Node.js 20.x or higher
  • SQLite3
  • Git

🚀 Getting Started

Installation

# Clone the repository
git clone https://github.com/AirLabJP/first_app.git
cd first_app

# Install Ruby dependencies
bundle install

# Install JavaScript dependencies
npm install

# Setup database
rails db:create db:migrate

# Setup Tailwind CSS
rails tailwindcss:install

Running the Application

# Start the Rails server
rails server

# In a separate terminal, watch Tailwind CSS changes
rails tailwindcss:watch

Visit http://localhost:3000 to see your application running!

🧪 Testing

# Run all tests
bundle exec rspec

# Run specific test file
bundle exec rspec spec/models/post_spec.rb

# Run with coverage report
COVERAGE=true bundle exec rspec

# View coverage report
open coverage/index.html

🎨 Code Quality

# Run RuboCop
bundle exec rubocop

# Auto-fix issues
bundle exec rubocop -A

# Run Brakeman security scan
brakeman

# Check for vulnerable dependencies
bundle audit --update

📁 Project Structure

first_app/
├── app/
│   ├── assets/
│   │   └── stylesheets/
│   │       └── application.tailwind.css
│   ├── controllers/
│   ├── javascript/
│   │   ├── controllers/          # Stimulus controllers
│   │   └── application.js
│   ├── models/
│   └── views/
├── config/
│   ├── tailwind.config.js
│   └── routes.rb
├── spec/
│   ├── factories/
│   ├── models/
│   ├── requests/
│   ├── rails_helper.rb
│   └── spec_helper.rb
├── .rubocop.yml
├── .rspec
└── Gemfile

🔧 Configuration

Tailwind CSS

Configuration is in config/tailwind.config.js. Custom utility classes are defined in app/assets/stylesheets/application.tailwind.css.

Hotwire

  • Turbo is enabled by default for all forms and links
  • Stimulus controllers are in app/javascript/controllers/
  • Import maps configuration in config/importmap.rb

📝 Development Workflow

  1. Create a feature branch

    git checkout -b feature/your-feature
  2. Make your changes

  3. Run tests and linting

    bundle exec rspec
    bundle exec rubocop
  4. Commit your changes

    git commit -am "Add your feature"
  5. Push and create a Pull Request

    git push origin feature/your-feature

🚀 Deployment

This application is ready for deployment on:

  • Heroku
  • Fly.io
  • Railway
  • Render

Make sure to:

  1. Set up production database (PostgreSQL recommended)
  2. Configure environment variables
  3. Precompile assets
  4. Run migrations

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is open source and available under the MIT License.

🙏 Acknowledgments

  • Rails Team for the amazing framework
  • Hotwire for modern frontend tools
  • TailwindCSS for beautiful styling
  • The Ruby community

📧 Contact

Air - @Air_RSTC

Project Link: https://github.com/AirLabJP/first_app


Built with ❤️ using Ruby on Rails 7, Hotwire, and TailwindCSS

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published