Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Victor Montoya #5

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
69e8a3e
add them all
victoramontoya Nov 28, 2018
819e0d1
heroku, pusher, app works
victoramontoya Nov 28, 2018
718d41b
adding urls
victoramontoya Nov 29, 2018
b10db8c
fixing heroku deploy allwowed hosts
victoramontoya Nov 29, 2018
6189ab4
no need for serializers
victoramontoya Nov 29, 2018
6923b26
fixed?
victoramontoya Nov 29, 2018
1534e03
reverted allowed hosts
victoramontoya Nov 29, 2018
8d43c23
test
victoramontoya Nov 29, 2018
8fa4112
test1
victoramontoya Nov 29, 2018
1569e14
test2
victoramontoya Nov 29, 2018
0c80532
allowed hosts
victoramontoya Nov 29, 2018
5500854
allowed hosts changed
victoramontoya Nov 29, 2018
68c844a
connected postgres
victoramontoya Nov 30, 2018
bd35627
connected to database
victoramontoya Nov 30, 2018
e78b98a
settings
victoramontoya Nov 30, 2018
45a6508
postman works
victoramontoya Nov 30, 2018
4e52d62
created react app, dependencies, connected reducers, component and ac…
victoramontoya Dec 4, 2018
1b64bcb
Can log in, but need to refactor auth and reducers, added register, l…
victoramontoya Dec 4, 2018
fa33169
not working anymore
victoramontoya Dec 5, 2018
e4fa145
front end registration and login works
victoramontoya Dec 5, 2018
67f13a9
server works using url
victoramontoya Dec 5, 2018
60bdc5e
front end and back end integration done
victoramontoya Dec 5, 2018
b9765ef
added chat, adventure and fixed sidebar components, not rendering
victoramontoya Dec 6, 2018
003d239
added pusher functionality
victoramontoya Dec 6, 2018
ef66f4a
deleted unecessary model
victoramontoya Dec 7, 2018
39e1722
fixed some things
victoramontoya Dec 7, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "/Users/victormontoya/.local/share/virtualenvs/LambdaMUD-Project-8VZSIn1d/bin/python"
}
41 changes: 22 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ creative guide.

## Trello Set Up:

- [ ] Create a Trello account if you don't have one already
- [ ] Create a new board called "LambdaMUD - {Your Name}"
- [ ] Create lists titled `backlog`,`To Do`, `In Progress`, and `Done`
- [-] Create a Trello account if you don't have one already
- [-] Create a new board called "LambdaMUD - {Your Name}"
- [-] Create lists titled `backlog`,`To Do`, `In Progress`, and `Done`
- [ ] Fill in the `To Do` list with the MVP features listed below
- [ ] Fill in the `backlog` list with all the extra features listed below
- [ ] Share your board with the project manager that has been assigned to you. If you have not been assigned yet, reach out to your lead PM for guidance
- [ ] Add your Trello URL to your project's README.md file. Commit the change, push it to your repository & submit a pull request
- [-] Share your board with the project manager that has been assigned to you. If you have not been assigned yet, reach out to your lead PM for guidance
- [-] Add your Trello URL to your project's README.md file. Commit the change, push it to your repository & submit a pull request

## MVP Features:

#### Client
- [ ] Create a standalone frontend app that communicates with the server via API calls
- [ ] Be able to create a new account on the server (implemented on server)
- [ ] Be able to log in to the server (implemented on server)
- [x] Be able to create a new account on the server (implemented on server)
- [x] Be able to log in to the server (implemented on server)
- [ ] Create an interface that displays the current room name, its description and the other players in the room
- [ ] Be able to move between rooms and update the display accordingly (implemented on server)
- [x] Be able to move between rooms and update the display accordingly (implemented on server)
- [ ] Be able to use a `say` command to say things that other people in the room will see (server implementation incomplete)
- [ ] Upon login, subscribe to a Pusher channel based on the player's universally unique id: `p-channel-<uuid>`
- [ ] Bind the player channel to `broadcast` events and display the messages to the player
Expand All @@ -57,7 +57,7 @@ creative guide.

#### Server
- [ ] Create a new API endpoint for `say` which broadcasts a message to other players in the current room
- [ ] Deploy to Heroku
- [x] Deploy to Heroku

#### General
- [ ] Header comments in all source files that describe overall what the file does
Expand All @@ -70,13 +70,13 @@ Request comment:
```markdown
## Trello Set Up:

- [ ] Create a Trello account if you don't have one already
- [ ] Create a new board called "LambdaMUD - {Your Name}"
- [ ] Create lists titled `backlog`,`To Do`, `In Progress`, and `Done`
- [ ] Fill in the `To Do` list with the MVP features listed below
- [ ] Fill in the `backlog` list with all the extra features listed below
- [ ] Share your board with the project manager that has been assigned to you. If you have not been assigned yet, reach out to your lead PM for guidance
- [ ] Add your Trello URL to your project's README.md file. Commit the change, push it to your repository & submit a pull request
- [x] Create a Trello account if you don't have one already
- [x] Create a new board called "LambdaMUD - {Your Name}"
- [x] Create lists titled `backlog`,`To Do`, `In Progress`, and `Done`
- [x] Fill in the `To Do` list with the MVP features listed below
- [x] Fill in the `backlog` list with all the extra features listed below
- [x] Share your board with the project manager that has been assigned to you. If you have not been assigned yet, reach out to your lead PM for guidance
- [x] Add your Trello URL to your project's README.md file. Commit the change, push it to your repository & submit a pull request

## MVP Features:

Expand All @@ -93,8 +93,8 @@ Request comment:
- [ ] Alert the player when someone in the current room says something (server implementation incomplete)

#### Server
- [ ] Create a new API endpoint for `say` which broadcasts a message to other players in the current room
- [ ] Deploy to Heroku
- [x] Create a new API endpoint for `say` which broadcasts a message to other players in the current room
- [x] Deploy to Heroku

#### General
- [ ] Header comments in all source files that describe overall what the file does
Expand Down Expand Up @@ -127,7 +127,7 @@ MVP as soon as you can and get working the list of features.
- [ ] Add PvP combat


---
--

# Directions

Expand Down Expand Up @@ -200,6 +200,9 @@ MVP as soon as you can and get working the list of features.
* Players in previous room receive a message: `<name> has walked north.`
* Players in next room receive a message: `<name> has entered from the south.`


^^WOrks

### Say (NOT YET IMPLEMENTED)
* Request: (Replace token string with logged in user's auth token)
* `curl -X POST -H 'Authorization: Token 6b7b9d0f33bd76e75b0a52433f268d3037e42e66' -H "Content-Type: application/json" -d '{"message":"Hello, world!"}' localhost:8000/api/adv/say/`
Expand Down
29 changes: 27 additions & 2 deletions adv_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

import os
from decouple import config
import psycopg2
import dj_database_url



# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand All @@ -24,9 +28,13 @@
SECRET_KEY = config('SECRET_KEY')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = config('DEBUG', cast=bool)
# DEBUG = config('DEBUG', cast=bool)

# ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=lambda v: [s.strip() for s in v.split(',')])

ALLOWED_HOSTS = ['0.0.0.0', 'localhost', '.herokuapp.com', '127.0.0.1']

ALLOWED_HOSTS = []
# ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=Csv())


# Application definition
Expand Down Expand Up @@ -67,6 +75,18 @@

ROOT_URLCONF = 'adv_project.urls'

REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly',
],
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.BasicAuthentication',
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
),
}


TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
Expand Down Expand Up @@ -96,6 +116,9 @@
}
}

# db_from_env = dj_database_url.config()
# DATABASES['default'].update(db_from_env)
DATABASES['default'] = dj_database_url.config(default=config('DATABASE_URL'))

# Password validation
# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
Expand Down Expand Up @@ -151,3 +174,5 @@

import django_heroku
django_heroku.settings(locals())


23 changes: 23 additions & 0 deletions adventure-front-end/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
44 changes: 44 additions & 0 deletions adventure-front-end/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br>
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.<br>
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
34 changes: 34 additions & 0 deletions adventure-front-end/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "adventure-front-end",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"react": "^16.6.3",
"react-cookie": "^3.0.8",
"react-dom": "^16.6.3",
"react-redux": "^5.1.1",
"react-router-dom": "^4.3.1",
"react-scripts": "2.1.1",
"reactstrap": "^6.5.0",
"redux": "^4.0.1",
"redux-form": "^7.4.2",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
Binary file added adventure-front-end/public/favicon.ico
Binary file not shown.
40 changes: 40 additions & 0 deletions adventure-front-end/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
15 changes: 15 additions & 0 deletions adventure-front-end/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
32 changes: 32 additions & 0 deletions adventure-front-end/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.App {
text-align: center;
}

.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 40vmin;
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
31 changes: 31 additions & 0 deletions adventure-front-end/src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React, { Component } from 'react';
import './App.css';
import './index.css';
import Main from './components/Main';
import SideBar from './components/SideBar';
import { Container, Row, Col } from 'reactstrap';
import 'regenerator-runtime/runtime';



class App extends Component {


render() {
return (
<Container className={"App"}>
<Row>
<Col md="3" className={"side-bar"}>
<SideBar />
</Col>

<Col md="9" className={"content"}>
<Main />
</Col>
</Row>
</Container>
);
}
}

export default App;
9 changes: 9 additions & 0 deletions adventure-front-end/src/App.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
});
Loading