afogel / PairApp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README

Agency of Learning's Pair App

Prerequisites

To set up this project, you need to have the following software installed on your computer:

  • Ruby 3.1.0
  • Rails 7.0.0 or higher
  • PostgreSQL 9.5 or higher
  • Redis 7.0 or later
  • Yarn or Npm
  • Heroku CLI (Follow the link for installation instructions)

12factor Approach

This project follows the 12factor methodology for building software-as-a-service applications. Specifically, this project adheres to the following 12 factors:

  • Codebase: One codebase tracked in version control, many deploys
  • Dependencies: Explicitly declare and isolate dependencies
  • Config: Store config in the environment
  • Backing services: Treat backing services as attached resources
  • Build, release, run: Strictly separate build and run stages
  • Processes: Execute the app as one or more stateless processes
  • Port binding: Export services via port binding
  • Concurrency: Scale out via the process model
  • Disposability: Maximize robustness with fast startup and graceful shutdown
  • Dev/prod parity: Keep development, staging, and production as similar as possible
  • Logs: Treat logs as event streams
  • Admin processes: Run admin/management tasks as one-off processes

Getting Started

To get started with this project, follow these steps:

  1. Clone this repository to your local machine:
git clone git@github.com:agency-of-learning/PairApp.git
  1. Navigate to the project directory:
cd PairApp
  1. Run the setup script. This will install dependencies and create, migrate, and seed the database.
bin/setup
  1. To start the project locally, run:
bin/dev

This will start the development server, the asset compiling for CSS and JS, and background worker. Open your web browser and go to http://localhost:3000 to see the application running.

Working with Devise Invitable

If you need to work with the user registration/invitation process, follow these steps:

  1. Make sure you are logged out of the application.

  2. Open a Rails console session:

rails console
  1. In the console, run the following command to invite a user:
User.invite!(email: <some_test_email>)
  1. The letter_opener gem should open a new tab in your browser with an invite link. If it doesn't, you can manually access the letter opener by opening http://localhost:3000/letter_opener.

  2. Click the invite link to get to the sign-up page where you can set a password. This will create a fully active account with the provided email and password.

Note: This flow is only necessary if you're building something around the user registration/invitation process. If you just want to create users, you can use User.create(**attrs) as usual.

Contributing

If you want to contribute to this project, please follow these steps:

  1. From your local clone, create a new branch for your changes:
git checkout -b your-feature-branch-name
  1. Make your changes and commit them:
git add .
git commit -m "Add your commit message here"
  1. Running Tests
  bundle exec rspec
  1. Cleaning up before pushing
  bundle exec rubocop -a
  1. Push your changes to origin:
git push origin your-feature-branch-name
  1. Create a new pull request on the original repository and wait for the maintainer to review and merge your changes.

About


Languages

Language:Ruby 76.0%Language:HTML 22.3%Language:JavaScript 1.0%Language:CSS 0.4%Language:Shell 0.2%Language:Procfile 0.1%