Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (34)
Showing
with 448 additions and 0 deletions
#!/usr/bin/env bash
# See https://docs.docker.com/compose/environment-variables/#the-env-file
MYSQL_HOST=mysql
MYSQL_PORT=8989
MYSQL_DATABASE=motaraido
MYSQL_ROOT_USER=root
MYSQL_ROOT_PASSWORD=root
MYSQL_USER=datafreaks
MYSQL_PASSWORD=datafreaks
\ No newline at end of file
.DS_Store
Thumbs.db
npm-debug.log
/data
/bower_components
/node_modules
/vendor
/OjekOnlineApp/build/
/OjekIdentityService/nbproject/private/
/OjekOnlineService/nbproject/private/
/OjekIdentityService/build/
\ No newline at end of file
MIT License
Copyright (c) 2017 (Winarto, Ray Andrew, Adrian HP)
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.
\ No newline at end of file
version: '3'
services:
web:
image: nginx:latest
ports:
- "8000:80"
- "3000:443"
restart: always
env_file:
- ".env"
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
volumes:
- "./etc/nginx/default.conf:/etc/nginx/conf.d/default.conf"
- "./etc/ssl:/etc/ssl"
- "./src:/var/www/html"
depends_on:
- php
- mysqldb
php:
image: nanoninja/php-fpm
restart: always
volumes:
- "./etc/php/php.ini:/usr/local/etc/php/conf.d/php.ini"
- "./src:/var/www/html"
myadmin:
image: phpmyadmin/phpmyadmin
container_name: phpmyadmin
ports:
- "8080:80"
environment:
- PMA_ARBITRARY=1
- PMA_HOST=${MYSQL_HOST}
restart: always
depends_on:
- mysqldb
mysqldb:
image: mysql
user: "1000:50"
container_name: ${MYSQL_HOST}
restart: always
env_file:
- ".env"
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
ports:
- "8989:3306"
volumes:
- "./data/db/mysql:/var/lib/mysql"
\ No newline at end of file
# Nginx configuration
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name localhost;
index index.php index.html;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/html;
sendfile off;
location / {
try_files $uri $uri/ /index.php?$args;
include /etc/nginx/mime.types;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
# Adding the cache control header for js and css files
# Make sure it is BELOW the PHP block
location ~* \.(?:css|js)$ {
try_files $uri /index.php$uri$is_args$args;
add_header Cache-Control "public, max-age=7200";
# Add headers to serve security related headers (It is intended to
# have those duplicated to the ones above)
# Before enabling Strict-Transport-Security headers please read into
# this topic first.
# add_header Strict-Transport-Security "max-age=15768000;
# includeSubDomains; preload;";
#
# WARNING: Only add the preload option once you read about
# the consequences in https://hstspreload.org/. This option
# will add the domain to a hardcoded list that is shipped
# in all major browsers and getting removed from this list
# could take several months.
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
# Optional: Don't log access to assets
access_log off;
}
location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
try_files $uri /index.php$uri$is_args$args;
# Optional: Don't log access to other assets
access_log off;
}
}
# server {
# server_name localhost;
# listen 443 ssl;
# fastcgi_param HTTPS on;
# ssl_certificate /etc/ssl/server.pem;
# ssl_certificate_key /etc/ssl/server.key;
# ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
# index index.php index.html;
# error_log /var/log/nginx/error.log;
# access_log /var/log/nginx/access.log;
# root /var/www/html/public;
# location ~ \.php$ {
# try_files $uri =404;
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# fastcgi_pass php:9000;
# fastcgi_index index.php;
# include fastcgi_params;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_param PATH_INFO $fastcgi_path_info;
# }
# }
;PHPStorm
[xdebug]
xdebug.remote_enable=1
xdebug.idekey=PHPSTORM
xdebug.profiler_enable=0
xdebug.max_nesting_level=700
xdebug.remote_host=192.168.0.1 # your ip
;Netbeans
;[xdebug]
;xdebug.remote_enable=1
;xdebug.remote_handler=dbgp
;xdebug.remote_mode=req
;xdebug.remote_host=192.168.0.1 # your ip
;xdebug.remote_port=9000
\ No newline at end of file
Tubes1/mocks/complete-order.PNG

47.1 KiB

Tubes1/mocks/edit-preferred-location.PNG

13.1 KiB

Tubes1/mocks/edit-profile.PNG

57.8 KiB

Tubes1/mocks/history-driver.PNG

31.3 KiB

Tubes1/mocks/history-penumpang.PNG

59.6 KiB

Tubes1/mocks/login.PNG

12.2 KiB

Tubes1/mocks/order-ojek.PNG

16.9 KiB

Tubes1/mocks/profile.PNG

50.5 KiB

Tubes1/mocks/register.PNG

18.3 KiB

Tubes1/mocks/select-driver.PNG

57.9 KiB

-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: mysql
-- Generation Time: Oct 03, 2017 at 02:49 AM
-- Server version: 5.7.19
-- PHP Version: 7.0.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `motaraido`
--
-- --------------------------------------------------------
--
-- Table structure for table `history`
--
CREATE TABLE `history` (
`usernameUser` varchar(32) NOT NULL,
`usernameDriver` varchar(32) NOT NULL,
`rating` int(11) NOT NULL,
`comment` text,
`dateOrder` date NOT NULL,
`pickup` text NOT NULL,
`destination` text NOT NULL,
`ishide` boolean NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `preferredloc`
--
CREATE TABLE `preferredloc` (
`username` varchar(32) NOT NULL,
`location` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `rating`
--
CREATE TABLE `rating` (
`username` varchar(32) NOT NULL,
`rating` int(11) NOT NULL,
`votes` varchar(50) NOT NULL,
`numrat` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`username` varchar(32) NOT NULL,
`password` varchar(32) NOT NULL,
`fullname` varchar(50) NOT NULL,
`phone` varchar(15) NOT NULL,
`isdriver` tinyint(1) NOT NULL,
`email` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `history`
--
ALTER TABLE `history`
ADD KEY `usernameUser` (`usernameUser`),
ADD KEY `usernameDriver` (`usernameDriver`);
--
-- Indexes for table `preferredloc`
--
ALTER TABLE `preferredloc`
ADD KEY `username` (`username`);
--
-- Indexes for table `rating`
--
ALTER TABLE `rating`
ADD KEY `username` (`username`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`username`);
--
-- Constraints for dumped tables
--
--
-- Constraints for table `history`
--
ALTER TABLE `history`
ADD CONSTRAINT `history_ibfk_1` FOREIGN KEY (`usernameUser`) REFERENCES `user` (`username`) ON DELETE CASCADE,
ADD CONSTRAINT `history_ibfk_2` FOREIGN KEY (`usernameDriver`) REFERENCES `user` (`username`) ON DELETE CASCADE;
--
-- Constraints for table `preferredloc`
--
ALTER TABLE `preferredloc`
ADD CONSTRAINT `preferredloc_ibfk_1` FOREIGN KEY (`username`) REFERENCES `user` (`username`) ON DELETE CASCADE;
--
-- Constraints for table `rating`
--
ALTER TABLE `rating`
ADD CONSTRAINT `rating_ibfk_1` FOREIGN KEY (`username`) REFERENCES `user` (`username`) ON DELETE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<?php
namespace MotaRaido\Core;
if (!defined('MOTAFW')) {
echo 'This file can only be called via the main index.php file, and not directly';
exit();
}
$host = 'mysql';
$db = 'motaraido';
$un = 'datafreaks';
$pass = 'datafreaks';
class Config {
protected static $data = array(
'database' => array (
'driver' => 'mysql',
'host' => 'mysql',
'port' => '8989',
'db' => 'motaraido',
'username' => 'datafreaks',
'password' => 'datafreaks'
),
'template' => array (
'header' => APPDIR . '/Menu/Header.php',
'headerWithMenu' => APPDIR . '/Menu/HeaderWithMenu.php',
'footer' => APPDIR . '/Menu/Footer.php'
),
'base_url' => '',
'secret-key' => '\x8f\xc6\xe8\x5e\xcd\x3f\x0a\x96\xf7\x62\x14\xc2\x74\xfb\x23\x54'
);
public static function get($name)
{
if (array_key_exists($name, self::$data)) {
return self::$data[$name];
}
}
}
\ No newline at end of file
<?php
namespace MotaRaido\Core\Database;
if (!defined('MOTAFW'))
{
echo 'This file can only be called via the main index.php file, and not directly';
exit();
}
use \PDO;
use \Closure;
class Connector extends PDO
{
private $forcedRollBack = false;
public function __construct($config) {
parent::__construct($config['driver'] . ':dbname=' . $config['db'] . ';' . 'host=' . $config['host'], $config['username'], $config['password']);
}
public function createTransaction(Closure $func)
{
$this->beginTransaction();
try
{
$func($this);
if ($this->forcedRollBack)
{
$this->rollback();
}
else
{
$this->commit();
}
}
catch (Exception $e)
{
$this->rollback();
throw $e;
}
}
public function forceRollback()
{
$this->forcedRollback = true;
}
}
\ No newline at end of file
<?php
namespace MotaRaido\Core\Database;
if (!defined('MOTAFW'))
{
echo 'This file can only be called via the main index.php file, and not directly';
exit();
}
use \MotaRaido\Core\Config;
class Encryption
{
public static function encrypt($password)
{
$hash = password_hash($password . Config::get('secret-key'), PASSWORD_DEFAULT);
return base64_encode($hash);
}
public static function verify($password, $text)
{
return password_verify($password . Config::get('secret-key'), base64_decode($text));
}
}
\ No newline at end of file