Try it out at: reads.supergood.cloud
Read about it on: supergood.site
Finally, one review site to rule them all! Use any rating schema to review any type of media. Use rating systems from Goodreads, Letterboxd, IMDB and more to review books, movies, or your own custom media types.
This is a demo project for experimenting with Vue integrations inside of Django templates. The theory was that this could be the ultimate web framework combination -- all the simplicity and development velocity of Django matched with all of the power of a full JavaScript framework.
It did not turn out to be the ultimate web framework of my dreams. There are way too many gotchas and edge cases and complexity for me to really recommend this approach to anyone else (I'll write a more complete postmortem in the future). But the integration does work! And it might serve as inspiration for the next developer who wants to give it a shot.
Some of those fun Vue + Django integrations include:
- Vue SFC (Single File Componets) rendered as django templates
- Autocomplete dropdown form fields
- Support for Generic Model Relations in Django ModelForm Views
- Conditional Form sections
- And of course, a datepicker
- Python tooling: type-checking with mypy, packaging with Poetry, linting with pre-commit, multi-environment testing with nox
- Vitejs JavaScript tooling: TypeScript and Vue.js compilation, hot reloading, linting, bundling
- Styling: TailwindCSS, HeadlessUI, PostCSS
- Docker: containerization for multiple deployment environments
- Testing: with Pytest for Django code, jest and puppeteer for browser testing
- Install Python
- I recommend using pyenv to manage installations of python. Pyenv allows you to install and use multiple versions of python on the same computer.
- After pyenv is installed, run
pyenv local
inside this directory to install the version of python3 specified by the.python-version
file. - If you really don't want to use pyenv, any version of python 3.x should work fine.
- Install Poetry
- Poetry is the python dependency manager that this project uses. It can be installed here.
- Install python packages with Poetry.
make install
- Create a .env file.
make .env
- Install Nodejs
- I recommend using nvm to manage installations of node. nvm (node version manager) allows you to install and use multiple versions of nodejs on the same computer.
- After nvm is installed, run
nvm use
inside this directory to install the version of nodejs specified by the.nvmrc
file.
- Install Nodejs packages
npm install
- Run initial data migrations
poetry run python manage.py migrate
- Install seed data
poetry run python manage.py supergood_reads_load_test_data
Now that your dependencies have been installed, you're ready to run the app.
- Start the django server.
make up
- In a separate terminal window, start the nodejs server.
make vite
- Note: both servers must be running simultaneously for the app to function.
- Navigate to
http://localhost:8000/app/review
to try out the form. - The app is not yet complete. The only thing that is finished is the review form itself -- there isn't yet a page that renders all of the reviews you've inputted. But you can inspect the raw data:
make shell
- Once inside the shell, you can look at your raw django data. Example:
Review.objects.all()
- Build docker containers for local development
make build-local
- Start docker containers
make docker-up
You can find more commands in the Makefile.
If you want to make contributions to the project, you need to run one additional installation step.
- Install nox
pip install --upgrade nox
- Nox is used to manage the execution of this test suite. Nox is useful for testing reuseable external libraries that require testing across multiple versions of python or django.
- Install pre-commit
- https://pre-commit.com/#install to install the pre-commit program itself.
pre-commit install
to install the pre-commit hooks for this particular project.
- Run the python test suite.
make pytest
- Run the javascript test suite.
make jest
- Run linting for all files of the project.
make lint
- Check for vulnerabilities in external packages.
make safety
- Check for type errors in python code.
make mypy
SupergoodReads is fully extensible and allows developers to seamlessly add new review strategies and media types.
- Add your classes directly to a new
SupergoodReadsConfig
. - In your Django settings, add
SUPERGOOD_READS_CONFIG=[YourSupergoodReadsConfigClass]
- The rest of the site will be automatically generated around your config.
(See the DefaultSupergoodReadsConfig for an example.)
Test data was provided by these datasets: