This repository has been archived by the owner on Apr 8, 2022. It is now read-only.
forked from TuringCom/backend_challenge_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 81c0f25
Showing
44 changed files
with
12,787 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["@babel/preset-env"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/node_module/ | ||
/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"printWidth": 100, | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Oops, something went wrong.