Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Commit

Permalink
setup backend challenge template
Browse files Browse the repository at this point in the history
  • Loading branch information
cwizard2011 committed Jun 16, 2019
0 parents commit 81c0f25
Show file tree
Hide file tree
Showing 44 changed files with 12,787 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env"]
}
30 changes: 30 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Create a .env file and copy these variables in it

## Setup your mysql development database

DB_USER= development database username here
DB_PASS= development database password here
DB_NAME= development database name here
DB_HOST= development database host here

## Setup your mysql test database here

TEST_DB_USER= test database username here
TEST_DB_PASS= test database password here
TEST_DB_NAME= test database name here
TEST_DB_HOST= test database host here

## Production database URI variable
DATABASE_URL= production database URI here in url format

JWT_KEY= JWT secret key here, any random key

## Register on stripe payment website to get stripe keys below
STRIPE_PUBLISHABLE_KEY= get this from stripe website
STRIPE_SECRET_KEY= get this from stripe website

## Register on sendgrid website to get sendgrid API key
SENDGRID_API_KEY= get this from sendgrid

## Any random key for session secret
SESSION_SECRET= any random secret key
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_module/
/dist/
10 changes: 10 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["airbnb", "prettier"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": ["error"]
},
"env": {
"jest": true
}
}
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Logs
logs
*.log
.DS_Store
.env
*.lock

npm-debug.log*

# Runtime data
pids
*.pid
*.seed

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

# nyc test coverage
.nyc_output

# Coverage directory used by tools like istanbul
coverage

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

# node-waf configuration
.lock-wscript

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

# Dependency directory
node_modules

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history
yarn.lock

#Local environment
.env
dist/
.vscode
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printWidth": 100,
"singleQuote": true,
"trailingComma": "es5"
}
8 changes: 8 additions & 0 deletions .sequelizerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const path = require('path');

module.exports = {
"config": path.resolve('./src/database/config', 'config.js'),
"migrations-path": path.resolve('./src/database/migrations'),
'models-path': path.resolve('./src/database/models'),
'seeders-path': path.resolve('./src/database/seeders')
};
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Turing Back End Challenge
To complete this challenge, you need to ensure all route returns a similar response object as described in our API guide.
To achieve this goal, you will have to fix the existing bugs, implement the incomplete functions, and add test cases for the main functions of the system.

## Getting started

### Prerequisites

In order to install and run this project locally, you would need to have the following installed on you local machine.

* [**Node JS**](https://nodejs.org/en/)
* [**Express**](https://expressjs.com/)
* [**MySQL**](https://www.mysql.com/downloads/)

### Installation

* Clone this repository

* Navigate to the project directory

* Run `npm install` or `yarn` to instal the projects dependencies
* create a `.env` file and copy the contents of the `.env.sample` file into it and supply the values for each variable

```sh
cp .env.sample .env
```
* Create a MySQL database and run the `sql` file in the database directory to migrate the database

```sh
mysql -u <dbuser> -D <databasename> -p < ./src/database/database.sql
```

* Run `npm run dev` to start the app in development

## Request and Response Object API guide for all Endpoints
Check [here](https://docs.google.com/document/d/1J12z1vPo8S5VEmcHGNejjJBOcqmPrr6RSQNdL58qJyE/edit?usp=sharing)
Loading

0 comments on commit 81c0f25

Please sign in to comment.