Skip to content

2347035039214 #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
39 changes: 39 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
5 changes: 4 additions & 1 deletion .gitattributes
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Auto detect text files and perform LF normalization
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
/.idea
/.vscode
/.vagrant
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.env
.phpunit.result.cache
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{
"git.ignoreLimitWarning": true
}
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: vendor/bin/heroku-php-apache2 public/
103 changes: 30 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,88 +1,45 @@
# nHub Code Challenge: nHub Developer Community
## Due: 2018 or Earlier

## Simple Unchanging Rules
The code challenge is and will always be judged using the following criteria:
- A Correct fork, branch and pull request
- Using the GitHub Pull Request Time Stamp and correct code quality & structure, the first developer whose code runs successfully wins
- Other developers who submit successfully MAY also get rewarded with secondary items
- Code quality and structure will be evaluated
- The order for pull requests will be followed, first come first win basis!
- Do not share any code that you cannot opensource on the Git Repository as its open source and Africa's Talking will not be liable for any breach of intellectual property (if any) once shared on the platform.

## Terms and Conditions
You can participate on as many challenges as you wish:
- Ensure that you create your branch with your international format phone number.
- Africa's Talking reserves the right to announce the winners
- Africa's Talking reserves the right to reward the winners based on Africa's Talking Criterion
- Do not share any code that you cannot opensource on the Git Repository as its open source and Africa's Talking will not be liable for any breach of intellectual property (if any) once shared on the platform.
- Code Challenges are time bound - the time restriction is specified on the challenge
- Additional rules MAY be provided on the code challenge and will vary for each challenge
- You are free to use all manner of tools
- Successive interviews for projects MAY be run to satisfy participating Africa's Talking Partners
## PROJECT TITLE: TERMINUS.NG

## Code Challenge Bounty:
- First Prizes: Yet to be disclosed
## How it Works # One
### Get Started

## Task
In this code challenge you will be required to build out an application that solves a problem in your community with the Africa's Talking SDKs (or the Gateways if it suits you better 😉). The most creative solutions will be considered for rewards. The following conditions should be met:
- The application should be able to use 2 or more AT services
- Serve a genuine need in the community
- Enter your WhatsApp number to get started.

### Bonus points:
1. User logs in or signs up for the application
2. User is able to perform advanced tasks
- A member of the Terminus.ng team starts a conversation with you to figure out the exact details of your request. Then you are put in a group chat with 3-8 retailers based on your product request.

### Haggling & Payment
While we moderate this group product request chat, you can change specifications and add more item requests while sellers send you images and product details within the chat.

# Working on the Code Challenge
1.Fork the code challenge repository provided.
Haggling begins for best possible price. Once the details and price have been confirmed, we send you an invoice and a link through which you can pay directly on chat.

2.Make a topic branch. In your github form, keep the master branch clean. When you create a branch, it essentially will be a copy of the master.
### Results
We get the job done, keeping you in the loop at every step of the process. We also send you photo confirmations as well as receipts within this chat stream as delivery moves to you.

>Pull all changes, make sure your repository is up to date

```sh
$ cd nHubCodeChallenge
$ git pull origin master
```
## How it Works # Two (Code Challenge)
#### Introduction
There are many cases/instances where one can be so busy to the extend of not having time to go to the super market/mall to do shopping like regular individuals. Going through rows of shelves trying to pick out items in a super market or shopping mall can be overwhelming sometimes and time consuming especially when you are on a tight schedule.

>Create a new branch as follows-> git checkout -b [your_phone_number], e.g.
Terminus.ng bridges the gab and ease the stress and brings us to the question HOW?.

```sh
$ git checkout -b 23472XXXXXXX master
```
Very simple.... Just pick up your phone (probably enroute to the store), dial the short code ```*384*25851#``` from your mobile phone. Follow the prompts, select a store and place your order. The super market or shopping mall logs into the terminus.ng dashboard and sees the order request, assigns a staff to collect all the items on the order list, Buyers get notified via SMS that their purchase order is ready for pick up. Buyer picks up his/her order, confirm all is as ordered, make payment for the said items, head back home within minutes not hours.

>See all branches created

```sh
$ git branch
* 23472XXXXXXX
master
```
# Setting up the Project
- Clone the project by running ```git clone https://github.com/nanichang/nHubCodeChallenge.git```
- ```cd nHubCodeChallenge```
- ```composer install```
- create a .env file by running ```touch .env``` or copy .env.example using ```cp .env.example .env```, fill in the required parameters
- Generate an app key by running ```php artisan key:generate```
- migrate the database tables with ```php artisan migrate```
- Seed the database tables with demo data for testing```php artisan db:seed```
- Launch the project with ```php artisan serve```
- Open project on your browser at ```localhost:8000``` or ```127.0.0.1:8000```
- Go to ```/auth/login``` access the admin portal.
- username: ```user@terminus.ng```, password: ```secret```

>Push the new branch to github

```sh
$ git push origin -u 23472XXXXXXX
```

3.Make changes to the fork following the Code Challenge provided.

4.Commit the changes to your fork.

5.Make a pull request to the nHubCodeChallenge
Repo.


## Resources
You can use the following resources to get you started on your way:
* [Starting on the Sandbox and Simulator](http://help.africastalking.com/website/how-to-get-started-on-the-africas-talking-sand-box)
* [Africas Talking's Android SDK documentation on GitHub](https://github.com/AfricasTalkingLtd/africastalking-android)
* [Africas Talking's Java SDK documentation on GitHub](https://github.com/AfricasTalkingLtd/africastalking-java)
* [Africa's Talking Documentation](http://docs.africastalking.com)
* [Other Help articles](http://help.africastalking.com)
- More on [Logging in, Signing up/Registration, Verifying/Activating your account, Managing Teams and applications](http://help.africastalking.com/website)
- Videos on getting started [on the Africa's Talking Sandbox](https://www.dropbox.com/sh/qq086503d5zaq7l/AADEo-oazNF_PgYIPRjPpeCua?dl=0)


## Get Support on the Africa's Talking Slack
In case you have any questions, join our Slack [here](https://slackin-africastalking.now.sh/)
### Note
In order to test USSD locally, you will need to expose your local machine to the public domain. ```ngrok``` is a great tool for that.
10 changes: 10 additions & 0 deletions app/Activation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Activation extends Model
{
//
}
10 changes: 10 additions & 0 deletions app/Admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Admin extends Model
{
//
}
42 changes: 42 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];

/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')
// ->hourly();
}

/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');

require base_path('routes/console.php');
}
}
53 changes: 53 additions & 0 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

namespace App\Exceptions;

use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];

/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];

/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $exception
* @return void
*/
public function report(Exception $exception)
{
parent::report($exception);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
{
return parent::render($request, $exception);
}
}
10 changes: 10 additions & 0 deletions app/ForgotPassword.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class ForgotPassword extends Model
{
//
}
34 changes: 34 additions & 0 deletions app/Http/Controllers/ActivationController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Repositories\Activation\ActivationContract;
use Activation;
use Sentinel;
use App\User;

class ActivationController extends Controller
{

protected $repo;

public function __construct(ActivationContract $activationContract) {
$this->repo = $activationContract;
}

public function activate($email, $activationCode) {

// $this->repo->AccountActivation()

$user = User::whereEmail($email)->first();

if (Activation::complete($user, $activationCode)) {
return redirect()->route('get_login');
}else {
return redirect()->back()->with(['error' => 'Wrong Credentials']);
}

}

}
Loading