Warning
WORK in PROGRESS
Uses: Django + DRF + Postgresql + Celery + IPFS + Scrapy
Requires Docker and docker-compose
docker-compose build
docker-compose up
The docker-compose
file defines two services:
-
database: Postgresql
-
service: django project with an API exposed in
http://localhost:9000
When running, migrations are checked and executed before running the wsgi server.
The .env
file should be the main configuration file for all the services.
For debugging purposes or to trigger django-admin commands, with both services running, open a bash session in the service container.
docker-compose run service bash
Run this once Configure superuser for Django's Admin Site
python manage createsuper user
Database introspection:
Open a psql
:
`docker-compose exec database psql -d skatepedia -U admin`
Open a Django shell or run any other django-admin commands.
docker-compose run service python manage.py shell
Warning
Spiders may become outdated, as scraped websites may change or go offline
docker-compose run service scrapy crawl <spider_name>
Open the openapi.yml specification.
or the Swagger UI.
Warning
Process for publishing on IPFS is a work in progress
docker-compose run service python manage.py distill-local staticsite
in the staticsite
folder run:
npx all-relative
Then upload the whole staticsite folder to IPFS to have a decentralized static site.
ipfs add -r staticsite
Go to https://ipfs.io/ipfs/[staticsite_folder_cid]/videos/funhouse-3.html
Huge thanks to everyone in the skateboarding community for contribuiting and collaborating. Special thanks to
- SkateVideoSite
- The Board
- http://skately.com Using Web Archive since original site is down.
- Django
- IPFS - InerplanetaryFileSystem
- Celery - Distributed Task Queue
- DRF - REST Framework
- django-filters
- DRF nested routes
- Scrapy
ipfs
skatepedia-api-ipfs-1 | Error: serveHTTPGateway: manet.Listen(/ip4/172.19.0.3/tcp/8080) failed: listen tcp4 172.19.0.3:8080: bind: cannot assign requested address
The docker-compose.yml
ipfs service overrides the default healthcheck. If the service can't bind an address:port there might be an error in the ipfs config, try deleting the ipfs_data
folder.