Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
282 commits
Select commit Hold shift + click to select a range
b5becbb
Merge pull request #7 from kryptokardz/cody-mon
thejohnjensen Dec 18, 2017
c9880c1
Merge branch 'development' into blockchain
thejohnjensen Dec 18, 2017
44b23cb
Merge pull request #8 from kryptokardz/blockchain
thejohnjensen Dec 18, 2017
5e21864
merging from development
chaitanyanarukulla Dec 18, 2017
ab66810
updated allowed hosts
markreynoso Dec 19, 2017
64ecb5b
Changes
markreynoso Dec 19, 2017
71f3c7e
its alive!
markreynoso Dec 19, 2017
6b3e8a5
fixed merge conflicts with development
markreynoso Dec 19, 2017
db858c9
Merge pull request #9 from kryptokardz/mark_mon
markreynoso Dec 19, 2017
60b32b0
pushing updates, deleted migrations
thejohnjensen Dec 19, 2017
25da09e
merg party
chaitanyanarukulla Dec 19, 2017
4d1b09f
merge conflicts
thejohnjensen Dec 19, 2017
5f2ecc4
merge
chaitanyanarukulla Dec 19, 2017
4c03937
removed excess requirements, removed pdb, added comma and floating co…
hcodydibble Dec 19, 2017
e13e4cf
Merge pull request #10 from kryptokardz/cody-mon
markreynoso Dec 19, 2017
9ffbc55
added comma
markreynoso Dec 19, 2017
d0088f2
Merge branch 'development' into mark_mon
markreynoso Dec 19, 2017
8954666
git merge
chaitanyanarukulla Dec 19, 2017
030dbf3
removed second requirements
thejohnjensen Dec 19, 2017
f9619a5
added comma
thejohnjensen Dec 19, 2017
bb172b0
git merge
chaitanyanarukulla Dec 19, 2017
6847a14
d
chaitanyanarukulla Dec 19, 2017
2aec479
setting up rds
markreynoso Dec 19, 2017
d7770b3
added tests
thejohnjensen Dec 19, 2017
09508f1
Added test for home page and mining page
chaitanyanarukulla Dec 19, 2017
ab86fb3
rds connected, site broken
markreynoso Dec 19, 2017
3eada95
Test for mining app.
chaitanyanarukulla Dec 19, 2017
3b4243b
updated upstart
markreynoso Dec 19, 2017
bb2f527
changed mining html location
thejohnjensen Dec 19, 2017
fd5bac6
fixed merge conflicts
thejohnjensen Dec 19, 2017
6a51ef4
trying to fix aws
thejohnjensen Dec 19, 2017
4465560
updated settings
thejohnjensen Dec 19, 2017
d9173bd
Merge pull request #11 from kryptokardz/trytofixaws
hcodydibble Dec 19, 2017
8b67194
more monster images
hcodydibble Dec 19, 2017
ecc17d3
Merge branch 'development' into cody-tue
hcodydibble Dec 19, 2017
6720e33
removed minotaur (he needs work) and added jquery cdn for the future …
hcodydibble Dec 19, 2017
a361d7b
updated base html login logout
chaitanyanarukulla Dec 19, 2017
dfa5bd6
added login and registration, now to add css
hcodydibble Dec 19, 2017
6a8cb7f
Updated Css for login and reg pages
chaitanyanarukulla Dec 19, 2017
de5f7af
changed images to png files with transparent backgrounds
hcodydibble Dec 19, 2017
cf1234c
working on the mining views
thejohnjensen Dec 19, 2017
bda338e
started profile view, refactored css
markreynoso Dec 19, 2017
00ab2d2
added commits from remote
thejohnjensen Dec 19, 2017
d7cfbea
Merge pull request #12 from kryptokardz/chai2
markreynoso Dec 19, 2017
b43545e
Merge pull request #13 from kryptokardz/cody-tue
markreynoso Dec 19, 2017
ea5342b
Merge branch 'development' into blockchain
thejohnjensen Dec 19, 2017
3a083cf
Merge pull request #14 from kryptokardz/blockchain
markreynoso Dec 19, 2017
139f80d
Merge branch 'development' into mark_tues
markreynoso Dec 19, 2017
88ddf01
Merge pull request #15 from kryptokardz/mark_tues
markreynoso Dec 19, 2017
5ddc576
mining new block is working with view
thejohnjensen Dec 19, 2017
2a1d125
moved home view tests to cryptomonsters app
hcodydibble Dec 19, 2017
c675da9
profile page displays users monsters
markreynoso Dec 19, 2017
0a021ad
one failing test
hcodydibble Dec 19, 2017
9016207
Addded test for login , registartion and logout page
chaitanyanarukulla Dec 19, 2017
c300039
Merge pull request #16 from kryptokardz/blockchain
markreynoso Dec 19, 2017
a0bd69a
Merge branch 'development' into cody-tue
markreynoso Dec 19, 2017
bbab1d9
Merge pull request #17 from kryptokardz/cody-tue
markreynoso Dec 19, 2017
3b35abf
Merge branch 'development' into chai2
markreynoso Dec 19, 2017
969d961
Merge pull request #18 from kryptokardz/chai2
markreynoso Dec 19, 2017
72f1e42
Merge branch 'development' into mark_tues
markreynoso Dec 19, 2017
73a4764
Merge pull request #19 from kryptokardz/mark_tues
markreynoso Dec 19, 2017
5017697
added unique id to model
thejohnjensen Dec 19, 2017
4ab96c1
Merge pull request #20 from kryptokardz/blockchain
thejohnjensen Dec 19, 2017
e5d5491
altered profile page
markreynoso Dec 19, 2017
9489e20
Merge branch 'development' into mark_tues
markreynoso Dec 19, 2017
0dd8337
Added more test for registration and logout page
chaitanyanarukulla Dec 19, 2017
57a6574
added unique id from db pk
thejohnjensen Dec 19, 2017
18925e1
five nonsense tests
hcodydibble Dec 19, 2017
21c321e
mf ansible
thejohnjensen Dec 19, 2017
a17591e
Update upstart_config
hcodydibble Dec 19, 2017
04640d9
updated forms, added update user view, made new iam user
markreynoso Dec 20, 2017
40b61d9
uncommented playbook commands
markreynoso Dec 20, 2017
9a4b5f7
Merge pull request #21 from kryptokardz/blockchain
markreynoso Dec 20, 2017
b1ed705
fixed merge conflict in mining/views
markreynoso Dec 20, 2017
7545018
added blockchain .json
thejohnjensen Dec 20, 2017
ec2d9ff
playbook update
markreynoso Dec 20, 2017
8f6153e
Merge pull request #22 from kryptokardz/blockchain
thejohnjensen Dec 20, 2017
8e868d9
Merge branch 'development' into mark_tues
markreynoso Dec 20, 2017
612ebdb
Merge pull request #24 from kryptokardz/mark_tues
hcodydibble Dec 20, 2017
dd8126b
Merge branch 'development' into cody-tue
hcodydibble Dec 20, 2017
75ce947
tests for user update view
markreynoso Dec 20, 2017
6e6c1b2
updated requirements, added factory boy
markreynoso Dec 20, 2017
e56fc6d
updated json
thejohnjensen Dec 20, 2017
60e5a24
Merge pull request #33 from kryptokardz/mark_tues
thejohnjensen Dec 20, 2017
327b038
Merge branch 'development' into blockchain
thejohnjensen Dec 20, 2017
7ca7c99
Merge pull request #34 from kryptokardz/blockchain
thejohnjensen Dec 20, 2017
9ba6ff8
password reset is a go
hcodydibble Dec 20, 2017
0b50b60
Merge pull request #35 from kryptokardz/cody-tue
hcodydibble Dec 20, 2017
8bde98a
moved navbar to its own template
hcodydibble Dec 20, 2017
b870ee6
Fixed all failing test Updated Readme added more test for views
chaitanyanarukulla Dec 20, 2017
9e518e8
Merge pull request #36 from kryptokardz/cody-wed
hcodydibble Dec 20, 2017
8531b9a
Merge pull request #37 from kryptokardz/chai2
hcodydibble Dec 20, 2017
0f0fec8
debug set to true and using s3
thejohnjensen Dec 20, 2017
08ace6a
made changes to blockchain.py to see if it can point to the correct s…
hcodydibble Dec 20, 2017
3096349
minor text fix
hcodydibble Dec 20, 2017
f5f0e22
minor text fix
hcodydibble Dec 20, 2017
e668e67
added url to profile img
thejohnjensen Dec 20, 2017
8faa48d
added to blockchain so it has static file url
thejohnjensen Dec 20, 2017
ac47aef
Added travic.yml coverage and coveragerc file
chaitanyanarukulla Dec 20, 2017
e43b174
keeping json serving locally
thejohnjensen Dec 20, 2017
87beeb8
fixed typo in file path
thejohnjensen Dec 20, 2017
c8dcdf6
changed json file path lookup for blockchain
thejohnjensen Dec 20, 2017
64b2724
changed permissions on json file so it works now.
thejohnjensen Dec 20, 2017
c1fe991
Updated to run test with Django NoseTestSuiteRunner
chaitanyanarukulla Dec 20, 2017
34d157a
added four new monster images
hcodydibble Dec 20, 2017
11ae861
changed blockchain and models to include new monsters
hcodydibble Dec 20, 2017
2a8b714
Added more functional test
chaitanyanarukulla Dec 20, 2017
6f4d660
Added Coveragerc file
chaitanyanarukulla Dec 20, 2017
971c81a
saving the monster after assigning id
thejohnjensen Dec 20, 2017
5bbc390
added monster page/view
markreynoso Dec 20, 2017
a239966
Merge branch 'development' into mark_wed
markreynoso Dec 20, 2017
23465b3
changed playbook
thejohnjensen Dec 20, 2017
103724a
two more monster images and blockchain/model update
hcodydibble Dec 20, 2017
e292b58
Update README.md
chaitanyanarukulla Dec 20, 2017
8ff40c3
Updated test blockchain test still failing
chaitanyanarukulla Dec 20, 2017
4c017c6
git
chaitanyanarukulla Dec 20, 2017
92d2348
ReadMe
chaitanyanarukulla Dec 20, 2017
ad1e727
Fail tests in blockchain
chaitanyanarukulla Dec 20, 2017
ab44d86
Updated monsters test
chaitanyanarukulla Dec 20, 2017
759e6b0
added goblin and updated blockchain/model
hcodydibble Dec 20, 2017
7e90ae9
minor text fix
hcodydibble Dec 20, 2017
da3b4a9
added _ to methods to make them super duper secret
hcodydibble Dec 20, 2017
aa765f7
updated css for monter view
markreynoso Dec 20, 2017
aa05434
Updated Requirements.txt
chaitanyanarukulla Dec 20, 2017
cf30286
Merge pull request #39 from kryptokardz/blockchain
markreynoso Dec 20, 2017
2e83962
Merge pull request #40 from kryptokardz/chai2
markreynoso Dec 20, 2017
f923d7c
Merge pull request #41 from kryptokardz/mark_wed
markreynoso Dec 20, 2017
e2eb84e
added monster backstories
hcodydibble Dec 20, 2017
e9646a7
Merge branch 'development' into cody-wed
markreynoso Dec 20, 2017
e32c031
Merge pull request #38 from kryptokardz/cody-wed
markreynoso Dec 20, 2017
54fd2d1
moster view errors
markreynoso Dec 20, 2017
7664745
Merge branch 'development' into mark_wed
markreynoso Dec 20, 2017
b788e49
merge conflict fix
hcodydibble Dec 20, 2017
6e68284
last time merge conflict
hcodydibble Dec 20, 2017
3890763
monster issues
markreynoso Dec 20, 2017
1587a69
ansible test
hcodydibble Dec 20, 2017
369c474
ansible test
hcodydibble Dec 20, 2017
f4dea00
ansible test
hcodydibble Dec 20, 2017
4b422f4
ansible test
hcodydibble Dec 20, 2017
99a1ff6
ansible test
hcodydibble Dec 20, 2017
170331d
ansible test
hcodydibble Dec 20, 2017
f17b154
pagination on monster page working
markreynoso Dec 20, 2017
3272d25
ansible test
hcodydibble Dec 20, 2017
df375d2
ansible test
hcodydibble Dec 20, 2017
95dbd1b
ansible test
hcodydibble Dec 20, 2017
8887eca
deleted migrations
markreynoso Dec 20, 2017
9bb8e5b
cleared blockchain and reinitialized monster migrations
markreynoso Dec 20, 2017
d51b47d
ugh
markreynoso Dec 21, 2017
f58d2ed
proof of work legit hard
markreynoso Dec 21, 2017
d40f4ec
returned difficulty to easy as f
markreynoso Dec 21, 2017
7c18494
Merge pull request #45 from kryptokardz/cody-wed
thejohnjensen Dec 21, 2017
f44eb75
Merge branch 'development' into mark_wed
thejohnjensen Dec 21, 2017
f2fdcc3
Merge pull request #46 from kryptokardz/mark_wed
thejohnjensen Dec 21, 2017
2048560
added ogre and changed registration css
hcodydibble Dec 21, 2017
5a13a5f
auto redirect on activation success
hcodydibble Dec 21, 2017
ed0c20a
removed image rounding on all monsters html
hcodydibble Dec 21, 2017
30562f3
added about section and a mascot monster
hcodydibble Dec 21, 2017
cde2738
Merge pull request #49 from kryptokardz/cody-wed
hcodydibble Dec 21, 2017
eb50792
added more authentication things
hcodydibble Dec 21, 2017
aba2d3d
Merge pull request #50 from kryptokardz/cody-wed
hcodydibble Dec 21, 2017
9db3cfa
settings change
hcodydibble Dec 21, 2017
f5f12ba
Merge pull request #51 from kryptokardz/cody-wed
hcodydibble Dec 21, 2017
e1aae64
settings change
hcodydibble Dec 21, 2017
2fa0180
settings change
hcodydibble Dec 21, 2017
00f726d
settings change
hcodydibble Dec 21, 2017
adb64ef
settings change
hcodydibble Dec 21, 2017
4f23d6f
Merge pull request #52 from kryptokardz/cody-wed
markreynoso Dec 21, 2017
034698e
blockchain view and pagination
markreynoso Dec 21, 2017
3933de2
tested blockchain
markreynoso Dec 21, 2017
63fd3df
Merge branch 'development' into mark_wed
hcodydibble Dec 21, 2017
8f6b6eb
Merge pull request #53 from kryptokardz/mark_wed
hcodydibble Dec 21, 2017
9510c0d
ansible
hcodydibble Dec 21, 2017
3ee95db
currently have a very simple celery function working while creating a…
thejohnjensen Dec 21, 2017
2adb20b
stuff
hcodydibble Dec 21, 2017
2876454
finally made it so you can scroll through your monsters on your profi…
hcodydibble Dec 21, 2017
160285d
now it works damn css
hcodydibble Dec 21, 2017
36e5b16
updated Readme
chaitanyanarukulla Dec 21, 2017
1b79415
Merge branch 'development' into cody-wed
hcodydibble Dec 21, 2017
0baa871
Merge pull request #54 from kryptokardz/cody-wed
hcodydibble Dec 21, 2017
bd14edd
merge
chaitanyanarukulla Dec 21, 2017
b1d2bae
update
chaitanyanarukulla Dec 21, 2017
3b37169
so begins the clean up
hcodydibble Dec 21, 2017
516a964
css overhaul
hcodydibble Dec 21, 2017
5f5ec92
currently have celery working, need to clean up code.
thejohnjensen Dec 21, 2017
30bd809
added blockchain view pagination and changed debug settings
hcodydibble Dec 21, 2017
7812c27
ready to merge???
thejohnjensen Dec 21, 2017
2be2195
fixed merge conflicts
thejohnjensen Dec 21, 2017
83703c2
Merge pull request #55 from kryptokardz/async
thejohnjensen Dec 21, 2017
1ea4670
Merge pull request #57 from kryptokardz/chai4
thejohnjensen Dec 21, 2017
c3b54f4
Merge branch 'development' into css-clean-up
thejohnjensen Dec 21, 2017
c02fd04
Merge pull request #56 from kryptokardz/css-clean-up
thejohnjensen Dec 21, 2017
ef40460
added mining goblin gif
hcodydibble Dec 21, 2017
480d985
Merge pull request #58 from kryptokardz/css-clean-up
markreynoso Dec 21, 2017
b52b424
deleted new_block.html added buttons
thejohnjensen Dec 21, 2017
b52679c
Merge pull request #59 from kryptokardz/async
thejohnjensen Dec 21, 2017
716ad85
added goblins
thejohnjensen Dec 21, 2017
1f52e5a
Merge pull request #60 from kryptokardz/async
thejohnjensen Dec 21, 2017
230b4dc
working on celery
thejohnjensen Dec 21, 2017
75d7586
celery
thejohnjensen Dec 21, 2017
0604419
celery
thejohnjensen Dec 22, 2017
51b084e
updated functions in monsters models for naming and stat making and c…
hcodydibble Dec 22, 2017
839aef6
celery
thejohnjensen Dec 22, 2017
f897ffa
minor text fix
hcodydibble Dec 22, 2017
ddb1ba3
celery
thejohnjensen Dec 22, 2017
9b84d7d
Merge pull request #61 from kryptokardz/cody-thur
hcodydibble Dec 22, 2017
40faeb6
fixed pow issue
thejohnjensen Dec 22, 2017
b3f0fb0
celery
thejohnjensen Dec 22, 2017
857aa39
stuff broke
thejohnjensen Dec 22, 2017
113e99f
changed stuff
thejohnjensen Dec 22, 2017
26f1b12
changing
thejohnjensen Dec 22, 2017
e24f1e5
blockchain
thejohnjensen Dec 22, 2017
bd84e62
blockchain stuff again
thejohnjensen Dec 22, 2017
56bcd2d
changed 2 zeros
thejohnjensen Dec 22, 2017
e9e17c2
3 zeros
thejohnjensen Dec 22, 2017
7003026
4 zeros
thejohnjensen Dec 22, 2017
96498c8
added print statement if prev block changes
thejohnjensen Dec 22, 2017
18f426b
removed if statement
thejohnjensen Dec 22, 2017
88e039a
5 zeros
thejohnjensen Dec 22, 2017
712c9cd
tests!
markreynoso Dec 22, 2017
663a489
fixed merge conflict
markreynoso Dec 22, 2017
41a2db4
tests!
markreynoso Dec 22, 2017
5b90e77
added normal names 50/50
thejohnjensen Dec 22, 2017
bf5b62e
getting names to work
thejohnjensen Dec 22, 2017
510e3f9
name stuff
thejohnjensen Dec 22, 2017
4c8f5a9
gif resize
thejohnjensen Dec 22, 2017
f33d2db
working on names
thejohnjensen Dec 22, 2017
9014314
added name and nonce to celery print out, cool
thejohnjensen Dec 22, 2017
45644c4
tests, removed coverage html
markreynoso Dec 22, 2017
288d4d5
Merge pull request #63 from kryptokardz/mark_thurs
markreynoso Dec 22, 2017
05ea396
fixed merge conflicts
thejohnjensen Dec 22, 2017
9a5f58b
Merge pull request #64 from kryptokardz/async
thejohnjensen Dec 22, 2017
7dcf0f2
social media login is a go!
hcodydibble Dec 22, 2017
356282a
Merge branch 'development' into social-media
hcodydibble Dec 22, 2017
d3fac0c
pip freeze into requirements.txt
hcodydibble Dec 22, 2017
99bf9aa
Merge pull request #65 from kryptokardz/social-media
hcodydibble Dec 22, 2017
c7f7f93
git
chaitanyanarukulla Dec 22, 2017
57de5c2
added docstrings
thejohnjensen Dec 22, 2017
7d04b3b
Merge pull request #66 from kryptokardz/async
thejohnjensen Dec 22, 2017
ecd47d3
tests, cleanup
markreynoso Dec 22, 2017
0d09de8
Readme
chaitanyanarukulla Dec 22, 2017
37bc313
Merge branch 'development' into mark_thurs
markreynoso Dec 22, 2017
3a9b65c
Merge pull request #67 from kryptokardz/mark_thurs
markreynoso Dec 22, 2017
177cbb0
Merge pull request #68 from kryptokardz/chai4
hcodydibble Dec 22, 2017
759bf1c
minor text fix
hcodydibble Dec 22, 2017
132a140
import order
markreynoso Dec 22, 2017
d7cb57c
Merge pull request #69 from kryptokardz/social-media
hcodydibble Dec 22, 2017
9aeda58
Merge pull request #70 from kryptokardz/mark_thurs
markreynoso Dec 22, 2017
ff47abb
minor text fix
hcodydibble Dec 22, 2017
1dd29d9
Merge pull request #71 from kryptokardz/social-media
hcodydibble Dec 22, 2017
8248dd7
Merge pull request #72 from kryptokardz/development
markreynoso Dec 23, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
8 changes: 8 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[run]
omit = ../*migrations*
/*__init__.py*
/*settings.py*
/*mining/admin.py*
/*monsters/admin.py*


76 changes: 76 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,79 @@ ENV/

# mypy
.mypy_cache/


wow-master/

# Created by https://www.gitignore.io/api/pycharm

### PyCharm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries

# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml

# Gradle:
.idea/**/gradle.xml
.idea/**/libraries

# CMake
cmake-build-debug/

# Mongo Explorer plugin:
.idea/**/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Ruby plugin and RubyMine
/.rakeTasks

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### PyCharm Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
.idea/sonarlint

# End of https://www.gitignore.io/api/pycharm

credentials.csv
hosts
keys
31 changes: 31 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
language: python
python:
- "3.6"
notifications:
email: false

services:
- postgresql

before_script:
- psql -c "create database cryptomonsters;" -U postgres

#set some environment variables
env:
- DB_NAME=cryptomonsters DB_USER=postgres DB_HOST='127.0.0.1' SECRET_KEY='potato' DEBUG='True'

# command to install dependencies
install:
- pip install -r requirements.txt
- pip install coveralls

# commands to run tests
script:
- python cryptomonsters/manage.py migrate
- coverage run cryptomonsters/manage.py test cryptomonsters

after_success:
- coveralls

notifications:
email: false
127 changes: 126 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,126 @@
# cryptocards
# CryptoMonsters

A card trading game that uses blockchain technology in order for players to get cards. Each card would then be owned securely by the player in their digital wallet. Players would get cards either by "mining" for them, trading with other players, or melding two cards to create a new card. Each card would have specific attribute genetics that could be passed on to their children.

This is a work in progress and hopefully we will remember to keep this updated as we move along.


## Authors
**[Cody Dibble](https://www.github.com/hcodydibble)** -
**[Mark Reynoso](https://www.github.com/markreynoso)** -
**[John Jensen](https://www.github.com/thejohnjensen)** -
**[Chaitanya Narukulla](https://www.github.com/chaitanyanarukulla)**-

## Artist
Artwork by **Travis Koon**

Backstories by **Matthew Cornmesser**

Mining goblins by **[Dillon Wall](https://www.dillonwall.com)**


## Backstory


## Getting Started

Clone this repository to your local machine.
```
$ git clone https://github.com/kryptokardz/cryptocards.git
```

Once downloaded, change directory into the `cryptocards` directory.
```
$ cd cryptocards
```

Begin a new virtual environment with Python 3 and activate it.
```
cryptocards $ python3 -m venv ENV
cryptocards $ source ENV/bin/activate
```

Install the application requirements with [`pip`](https://pip.pypa.io/en/stable/installing/).
```
(ENV) cryptocards $ pip install -r requirements.txt
```

Create a [Postgres](https://wiki.postgresql.org/wiki/Detailed_installation_guides) database for use with this application.
```
(ENV) cryptocards $ createdb cryptomonsters
```

Export environmental variables pointing to the location of database, your username, hashed password, and secret
```
(ENV) cryptocards $ export SECRET_KEY='secret'
(ENV) cryptocards $ export DB_NAME='cryptomonsters'
(ENV) cryptocards $ export DB_USER='(your postgresql username)'
(ENV) cryptocards $ export DB_PASS='(your postgresql password)'
(ENV) cryptocards $ export DB_HOST='localhost'
(ENV) cryptocards $ export DEBUG='True'
```

Then initialize the database with the `migrate` command from `manage.py`
```
(ENV) cryptocards $ python cryptomonsters/manage.py migrate
```

Once the package is installed and the database is created, start the server with the `runserver` command from `manage.py`
```
(ENV) cryptocards $ python cryptomonsters/manage.py runserver
```

Application is served on http://localhost:8000

## Testing
You can test this application by first exporting an environmental variable pointing to the location of a testing database, then running the `test` command from `manage.py`.
```
(ENV) cryptocards $ export TEST_DB='cryptotests'
(ENV) cryptocards $ python cryptomonsters/manage.py test cryptomonsters
```

## Deploying
You can deploy this application to AWS using Ansible.

Sign Up for AWS](https://aws.amazon.com/)

[Setting Up with Amazon EC2](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/get-set-up-for-amazon-ec2.html)

[Launch an Instance]
(http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html)
```

Create a `hosts` file in the root of `cryptocards`
```
[us-west-2]
(your EC2 public IP address)

[us-west-2:vars]
ansible_ssh_user=(your EC2 user)
ansible_ssh_private_key_file=/path/to/your/key.pem

server_dns=(your EC2 public DNS)
secret_key='secret'
db_name='(your RDS database name)'
db_host='(your RDS endpoint)'
db_user='(your RDS username)'
db_pass='(your RDS password)'
test_db='test_cryptomonsters'
allowed_hosts='(your EC2 public DNS) (your EC2 public IP address)'

aws_storage_bucket_name='(your S3 bucket name)'
aws_access_key_id='(your IAM user access key id)'
aws_secret_access_key='(your IAM user secret access key)'

admin_email='(your email address for admin)'
admin_email_host='(host for your admin email)'
admin_email_pass='(password for your admin email)'
```

Deploy the application with `ansible-playbook`
```
(ENV) cryptocards $ ansible-playbook -i hosts playbook/cryptomonsterswire_playbook.yml
```

## Architecture
Built with Python Django and Bootstrap framework. Tested through Django testing suite.
Binary file added cryptomonsters/.DS_Store
Binary file not shown.
12 changes: 12 additions & 0 deletions cryptomonsters/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[run]
omit = ../*migrations*
*cryptomonsters/settings.py*
*mining/admin.py*
*monsters/admin.py*
*cryptomonsters/celery.py*
*mining/tasks.py*
*cryptomonsters/__init__.py*
*monsters/models.py*

[report]
show_missing = True
1 change: 1 addition & 0 deletions cryptomonsters/categories.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cryptomonsters/confusables.json

Large diffs are not rendered by default.

Binary file added cryptomonsters/cryptomonsters/.DS_Store
Binary file not shown.
7 changes: 7 additions & 0 deletions cryptomonsters/cryptomonsters/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from __future__ import absolute_import, unicode_literals

# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app

__all__ = ['celery_app']
29 changes: 29 additions & 0 deletions cryptomonsters/cryptomonsters/celery.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from __future__ import absolute_import, unicode_literals
import os
from django.conf import settings
from celery import Celery

# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'cryptomonsters.settings')

# app = Celery('proj')
# settings.configure()
app = Celery('cryptomonsters',
broker='redis://localhost',
# backend='db+postgresql://localhost:5432/async_tasks'
backend='redis://localhost'
)
CELERY_IMPORTS = ["mining.tasks"]
# Using a string here means the worker doesn't have to serialize
# the configuration object to child processes.
# - namespace='CELERY' means all celery-related configuration keys
# should have a `CELERY_` prefix.
app.config_from_object('django.conf:settings', namespace='CELERY')

# Load task modules from all registered Django celery configs.
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)


@app.task(bind=True)
def debug_task(self):
print('Request: {0!r}'.format(self.request))
10 changes: 10 additions & 0 deletions cryptomonsters/cryptomonsters/custom_storages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Custom storage classes for static and media files."""
from django.conf import settings

from storages.backends.s3boto import S3BotoStorage


class StaticStorage(S3BotoStorage):
"""Custom storage class for static files."""

location = settings.STATICFILES_LOCATION
Loading