Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
68 changes: 68 additions & 0 deletions lab-pedja/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
401 JS -- Lab 37+38 Full Stack Crud App
===

## Features
> Purpose of this lab is practice creating async actions for making ajax calls to our server and adding simple AUTH that will allow USER to signup/login to Sluggram RESTful API server. Lab 38 feature are user profile creation and updating. Lab 40 feature are connecting second model - photos and ability to upload photos to your AWS S3 data storage.

## Code Style
* Javascript ES6, JSX


## Tech / framework used

* Webpack
* React
* Redux
* Redux-devtools
* Babel
* sass
* NodeJS
* Express
* MongoDB
* AWS
* Superagent
* Jest
* Cors

## Installation and How To Use

* Fork || clone this repo to you computer

* Run `yarn`

* Setup your .env file in backend folder

```
PORT=<ADD PORT>
DEBUG=true
CORS_ORIGINS=http://localhost:8080
MONGO_URI=mongodb://localhost/testing
SECRET=<ADD YOUR SECRET STRING>
AWS_ACCESS_KEY_ID=<'ADD YOUR AWS KEY ID'>
AWS_SECRET_ACCESS_KEY='ADD YOUR AWS ACCESS KEY'
AWS_BUCKET='ADD YOUR AWS BUCKET NAME'
```

* Setup your .env file in frontend folder

```
API_URL=http://localhost:PORT
CDN_URL=/
NODE_ENV=debug
```

* Run mongoDB with `yarn dbon` command

* Start server with `yarn start`

* Run webpack command `npm run watch`. After build has been completed - webpack-dev-server will show provide URL where your project is hosted. Copy that address to your browser to view app features

* Perform user signup/login

*

### Credits
REST API used for backend `https://github.com/slugbyte/sluggram`

### Licence
MIT © Pedja Josifovic 401 JS
4 changes: 4 additions & 0 deletions lab-pedja/backend/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["es2015"],
"plugins": ["transform-object-rest-spread"]
}
7 changes: 7 additions & 0 deletions lab-pedja/backend/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Created by Vinicio Vladimir Sanchez Trejo

**/node_modules/*
**/vendor/*
**/*.min.js
**/coverage/*
**/build/*
32 changes: 32 additions & 0 deletions lab-pedja/backend/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Created by Vinicio Vladimir Sanchez Trejo

{
"env": {
"browser": true,
"node": true,
"commonjs": true,
"jest": true,
"es6": true
},
"globals": {
"err": true,
"req": true,
"res": true,
"next": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 6,
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
"rules": {
"no-console": "off",
"indent": [ "error", 2 ],
"quotes": ["error", "single", { "allowTemplateLiterals": true }],
"comma-dangle": ["error", "always-multiline"],
"semi": [ "error", "always" ]
}
}
156 changes: 156 additions & 0 deletions lab-pedja/backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# Created by https://www.gitignore.io/api/osx,vim,node,linux,windows,visualstudiocode

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# mongodb db folder
db

# multer temp folder
temp


### OSX ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Vim ###
# swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]sw[a-p]
# session
Session.vim
# temporary
.netrwhist
# auto-generated tag files
tags

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history

### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/osx,vim,node,linux,windows,visualstudiocode

log.json
18 changes: 18 additions & 0 deletions lab-pedja/backend/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: node_js
node_js:
- '8.4.0'
services:
- mongodb
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
env:
- CXX=g++-4.8
sudo: required
before_script: npm i -g yarn && yarn install
script:
- yarn test
42 changes: 42 additions & 0 deletions lab-pedja/backend/.yarnclean
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# test directories
__tests__
test
tests
powered-test

# asset directories
docs
doc
website
images
assets

# examples
example
examples

# code coverage directories
coverage
.nyc_output

# build scripts
Makefile
Gulpfile.js
Gruntfile.js

# configs
.tern-project
.gitattributes
.editorconfig
.*ignore
.eslintrc
.jshintrc
.flowconfig
.documentup.json
.yarn-metadata.json
.*.yml
*.yml

# misc
*.gz
*.md
Loading