Skip to content

Commit

Permalink
open
Browse files Browse the repository at this point in the history
  • Loading branch information
srfrnk committed Oct 15, 2019
0 parents commit c67e441
Show file tree
Hide file tree
Showing 92 changed files with 9,479 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
build
.githooks
.github
k8s
!k8s/vendor
dist
travis
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# http://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
21 changes: 21 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

npm run tslint
if [ "$?" != "0" ]; then
exit 1
fi

npm run jest
if [ "$?" != "0" ]; then
exit 1
fi

npm run spellcheck
if [ "$?" != "0" ]; then
exit 1
fi

npm run tsc
if [ "$?" != "0" ]; then
exit 1
fi
Binary file added .github/readme_header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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 (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/
build/

# 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

# next.js build output
.next

package-lock.json
.history
40 changes: 40 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [{
"type": "node",
"request": "launch",
"name": "Jest",
"outputCapture": "std",
"preLaunchTask": "tsc",
"runtimeArgs": [
"--nolazy",
"-r",
"ts-node/register",
],
"args": [
"${workspaceFolder}/node_modules/.bin/jest",
"--config", "${workspaceFolder}/jest.config.js",
"--runInBand",
],
},
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"runtimeArgs": [
"-r",
"ts-node/register"
],
"args": [
"./src/owner/index.ts"
],
"env": {
// "CASSANDRA_KEYSPACE": "ride_hailing",
"TWILIO_API_KEY": "CNvD1uktQu7wio61sVNLPNaZXP0OBJVa",
}
}
]
}
21 changes: 21 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": "2.0.0",
"tasks": [{
"type": "gulp",
"label": "tsc",
"task": "tsc",
"isBackground": false,
"presentation": {
"echo": false,
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"group": {
"kind": "build",
"isDefault": true
}
}]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 DAV Foundation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FORCE:

tslint: FORCE
npm run tslint

jest: FORCE tsc
npm run jest

tsc: FORCE
npm run tsc

spellcheck: FORCE
npm run spellcheck

pre-push: tslint tsc jest spellcheck

start-rider: SHELL = /bin/bash
start-rider: jest
export SDK_DEBUG_LOG=true &&\
source ./local-env.sh &&\
npm run start-rider

start-manager: SHELL = /bin/bash
start-manager: jest
export SDK_DEBUG_LOG=true &&\
source ./local-env.sh &&\
npm run start-ops

local-deploy:
make -C k8s local-deploy
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Ride Hailing App API

![Mooving app](https://raw.githubusercontent.com/DAVFoundation/ride-hailing-api/master/.github/readme_header.png)

DAV (Decentralized Autonomous Vehicles) is a non-profit foundation working to build an open-source infrastructure for autonomous vehicles (cars, drones, trucks, robots, boats, and all the service providers around them) to communicate and transact with each other over blockchain.

One of the first projects being built by the DAV Foundation is a decentralized ride hailing app. This app connects drivers and passengers directly to each other. The repository you are looking at is the API that drives this ride hailing app for both passengers and drivers.

[![license](https://img.shields.io/github/license/DAVFoundation/ride-hailing-api.svg?style=flat-square)](https://github.com/DAVFoundation/ride-hailing-api/blob/master/LICENSE) [![Gitter chat](https://img.shields.io/gitter/room/nwjs/nw.js.svg?style=flat-square)](https://gitter.im/DAVFoundation/DAV-Contributors)

76 changes: 76 additions & 0 deletions code_of_conduct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected] . All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
74 changes: 74 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
const gulp = require('gulp');
const jest = require('gulp-jest').default;
const nodemon = require('gulp-nodemon')
const ts = require('gulp-typescript');
const tslint = require('gulp-tslint');
const spellcheck = require('gulp-ts-spellcheck').default;

gulp.task('jest', (done) => {
return gulp.src('')
.on('error', function (err) { done(err); })
.pipe(jest({ runInBand: true }));
});

gulp.task('tslint', (done) => {
return gulp.src('src/**/*.ts')
.on('error', function (err) { done(err); })
.pipe(tslint({
formatter: 'prose'
}))
.pipe(tslint.report());
});

gulp.task('tsc', function (done) {
const tsProject = ts.createProject('tsconfig.json');
return tsProject.src()
.pipe(tsProject())
.on('error', function (err) { done(err); })
.js
.pipe(gulp.dest('build'));
});

gulp.task('spellcheck', function (done) {
return gulp.src('src/**/*.ts')
.on('error', function (err) {
done(err);
})
.pipe(spellcheck({
dictionary: require('./speller-dictionary.js')
}))
.pipe(spellcheck.report({}));
});

gulp.task('start-driver', function (done) {
nodemon({
watch: ['src'],
ignore: ['src/**/*.test.ts'],
exec: 'ts-node ./src/driver/index.ts',
ext: 'ts',
done: done
})
})

gulp.task('start-rider', function (done) {
nodemon({
watch: ['src'],
ignore: ['src/**/*.test.ts'],
exec: 'ts-node ./src/rider/index.ts',
ext: 'ts',
done: done
})
})

gulp.task('start-ops', function (done) {
nodemon({
watch: ['src'],
ignore: ['src/**/*.test.ts'],
exec: 'ts-node ./src/owner/index.ts',
ext: 'ts',
done: done
})
})

gulp.task('compile', ['tslint', 'tsc']);
gulp.task('test', ['compile', 'jest']);
10 changes: 10 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
verbose: true,
testEnvironment: 'node',
roots: ['<rootDir>/src'],
transform: {
'\\.tsx?$': 'ts-jest',
},
testRegex: '(\\.(test|spec))\\.(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
};
Loading

0 comments on commit c67e441

Please sign in to comment.