Puggies is developed with Go, React and Docker. If you want to contribute to Puggies you will need the following tools installed on your computer:
Once you have set up your dependencies you can fork the repository and begin developing:
git clone https://github.com/YOUR-GITHUB-USERNAME/puggies.git
cd puggies/frontend
yarn install
yarn start
# in another terminal window
cd puggies/backend
# edit the example .env file to suit your needs
cp .env.development.example .env
source .env
go run src/* serve
To have your changes merged, please submit a pull request on GitHub. Describe your changes in detail and ensure you have followed the pull request checklist.
- Use only Chakra Components (
<Box>
/<Flex>
/<Text>
as opposed to plain React components like<div>
or<p>
). The Chakra Documentation is your best friend! - Use
setState
where possible for component-local state. Usezustand
for global state by updating one of the stores insrc/stores
or by creating a new one. - Maintain type safety as much as possible. Avoid the use of
any
orobject
types
- Use the
http
package for status codes (http.StatusOK
instead of200
) - The response type for API routes should always be JSON. For a successful response,
place the data in the
message
field. For error responses, place the error string in theerror
field.
Database migrations are managed through
golang-migrate. If you need to make an
update to the database schema you must do so by generating a new migration. Use the
following command inside the backend
directory:
migrate create -ext sql -dir migrations -seq descriptive_migration_name_here
Use a descriptive yet concise name for the migration so developers know what it does. See the migration best practices documentation for more info.
When making updates to the demo parser it is important to increment the ParserVersion
.
This will signal to the backend that existing matches in the database were parsed with an
out-of-date parser and need to be re-analyzed.