Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ngshiheng/burplist-frontend
A frontend repository for the Burplist project, built with Python
https://github.com/ngshiheng/burplist-frontend
craftbeer python pywebio sqlalchemy
Last synced: about 2 months ago
JSON representation
A frontend repository for the Burplist project, built with Python
- Host: GitHub
- URL: https://github.com/ngshiheng/burplist-frontend
- Owner: ngshiheng
- License: mit
- Created: 2021-04-24T01:12:02.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-15T21:51:14.000Z (2 months ago)
- Last Synced: 2024-11-02T03:04:38.599Z (about 2 months ago)
- Topics: craftbeer, python, pywebio, sqlalchemy
- Language: Python
- Homepage: https://burplist.com
- Size: 2.23 MB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Burplist Frontend
# What is this?
A frontend repository for https://burplist.com built using [PyWebIO](https://github.com/pywebio/PyWebIO).
The site serves as a search engine for craft beers in Singapore, providing craft beer lovers pricing information for their favorite beer.
I have documented some of my thought process and engineering decisions while creating Burplist [here](https://jerrynsh.com/how-i-built-burplist-for-free/). Enjoy!
# Development
## Requirements
- [Python](https://www.python.org/) 3.9+
- [poetry](https://python-poetry.org/docs/)
- [PostgreSQL](https://www.postgresql.org/)## Database
- Make sure you have a running instance of the latest PostgreSQL in your local machine
- Example to spin up a PostgreSQL Docker instance locally```sh
docker run -d --name dpostgres -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust postgres:latest
```- Create a new database name as `burplist`
- Ensure that `pg_trgm` is installed as your PostgreSQL extension```sql
CREATE EXTENSION pg_trgm;
```## How to install
```sh
poetry install# Installing dependencies only
poetry install --no-root# Updating dependencies to their latest versions
poetry update
```## Setup Pre-commit Hooks
Before you begin your development work, make sure you have installed [pre-commit hooks](https://pre-commit.com/index.html#installation).
Some example useful invocations:
- `pre-commit install`: Default invocation. Installs the pre-commit script alongside any existing git hooks.
- `pre-commit install --install-hooks --overwrite`: Idempotently replaces existing git hook scripts with pre-commit, and also installs hook environments.## Optional: Environment variables
Check out `/src/settings.py` and configure them accordingly.
# Usage
## How to run locally
```sh
poetry run python3 app.py --debug=True --port=8080
# At `http://localhost:8080/`
```## Start your database
You'll need to setup your Postgres locally based on the instructions [here](https://github.com/ngshiheng/burplist/#database). And then run:
```sh
docker start dpostgres
```## Optional: Using Docker
```sh
# build docker image.
make build# run local development server in docker.
make run
```Your server should be live at to http://localhost:8080.
# Deployment
This project is currently hosted on [Heroku](https://www.heroku.com/).
## Optional: Useful Heroku commands
```sh
heroku git:remote -a burplist-frontend-staging --staging# Print logs for staging
heroku logs --tail --remote staging# Print logs for production
heroku logs --tail --remote heroku
```## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
### Steps
1. Fork this
2. Create your feature branch (`git checkout -b feature/bar`)
3. Please make sure you have installed the `pre-commit` hook and make sure it passes all the lint and format check
4. Commit your changes (`git commit -am 'feat: add some bar'`, make sure that your commits are [semantic](https://www.conventionalcommits.org/en/v1.0.0/#summary))
5. Push to the branch (`git push origin feature/bar`)
6. Create a new Pull Request