GithubHelp home page GithubHelp logo

app-store's Introduction

App-Store

Requirements
  • NodeJS /w npm
  • MySQL
  • Gulp - (globally)
  • nodemon - (globally)

Getting Started

Installing Dependencies
npm install
Sample .env file
DB_NAME=apiCRUD
DB_USER=
DB_PASS=
DB_HOST=localhost
DB_SCHEMA=mysql
DB_PORT=3306
PORT = 3000
NODE_DEBUG=DEV
Start Server Without Debug
gulp startup

or

nodemon src/server.js
Start Server Dev Debug
DEBUG=true gulp startup

or

DEBUG=true nodemon src/server.js

Debug Usage

const util = require('path/to/lib/util');

// How to use util
util.debug(title, obj, status);

Endpoints and response

CRUD for Users

CRUD for Apps

ArtAssets to Apps

CRUD for Users

--=-=-=-=-=-=-=-=-

POST Create User
/api/users/
Sample
{
  "name": "Kevin",
}
GET User with Id of 1
/api/users/1
Sample Response
{
 "id": 1,
 "name": "Kevin Tucker",
 "createdAt": "2016-06-08T01:11:52.000Z",
 "updatedAt": "2016-06-08T01:11:52.000Z"
}
GET All Users
/api/users/
Sample Response
[
 {
  "id": 1,
  "name": "Kevin",
  "createdAt": "2016-06-08T01:35:43.000Z",
  "updatedAt": "2016-06-08T01:35:43.000Z"
 },
 {
  "id": 2,
  "name": "Kevin",
  "createdAt": "2016-06-08T01:35:47.000Z",
  "updatedAt": "2016-06-08T01:35:47.000Z"
 },
 {
  "id": 3,
  "name": "Kevin",
  "createdAt": "2016-06-08T01:35:48.000Z",
  "updatedAt": "2016-06-08T01:35:48.000Z"
 }
]
POST Update User
/api/users/1
Sample
{
 "name": "Kevin T"
}
DELETE User
/api/users/1
Response
1

CRUD for Apps

-=-=-=-=-=-=-=-=-

POST Create App
/api/apps
Sample
{
  "title": "Best routes Ever",
  "description": "A fast paced side scrolling shooter",
  "releaseDate": "2016-06-15T22:29:20.000Z"
}
GET App with Id of 1
/api/apps/1
Sample Response
{
 "id": 1,
 "title": "Best routes Ever",
 "description": "A fast paced side scrolling shooter",
 "releaseDate": "2016-06-15T22:29:20.000Z",
 "createdAt": "2016-06-08T01:12:36.000Z",
 "updatedAt": "2016-06-08T01:12:36.000Z",
 "userId": 1,
 "artAssets": [
  {
   "id": 1,
   "title": "Best router Ever",
   "srcLink": "Kevin",
   "createdAt": "2016-06-08T01:16:11.000Z",
   "updatedAt": "2016-06-08T01:16:11.000Z",
   "appId": 1
  }
 ]
}
Get App by user id
/api/users/1/apps
Sample Response
[
 {
  "id": 1,
  "title": "Best routes Ever Ever",
  "description": "A fast paced side scrolling shooter",
  "releaseDate": "2016-06-15T22:29:20.000Z",
  "createdAt": "2016-06-08T01:35:54.000Z",
  "updatedAt": "2016-06-08T01:44:12.000Z",
  "userId": 1,
  "artAssets": [
   {
    "id": 1,
    "title": "Best router Ever",
    "srcLink": "Kevin",
    "createdAt": "2016-06-08T01:36:16.000Z",
    "updatedAt": "2016-06-08T01:36:16.000Z",
    "appId": 1
   },
   {
    "id": 2,
    "title": "Best router Ever",
    "srcLink": "Kevin",
    "createdAt": "2016-06-08T01:36:20.000Z",
    "updatedAt": "2016-06-08T01:36:20.000Z",
    "appId": 1
   },
   {
    "id": 3,
    "title": "Best router Ever",
    "srcLink": "Kevin",
    "createdAt": "2016-06-08T01:36:25.000Z",
    "updatedAt": "2016-06-08T01:36:25.000Z",
    "appId": 1
   }
  ]
 }
]
GET All Apps
/api/apps/
Sample Response
[
 {
  "id": 1,
  "title": "Best routessdfsdfsdfr Ever",
  "description": "A fast paced side scrolling shooter",
  "releaseDate": "2016-06-15T22:29:20.000Z",
  "createdAt": "2016-06-08T01:35:54.000Z",
  "updatedAt": "2016-06-08T01:35:54.000Z",
  "userId": null
 },
 {
  "id": 2,
  "title": "Best routessdfsdfsdfr Ever",
  "description": "A fast paced side scrolling shooter",
  "releaseDate": "2016-06-15T22:29:20.000Z",
  "createdAt": "2016-06-08T01:35:55.000Z",
  "updatedAt": "2016-06-08T01:35:55.000Z",
  "userId": null
 }
]
POST Update App
/api/apps/1
Sample
{
  "title": "Best routes Ever Ever",
  "description": "A fast paced side scrolling shooter",
  "releaseDate": "2016-06-15T22:29:20.000Z",
  "userId": 1
}
POST Update App UserId
/api/apps/1
Sample
{
  "title": "Best routes Ever Ever",
  "description": "A fast paced side scrolling shooter",
  "releaseDate": "2016-06-15T22:29:20.000Z",
  "userId": 2
}

ArtAssets to Apps

POST Create artassets
/api/apps/1/artassets/
Sample
{
  "title": "Best router Ever",
  "srcLink": "Kevin",
  "appId": 1
}
GET All artassets upon app id
/api/apps/1/artassets/
Sample
[
 {
  "id": 1,
  "title": "Best router Ever",
  "srcLink": "Kevin",
  "createdAt": "2016-06-08T01:36:16.000Z",
  "updatedAt": "2016-06-08T02:33:50.000Z",
  "appId": 1
 },
 {
  "id": 2,
  "title": "Best router Ever",
  "srcLink": "Kevin",
  "createdAt": "2016-06-08T01:36:20.000Z",
  "updatedAt": "2016-06-08T01:36:20.000Z",
  "appId": 1
 }
]
GET Display one artassets from specific app id and artassetid
/api/apps/1/artassets/2
Sample Response
{
 "id": 2,
 "title": "Best router Ever",
 "srcLink": "Kevin",
 "createdAt": "2016-06-08T01:36:20.000Z",
 "updatedAt": "2016-06-08T01:36:20.000Z",
 "appId": 1
}
POST Update artassets based upon id
/api/apps/1/artassets/2
Sample
{
 "id": 2,
 "title": "Best router Ever",
 "srcLink": "Kevin",
 "createdAt": "2016-06-08T01:36:20.000Z",
 "updatedAt": "2016-06-08T01:36:20.000Z",
 "appId": 2
}

app-store's People

Contributors

kwtucker avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.