An open API service indexing awesome lists of open source software.

https://github.com/khlam/character_vault

Dungeons and Dragons 5e character repository
https://github.com/khlam/character_vault

Last synced: 7 months ago
JSON representation

Dungeons and Dragons 5e character repository

Awesome Lists containing this project

README

          

* Domain: access.engr.oregonstate.edu:{port}

* Setting up credentials
1. Edit your shells .rc file (for example .bashcs or .zshrc) adding the following lines.
#+BEGIN_SRC bash
export DATABASE_NAME="name of database"
export DATABASE_USER="your database user name"
export DATABASE_PASSWORD="your database password"
export DATABASE_HOST="your databases host"
#+END_SRC
2. Source your shell rc file
#+BEGIN_SRC bash
source .bashrc #For example
#+END_SRC
* Starting the server
1. Download the repo
#+BEGIN_SRC bash
git clone git@github.com:zermish/Character_Vault.git
#+END_SRC
2. cd to the project directory and install dependencies
#+BEGIN_SRC bash
cd Character_Vault
npm install
#+END_SRC
3. Run the server with local forever module
#+BEGIN_SRC bash
./node_modules/forever/bin/forever start server.js {port number goes here}
#+END_SRC

* Adding a new page
1. Create a {page name}.handlebars template in the views directory following handlebars conventions.

*Example Handlebars Template:*
#+BEGIN_SRC html



{{params.title}}



This is some normal html



{{#each data}}

{{this}}
{{/each}}

#+END_SRC
2. Add the page to the page_config.json file in the routes folder.
The page_config file is used to set which paths are valid and special parameters those paths are expecting.

In order to add a page to the file, create a new json object at the end of the list whos key matched the pages name exactly.

*For example:* if you made the page foo.handlebars the key should be "foo":{}.

Once added to the page_config file, the page will then be accessible from the path "/{page name}.

Inside the page object, parameters can be set that will be specific to the page, like:

#+BEGIN_SRC json
"foo":{
"title":"The Foobar page!",
"id":23
}
#+END_SRC

3. Note: All pages, other then the home page, will be passed 2 objects and an array automatically: paths (array of path names), params (object containing your specific page parameters defined earlier), and data (an object containing data to be displayed)

* Project specifications
- Your database should be pre-populated with sample data.
- Your database should have at least 4 entities and at least 4 relationships, one of which must be a many-to-many relationship.
- It should be possible to *INSERT entries into every table individually*.
- *Every table should be used in at least one SELECT query*. For the SELECT queries, it is fine to just display the content of the tables, but your website needs to also have the ability to *search using text or filter using a dynamically populated list of properties*. This search/filter functionality should be present for *at least one entity*. It is generally not appropriate to have only a single query that joins all tables and displays them.
- You need to include *one DELETE and one UPDATE function in your website, for any one of the entities*. In addition, it should be possible to *add and remove things from at least one many-to-many relationship* and it should be possible to add things to all relationships. This means you need *INSERT functionality for all relationships as well as entities*. And DELETE for at least one many-to-many relationship.
- In a one-to-many relationship (like bsg_people to bsg_planets), you should be able to set the homeworld value to NULL (such as on a person in bsg_people). That removes the relationship. In case none of the one-to-many relationships in your database has partial participation, you would need to change that to make sure they can have NULL values.
- In a many-to-many relationship, to remove a relationship one would need to delete a row from a table. That would be the case with bsg_people and bsg_certifications. One should be able to add and remove certifications for a person without deleting either bsg_people rows or bsg_certification rows. If you implement DELETE functionality on at least (1) many-to-many relationship table, such that the rows in the relevant entity tables are not impacted, that is sufficient.