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)
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
To get started with this project, follow these steps:
- Clone this repository to your local machine:
git clone [email protected]:agency-of-learning/PairApp.git
- Navigate to the project directory:
cd PairApp
- Run the setup script. This will install dependencies and create, migrate, and seed the database.
bin/setup
- 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.
If you need to work with the user registration/invitation process, follow these steps:
-
Make sure you are logged out of the application.
-
Open a Rails console session:
rails console
- In the console, run the following command to invite a user:
User.invite!(email: <some_test_email>)
-
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. -
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.
If you want to contribute to this project, please follow these steps:
- From your local clone, create a new branch for your changes:
git checkout -b your-feature-branch-name
- Make your changes and commit them:
git add .
git commit -m "Add your commit message here"
- Running Tests
bundle exec rspec
- Cleaning up before pushing
bundle exec rubocop -a
- Push your changes to origin:
git push origin your-feature-branch-name
- Create a new pull request on the original repository and wait for the maintainer to review and merge your changes.