Thank you for taking interest in contributing to Boilerplate! This document includes details on the application architecture, general project/code guidelines, and instructions on how to setup your local development environment.
- Table of Contents
- Architecture
- Workflow
- Project Guidelines
- Development Environment
- Recommended Tools
The overall architecture includes a React app that makes calls to a Rails API, persisting data in a PostgreSQL database.
flowchart LR
Frontend[React Frontend] --> API([Rails API]) --> DB[(PostgreSQL)]
See DEPLOYMENT.md for details on how the application is deployed to a production environment.
- Fork the repo
- This step may be skipped if you are a core contributor with write permissions to the repository
- Create a new branch for your work
- Make your changes and commit them
- Pull the develop branch, resolve any conflicts, and then push up your branch
- Create a pull request from your branch to the
develop
branch- Link the pull request to the issue for tracking
- Review your pull request, leaving any helpful notes/comments/context
- Assign at least one reviewer and respond to their feedback if any
- Once the reviewer has approved, the PR can be merged
It's recommended you follow the following format when creating branches for consistency:
<type>/<issue-num>-<name>
feature
- Work for features and enhancementsfix
- Work that fixes bugsdocs
- Work that affects documentation onlyspike
- Exploratory changes used to investigate potential solutions or approacheschore
- Miscellaneous changes such as clean up and configuration
Examples:
feature/123-add-grant-page
fix/167-users-not-able-to-login
docs/201-typo-in-readme
spike/333-explore-new-framework
chore/455-remove-unused-class
It's recommended you make small, atomic commits as you make changes so that it's easier to go back to a particular changes.
When making commit messages, limit the subject to 50 characters. When writing the subject, imagine each commit started with: "In this commit, it will...". E.g.:
Add dropdown component
Adjust navbar color
Extract method into separate class
For more complex changes capture the "why" and any other context in the commit message body.
Aim for small, isolated pull requests below 10 files changes. Anything bigger becomes more difficult to spot issues.
If you notice changes that could be made, but aren't related to the ticket you're working on, make a follow up issue so the change can be done in a separate PR.
If a ticket requires significant work to complete, break the work across multiple branches and pull requests to keep the diffs manageable. E.g.:
chore/123-extract-grant-logic-to-separate-class
chore/123-update-grant-logic-dependencies
chore/123-refactor-grant-logic
TODO
TODO
- Node v16
- Ruby v2.7.5
- Bundler v2.2.32
- Rails v6
- Postgres v14
# Inside api directory
$ bin/setup
$ bin/run # or bin/rails server
=> Booting Puma
boilerplate-api-1 | => Rails 6.0.3.7 application starting in development
boilerplate-api-1 | => Run `rails server --help` for more startup options
boilerplate-api-1 | Puma starting in single mode...
boilerplate-api-1 | * Version 4.3.12 (ruby 2.7.5-p203), codename: Mysterious Traveller
boilerplate-api-1 | * Min threads: 5, max threads: 5
boilerplate-api-1 | * Environment: development
boilerplate-api-1 | * Listening on tcp://0.0.0.0:3000
# Inside frontend directory
$ npm install
$ npm start
> [email protected] start
> vite
vite v2.9.14 dev server running at:
> Local: http://localhost:3001/
> Network: http://172.20.0.4:3001/
ready in 2189ms.
- VSCode