Using FastAPI (Python), mongo db (with pymongo), and Next-JS (React)
Pre-requisites:
- Docker &
docker-compose
- Clone the repo
$ git clone https://github.com/Sparrow1029/DnDdb.git- Build the application containers with docker-compose
$ cd DnDdb
$ dcomp up -d --buildFor the time being there is not a command to initialize the data for the database, so it will have to create it manually:
$ pip3 install pymongo # make sure to have pymongo installed, in a virtualenv or otherwise
$ cd raw_data
$ python3 init_db.pyThe above should populate the database with the data that is currently transposed from the OSRIC PDF.
The mongodb container should be running on localhost:27017
*NOTE: If you would like to interact with the mongodb from the CLI or with an application like MongoDB Compass the default connection string/URL for mongo is mongodb://dnd_admin:eulalia@localhost:27017
To view the Swagger documentation generated by Fast API, visit http://localhost:8002/docs in a web browser.
Creating a user & characters can be done using Postman (*recommended)
(too lazy to post how to do it with curl right now lol)
Visit http://localhost:3000 in a web browser to see the current state of the NextJS act (VERY MUCH still in early days...)