This repo contains the code used in the Learn Buffalo video course.
Updated Dec. 2023 to work with
go:embed
directive and other changes for Buffalo version 18.14
Sections Completed:
- Part 1: new project, static page, and route parameters
- Part 2: create a user model, add fields and methods, and test it
- Part 3: models and associations, one-to-one, one-to-many, many-to-many
- Part 4: using controllers with our models
- Part 5: HTML templates, partials and helpers
- Part 6: Forms, form_for() helper, form() helper, manually parse and grab form values from the request
- Part 7: Middleware and user authentication with Buffalo Plugins
- Part 8: Third-party Integrations and Events
- Part 9: CLI operations to build a production build, and other tasks
- Part 10: Develop and Deploy with Docker, using a cloud hosted database, or with docker-compose
Fork the project (if you want to commit and push your own changes).
Each part listed above has a matching branch. The branch for part-6, for example, is the end-state of the project code at the completion of video part-6. If you want to follow along with the part-6 video, you can checkout part-5
and start making changes.
After cloning the repo to your local machine, git checkout {branch-name}
to view the part.
When changing branches, use these handy buffalo commands to get a clean project state:
buffalo pop reset
- this will wipe the database and rebuild with the migrationsbuffalo task db:seed
- part-4 and beyond include a DB seed task; this will load the relevant data into your dev databasebuffalo test
- run the tests to make sure everything is working before you get startedbuffalo dev
- run the dev server to see the site in your browser
The project site http://gobuffalo.io has lots of great documentation there.