• Stars
    star
    923
  • Rank 47,755 (Top 1.0 %)
  • Language
    PHP
  • License
    MIT License
  • Created almost 2 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Hydra is a zero-config API boilerplate with Laravel 10x + Laravel Sanctum that comes with an excellent user and role management API out of the box

Hydra - Zero Config API Boilerplate with Laravel Sanctum

Hydra - Zero Config API Boilerplate with Laravel Sanctum

PHP 8.0 Tests PHP 8.1 Tests CircleCI GitHub

Hydra is a zero-config API boilerplate with Laravel Sanctum and comes with excellent user and role management API out of the box. Start your next big API project with Hydra, focus on building business logic, and save countless hours of writing boring user and role management API again and again.

Getting Started

It's super easy to get Hydra up and running.

First clone the project and change the directory

git clone https://github.com/hasinhayder/hydra.git
cd hydra

Then follow the process using either Docker or without Docker (simple).

Without Docker (Simple)

  1. Install the dependencies
composer install
  1. Copy .env.example to .env
cp .env.example .env
  1. Generate application key
php artisan key:generate
  1. Start the webserver
php artisan serve

That's mostly it! You have a fully running laravel installation with Sanctum, all configured.

Using Docker & Laravel Sail

  1. Install the dependencies
docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v $(pwd):/var/www/html \
    -w /var/www/html \
    laravelsail/php81-composer:latest \
    composer install --ignore-platform-reqs
  1. Copy .env.example to .env
cp .env.example .env
  1. Run the containers
./vendor/bin/sail up
  1. Generate application key
./vendor/bin/sail artisan key:generate

To learn more about Sail, visit the official Doc.

Screencast

asciicast

Database Migration and Seeding

Open your .env file and change the DATABASE options. You can start with SQLite by following these steps

  1. Create a new SQLite database
touch database/hydra.sqlite

Or simply create a new file as hydra.sqlite inside your database folder.

  1. You can run both migrations and seeders together by simply running the following command
php artisan migrate:fresh --seed

OR

you can run them separately using the following commands

  1. Run Migrations
php artisan migrate:fresh

Now your database has essential tables for user and roles management.

  1. Run Database Seeders

Run db:seed, and you have your first admin user, some essential roles in the roles table, and the relationship correctly setup.

php artisan db:seed

Please note that the default admin user is [email protected] and the default password is hydra. You should create a new admin user before deploying to production and delete this default admin user. You can do that using the available Hydra user management API or any DB management tool.

List of Default Routes

Here is a list of default routes. Run the following artisan command to see this list in your terminal.

php artisan route:list

Hydra - List of Default Routes

Default Roles

Hydra comes with these super-admin,admin,editor,customer & user roles out of the box. For details, open the roles table after database seeding, or open the laravel tinker and experiment with the Role model.

php artisan tinker

run the following command

>>> Role::select(['id','slug','name'])->get()
//or
>>> Role::all(['id','name','slug'])
//or
>>> Role::all()

Routes Documentation

Let's have a look at what Hydra has to offer. Before experimenting with the following API endpoints, run your Hydra project using php artisan serve command. For the next part of this documentation, we assumed that Hydra is listening at http://localhost:8000

User Registration

You can make an HTTP POST call to create/register a new user to the following endpoint. Newly created users will have the user role by default.

http://localhost:8000/api/users

API Payload & Response

You can send a Form Multipart payload or a JSON payload like this.

{
    "name":"Hydra User",
    "email":"[email protected]",
    "password":"Surprisingly A Good Password"
}

Voila! Your user has been created and is now ready to log in!

If this user already exists, then you will receive a 409 Response like this

{
    "error": 1,
    "message": "user already exists"
}

User Authentication/Login (Admin)

Remember Hydra comes with the default admin user? You can log in as an admin by making an HTTP POST call to the following route.

http://localhost:8000/api/login

API Payload & Response

You can send a Form Multipart or a JSON payload like this.

{
    "email":"[email protected]",
    "password":"hydra"
}

You will get a JSON response with user token. You need this admin token for making any call to other routes protected by admin ability.

{
    "error": 0,
    "token": "1|se9wkPKTxevv9jpVgXN8wS5tYKx53wuRLqvRuqCR"
}

For any unsuccessful attempt, you will receive a 401 error response.

{
    "error": 1,
    "message": "invalid credentials"
}

User Authentication/Login (Other Roles)

You can log in as a user by making an HTTP POST call to the following route

http://localhost:8000/api/login

API Payload & Response

You can send a Form Multipart or a JSON payload like this

{
    "email":"[email protected]",
    "password":"Surprisingly A Good Password"
}

You will get a JSON response with user token. You need this user token for making any calls to other routes protected by user ability.

{
    "error": 0,
    "token": "2|u0ZUNlNtXgdUmtQSACRU1KWBKAmcaX8Bkhd2xVIf"
}

For any unsuccessful attempt, you will receive a 401 error response.

{
    "error": 1,
    "message": "invalid credentials"
}

List Users (Admin Ability Required)

To list the users, make an HTTP GET call to the following route, with Admin Token obtained from Admin Login. Add this token as a standard Bearer Token to your API call.

http://localhost:8000/api/users

API Payload & Response

No payload is required for this call.

You will get a JSON response with all users available in your project.

[
    {
        "id": 1,
        "name": "Hydra Admin",
        "email": "[email protected]"
    },
    {
        "id": 2,
        "name": "Test User",
        "email": "[email protected]"
    },
]

For any unsuccessful attempt or wrong token, you will receive a 401 error response.

{
    "message": "Unauthenticated."
}

Update a User (User/Admin Ability Required)

Make an HTTP PUT request to the following route to update an existing user. Replace {userId} with actual user id. You must include a Bearer token obtained from User/Admin authentication. A bearer admin token can update any user. A bearer user token can only update the authenticated user by this token.

http://localhost:8000/api/users/{userId}

For example, to update the user with id 3, use this endpoint http://localhost:8000/api/users/3

API Payload & Response

You can include name or email, or both in a URL Encoded Form Data or JSON payload, just like this

{
    "name":"Captain Cook",
    "email":"[email protected]"
}

You will receive the updated user if the bearer token is valid.

{
    "id": 3,
    "name": "Captain Cook",
    "email": "[email protected]",
}

For any unsuccessful attempt with an invalid token, you will receive a 401 error response.

{
    "error": 1,
    "message": "invalid credentials"
}

If a bearer user token attempts to update any other user but itself, a 409 error response will be delivered

{
    "error": 1,
    "message": "Not authorized"
}

For any unsuccessful attempt with an invalid user id, you will receive a 404 not found error response. For example, when you are trying to delete a non-existing user with id 16, you will receive the following response.

{
    "error": 1,
    "message": "No query results for model [App\\Models\\User] 16"
}

Delete a User (Admin Ability Required)

To delete an existing user, make a HTTP DELETE request to the following route. Replace {userId} with actual user id

http://localhost:8000/api/users/{userId}

For example to delete the user with id 2, use this endpoint http://localhost:8000/api/users/2

API Payload & Response

No payload is required for this call.

If the request is successful and the bearer token is valid, you will receive a JSON response like this

{
   "error": 0,
   "message": "user deleted"
}

You will receive a 401 error response for any unsuccessful attempt with an invalid token.

{
    "error": 1,
    "message": "invalid credentials"
}

For any unsuccessful attempt with an invalid user id, you will receive a 404 not found error response. For example, you will receive the following response when you try to delete a non-existing user with id 16.

{
   "error": 1,
   "message": "No query results for model [App\\Models\\User] 16"
}

List Roles (Admin Ability Required)

To list the roles, make an HTTP GET call to the following route, with Admin Token obtained from Admin Login. Add this token as a standard Bearer Token to your API call.

http://localhost:8000/api/roles

API Payload & Response

No payload is required for this call.

You will get a JSON response with all the roles available in your project.

[
    {
        "id": 1,
        "name": "Administrator",
        "slug": "admin"
    },
    {
        "id": 2,
        "name": "User",
        "slug": "user"
    },
    {
        "id": 3,
        "name": "Customer",
        "slug": "customer"
    },
    {
        "id": 4,
        "name": "Editor",
        "slug": "editor"
    },
    {
        "id": 5,
        "name": "All",
        "slug": "*"
    },
    {
        "id": 6,
        "name": "Super Admin",
        "slug": "super-admin"
    }
]

For any unsuccessful attempt or wrong token, you will receive a 401 error response.

{
    "message": "Unauthenticated."
}

Add a New Role (Admin Ability Required)

To list the roles, make an HTTP POST call to the following route, with Admin Token obtained from Admin Login. Add this token as a standard Bearer Token to your API call.

http://localhost:8000/api/roles

API Payload & Response

You need to supply title of the role as name, role slug in your payload as Multipart Form or JSON data

{
    "name":"Manager",
    "slug":"manager"
}

You will get a JSON response with this newly created role for successful execution.

{
    "name": "Manager",
    "slug": "manager",
    "id": 7
}

If this role slug already exists, you will get a 409 error message like this

{
    "error": 1,
    "message": "role already exists"
}

For any unsuccessful attempt or wrong token, you will receive a 401 error response.

{
    "message": "Unauthenticated."
}

Update a Role (Admin Ability Required)

To update a role, make an HTTP PUT or HTTP PATCH request to the following route, with Admin Token obtained from Admin Login. Add this token as a standard Bearer Token to your API call.

http://localhost:8000/api/roles/{roleId}

For example to update the Customer role, use this endpoint http://localhost:8000/api/roles/3

API Payload & Response

You need to supply title of the role as name, and/or role slug in your payload as Multipart Form or JSON data

{
    "name":"Product Customer",
    "slug":"product-customer"
}

You will get a JSON response with this updated role for successful execution.

{
    "id": 3,
    "name": "Product Customer",
    "slug": "product-customer"
}

Please note that you cannot change a super-admin or admin role slug because many API routes in Hydra exclusively require this role to function correctly.

For any unsuccessful attempt or wrong token, you will receive a 401 error response.

{
    "message": "Unauthenticated."
}

Delete a Role (Admin Ability Required)

To delete a role, make an HTTP DELETE request to the following route, with Admin Token obtained from Admin Login. Add this token as a standard Bearer Token to your API call.

http://localhost:8000/api/roles/{roleId}

For example, to delete the Customer role, use this endpoint http://localhost:8000/api/roles/3

API Payload & Response

No payload is required for this endpoint.

You will get a JSON response with this updated role for successful execution.

{
    "error": 0,
    "message": "role has been deleted"
}

Please note that you cannot delete the admin role because many API routes in Hydra exclusively require this role to function correctly.

If you try to delete the admin role, you will receive the following 422 error response.

{
    "error": 1,
    "message": "you cannot delete this role"
}

For any unsuccessful attempt or wrong token, you will receive a 401 error response.

{
    "message": "Unauthenticated."
}

List Available Roles of a User (Admin Ability Required)

To list all available roles for a user, make an HTTP GET request to the following route, with Admin Token obtained from Admin Login. Add this token as a standard Bearer Token to your API call. Replace {userId} with an actual user id

http://localhost:8000/api/users/{userId}/roles

For example to get all roles assigned to the user with id 2, use this endpoint http://localhost:8000/api/users/2/roles

API Payload & Response

No payload is required for this call.

For successful execution, you will get a JSON response containing the user with all its assigned roles.

{
    "id": 2,
    "name": "Test User",
    "email": "[email protected]",
    "roles": [
        {
            "id": 2,
            "name": "User",
            "slug": "user"
        },
        {
            "id": 3,
            "name": "Customer",
            "slug": "customer"
        }
    ]
}

For any unsuccessful attempt or wrong token, you will receive a 401 error response.

{
    "message": "Unauthenticated."
}

Assign a Role to a User (Admin Ability Required)

To assign a role to a user, make an HTTP POST request to the following route, with Admin Token obtained from Admin Login. Add this token as a standard Bearer Token to your API call. Replace {userId} with an actual user id

http://localhost:8000/api/users/{userId}/roles

For example to assign a role to the user with id 2, use this endpoint http://localhost:8000/api/users/2/roles

API Payload & Response

You need to supply role_id in your payload as Multipart Form or JSON data

{
    "role_id":3 
}

For successful execution, you will get a JSON response containing the user with all its assigned roles.

{
    "id": 2,
    "name": "Test User",
    "email": "[email protected]",
    "roles": [
        {
            "id": 2,
            "name": "User",
            "slug": "user"
        },
        {
            "id": 3,
            "name": "Customer",
            "slug": "customer"
        }
    ]
}

Notice that the user has a Roles array, and this newly assigned role is present in this array.

Please note that it will have no effect if you assign the same role again to a user.

For any unsuccessful attempt or wrong token, you will receive a 401 error response.

{
    "message": "Unauthenticated."
}

Delete a Role from a User (Admin Ability Required)

To delete a role from a user, make an HTTP DELETE request to the following route, with Admin Token obtained from Admin Login. Add this token as a standard Bearer Token to your API call. Replace {userId} with an actual user id, and {role} with an actual role id

http://localhost:8000/api/users/{userId}/roles/{role}

For example, to delete a role with id 3 from the user with id 2, use this endpoint http://localhost:8000/api/users/2/roles/3

API Payload & Response

No payload is required for this call

For successful execution, you will get a JSON response containing the user with all asigned roles to it.

{
    "id": 2,
    "name": "Test User",
    "email": "[email protected]",
    "roles": [
        {
            "id": 2,
            "name": "User",
            "slug": "user"
        },
    ]
}

Notice that the user has a Roles array, and the role with id 3 is not present in this array.

For any unsuccessful attempt or wrong token, you will receive a 401 error response.

{
    "message": "Unauthenticated."
}

Notes

Default Admin Username and Password

When you run the database seeders, a default admin user is created with the username '[email protected]' and the password 'hydra'. You can login as this default admin user and use the bearer token on next API calls where admin ability is required.

When you push your application to production, please remember to change this user's password, email or simply create a new admin user and delete the default one.

Default Role for New Users

The user role is assigned to them when a new user is created. To change this behavior, open your .env file and set the value of DEFAULT_ROLE_SLUG to any existing role slug. New users will have that role by default. For example, if you want your new users to have a customer role, set DEFAULT_ROLE_SLUG=customer in your .env file.

There are five default role slugs in Hydra.

Role Slug Role Name
admin Admin
user User
customer Customer
editor Editor
super-admin Super Admin

This ENV variable is configured in in config/hydra.php as default_user_role_slug, and then used in app/Http/Controllers/UserController.php

Single Session or Multiple Session

Hydra doesn't invalidate the previously issued access tokens when a user authenticates. So, all access tokens, including the newly created one, will remain valid. If you want to change this behavior and delete all previous tokens when a user authenticates, set DELETE_PREVIOUS_ACCESS_TOKENS_ON_LOGIN to true in your .env file. The value of DELETE_PREVIOUS_ACCESS_TOKENS_ON_LOGIN is set to false by default.

This ENV variable is configured in in config/hydra.php, and then used in app/Http/Controllers/UserController.php

Add Accept: application/json Header In Your API Calls (Important)

This is very important. To properly receive JSON responses, add the following header to your API requests.

Accept: application/json

For example, if you are using curl you can make a call like this.

curl --request GET \
  --url http://localhost:8000/hydra/version \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data =

Logging

Hydra comes with an excellent logger to log request headers, parameters and response to help debugging and inspecting API calls. All you have to do is wrap the route with 'hydra.log' middleware, as shown below

Route::post('login', [UserController::class, 'login'])->middleware('hydra.log');

or, like this

Route::put('users/{user}', [UserController::class, 'update'])->middleware(['hydra.log', 'auth:sanctum', 'ability:admin,super-admin,user']);

And then you can see the API call logs in logs/laravel.log file.

Code Formatting

Hydra comes with an excellent code formatter called Laravel Pint out of the box, with an excellent configuration preset that you can find in pint.json. By default pint uses the Allman style for the braces where the braces are placed in a new line after the function name. So we have changed it to K&R style formatting where the brace stays on the same line of the function name.

To format your code using laravel pint, you can run the following command any time from inside your project diretory.

./vendor/bin/pint

And that's all for formatting. To know more, check out laravel pint documentation at https://github.com/laravel/pint

Tutorial

So you decided to give Hydra a try and create a new protected API endpoint; that's awesome; let's dive in.

Create a New API Controller

You can create a normal or a resourceful controller. To keep it simple, I am going with a standard controller.

php artisan make:controller MessageController

This will create a new file called app/Http/Controlers/MessageController.php

Add a Function

We will add a simple function that will greet the authenticated user. Since this will be protected using Sanctum middleware, only a request with a valid bearer token will be able to access this endpoint. You don't need to worry about anything else.

Open this file app/Http/Controlers/MessageController.php and add the following code

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class MessageController extends Controller
{
    public function greet(Request $request){
        $user = $request->user();

        $response = [
            "name" => $user->name,
            "role" => $user->roles()->first()->name //or $user->roles()->first()->slug
        ];

        return $response;

    }
}

Create Protected Routes

Let's create a protected route http://localhost:8000/api/greet to use this API

Open your routes/api.php file and add the following line at the end.

Route::get('greet', [MessageController::class, 'greet'])->middleware(['auth:sanctum']);

Nice! Now we have a route /api/greet that is only accessible with a valid bearer token.

Test Protected Routes

If you have already created a user, you need his accessToken first. You can use the admin user or create a new user and then log in and note their bearer token. To create or authenticate a user, check the documentation in the beginning.

To create a new user, you can place a curl request or use tools like Postman, Insomnia or HTTPie. Here is a quick example using curl.

curl --request POST \
  --url http://localhost:8000/api/users \
  --header 'Accept: application/json' \
  --header 'Content-Type: multipart/form-data; boundary=---011000010111000001101001' \
  --form 'name=Hydra User' \
  --form [email protected] \
  --form 'password=Surprisingly A Good Password'

Great! Now we have our users. Let's login as this new user using curl (You can use tools like Postman, Insomnia, or HTTPie)

curl --request POST \
  --url http://localhost:8000/api/login \
  --header 'Accept: aplication/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "email": "[email protected]",
    "password": "Surprisingly A Good Password"
}'

Now you have this user's accessToken in the response, as shown below. Note it.

{"error":0,"id":2,"token":"5|gbiWdd7yJFYiTIgoK1jK3C7HZJtJUK1PnBIToBLN"}

The bearer token for this user is 5|gbiWdd7yJFYiTIgoK1jK3C7HZJtJUK1PnBIToBLN

Now let's test our protected route. Add this bearer token in your PostMan/Insomnia/HTTPie or Curl call and make a HTTP GET request to our newly created protected route http://localhost:8000/api/greet. Here's an example call with curl

curl --request GET \
  --url http://localhost:8000/api/greet \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer 5|gbiWdd7yJFYiTIgoK1jK3C7HZJtJUK1PnBIToBLN'

The response will be something like this.

{
    "name": "[email protected]",
    "role": "User"
}

Great! you have learned how to create your protected API endpoint using Laravel Sanctum and Hydra!

Protect a Route with Laravel Sanctum's Ability and Abilities Middleware

Let's make our newly created API endpoint even more robust. Say, we want our route to be accessible by only admin users. Remember you added the following line in the routes/api.php file just a few minutes ago? Let's change it.

Route::get('greet', [MessageController::class, 'greet'])->middleware(['auth:sanctum']);

Change it like this

Route::get('greet', [MessageController::class, 'greet'])->middleware(['auth:sanctum', 'ability:admin']);

Only an HTTP GET call with a valid admin user's access token can access this route. If you want this route to be accessible by the users with admin, OR the user role, then modify it.

Route::get('greet', [MessageController::class, 'greet'])->middleware(['auth:sanctum', 'ability:admin,user']);

If you want this route to be accessible by the users with both user, AND the customer role, then modify it.

Route::get('greet', [MessageController::class, 'greet'])->middleware(['auth:sanctum', 'abilities:customer,user']);

Note that this time we have used the abilities keyword instead of ability

Great, now you know everything to start creating your next big API project with Laravel & Laravel Sanctum using our powerful boilerplate project called Hydra. Enjoy!

More Repositories

1

tailwind-cards

A growing collection of text/image cards you can use/copy-paste in your tailwind css projects
CSS
557
star
2

ImageCaptionHoverAnimation

CSS3 Based hover animation for Image Captions
HTML
352
star
3

banner-designer

Design beautiful banners with this visual banner builder
JavaScript
267
star
4

essential-jquery-plugins

This is a list of useful and handy jQuery Plugins, properly categorized and sorted :)
221
star
5

wpsqlite

Quickly provision a fully functional WordPress site with SQLite, with *.wplocal.xyz domain support
PHP
206
star
6

vue3-icon-picker

A fantastic icon picker for Vue3 projects
JavaScript
196
star
7

tailwind-boilerplate

Tailwind CSS 3 + Vite Boilerplate
HTML
162
star
8

themeforest-wp-theme-approval-checklist

A comprehensive list of rejection messages which you should avoid to get your WordPress theme approved quickly in Themeforest
154
star
9

cmb2-metabox-generator

Visual Code Generator for CMB2 Metaboxes
JavaScript
104
star
10

fifawc

Fifa WorldCup 2018 Fixture In Your Local Time
JavaScript
99
star
11

wp-functions-list

This is a list of all WordPress functions from version 0 to version 4.8.1 along with the data of when they were first introduced and if they are deprecated or not
93
star
12

javascript-text-expander

Expands texts as you type, naturally
JavaScript
66
star
13

fatalsafe

Save your ass when you're struck by a fatal error while editing a live theme in WordPress admin panel
PHP
61
star
14

wordle-alpinejs

Wordle Game using Alpine JS
JavaScript
55
star
15

Nanimator

jQuery Nano Animation Library
JavaScript
51
star
16

button-hover-style

A nice button hover style with background image and text animation
HTML
50
star
17

StickySocialBar

Sticky social networking bar with css3 transitions
JavaScript
47
star
18

plugin-boilerplate-code-generator

Plugin Boilerplate Code Generator from Tom Mcfarlin's Plugin Boilerplate
PHP
44
star
19

vue-calc

A simple and useful number project using Vue 3 for everyday use
CSS
41
star
20

paddle-woocommerce-3

Integration of Paddle payment processor with WooCommerce 3. Original work was done by Paddle. Improvements are being done by ThemeBucket
PHP
39
star
21

LastTab

(Not Maintained Anymore)
JavaScript
39
star
22

100DaysOfCode

100 Days of Code - You know the rest :)
HTML
37
star
23

LazyMouse

detect the mouse inactivity and fire javascript events for that
JavaScript
35
star
24

laravel-login-registration-facelift

Time to give your default laravel authentication views some facelift, yeah!
HTML
32
star
25

wpvue

WordPress Plugin Starter with Vite+Vue3
Vue
27
star
26

windicss-boilerplate

WindiCSS + Vite boilerplate to quickly start developing your windicss/tailwindcss projects
JavaScript
25
star
27

colored-console-log

Display colored log message in js developer console
JavaScript
25
star
28

elementor-blank-extension

Elementor Blank Extension is a boilerplate for creating Elementor extensions and widgets
PHP
23
star
29

css3-3d-curtain

A nice 3d-curtain type slideshow using animate.css and jQuery
22
star
30

learnbackbonejs

ΰ¦¬ΰ¦Ύΰ¦‚ΰ¦²ΰ¦Ύΰ§Ÿ ব্যাকবোন.ΰ¦œΰ§‡ΰ¦ΰ¦Έΰ§‡ΰ¦° উΰ¦ͺরে কিছু ΰ¦Ÿΰ¦Ώΰ¦‰ΰ¦Ÿΰ§‹ΰ¦°ΰ¦Ώΰ¦―ΰ¦Όΰ¦Ύΰ¦²
22
star
31

VisualComposerShortcodeGenerator

Quickly generate visual composer shortcode mapping with wordpress shortcode
JavaScript
22
star
32

hasinhayder

Portfolio
21
star
33

Shared-Taxonomy-Counter-Fix

This plugin fixes the taxonomy counter in WordPress admin panel if the taxonomy is shared across multiple post types. It's a known bug in WordPress.
PHP
20
star
34

developers-treasure-chest

Interesting Github Repos, SaaS Applications, News, Tools, and Technology For The Developers. Updates Frequently
19
star
35

image-search

Image Search using AlpineJS + Fetch API
HTML
19
star
36

tesla-modelx-tailwind

Tesla ModelX Hero Section Clone using Tailwind CSS
CSS
19
star
37

LightBulb

Project LightBulb is a wrapper on top of Facebook's own JS-SDK and Graph API to simplify developing applications using Graph API. You dont need to worry about underlying objects, structures, workflows. Just use it to develop your Facebook Applications and shout "Light Bulb" :)
JavaScript
19
star
38

RoboWP

One page app landing page template - wordpress version
PHP
18
star
39

wp-quick-provision

Quick Provisioning Plugin For WordPress
PHP
18
star
40

Airbnb-Style-FAQ-Navigation

A beautiful FAQ dropdown nav item using ReactJS, as shown in Airbnb
JavaScript
18
star
41

colorconsole

Colorconsole provides an interesting way to display colored info, success, warning and error messages on the developer console in your browser
TypeScript
18
star
42

LearnWithHasinHayder

Code files from my official tutorial channel, LearnWithHasinHayder
PHP
17
star
43

FacebookMessengerBot-Using-NodeJS-Express

JavaScript
16
star
44

vue3-video-playlist-project

Vue 3 Video Playlist Project using Options API
CSS
15
star
45

InteractiveForwardBot

Ask questions in a sequential order with lots of funs included!
JavaScript
15
star
46

infinte-scroll-wp

infinte-scroll-wp - A demonstration of infinite scrolling in wordpress themes, comes with detail information.
PHP
15
star
47

windicss-image-hover-animation

Beautiful image hover animation inside a flex layout system using WindiCSS/TailwindCSS
HTML
14
star
48

dimgx.net

source code of dimgx.net
PHP
14
star
49

WordPress-Code-Snippets

A collection of useful code snippets, hooks, tips and tricks for WordPress theme and plugin developers
14
star
50

bnKbjQuery

Bangla Keyboard Input Script jQuery Plugin
JavaScript
13
star
51

wordpress-3.5-bangla-book

Collaborative effort on writing a good wordpress book in bangla
13
star
52

wp-logout-redirect

WordPress plugin that takes users to the home page after logout from admin panel
PHP
13
star
53

responsivegrid

Simple Responsive Grid with debounce that works really well everywhere.
JavaScript
13
star
54

CSS3-Storyline-Animation

Demonstration of CSS3 Storyline Animation using jQuery Transit Library
JavaScript
12
star
55

openshift-symfony-2.3.0

Openshift ZendServer 5.6 and PHP 5.3 boilerplate symfony 2.3.6 repo
PHP
11
star
56

BreakPoint

loads and executes external javascript based on viewport width and given breakpoints
JavaScript
11
star
57

wpfavs-public-api-cloudflare-worker

Fetch favorite themes and plugins form a WordPress.org user profile by his/her username and return as JSON data. This project is hosted on CloudFlares worker platform, so it is fast, very fast.
JavaScript
11
star
58

css-grid-examples

HTML
10
star
59

jQueryLabel

Turn some spans looking like GMail Mail Label
JavaScript
10
star
60

Flixplore

Flixplore displays first 110 photos from daily Flickr Explores using Meteor (http://meteor.com)
JavaScript
9
star
61

jQconfigurator

Attach a flexible config panel to any DOM Element using this neat and powerful jQuery Plugin
JavaScript
9
star
62

GoChuck

Random Chuck Norris Jokes
Go
8
star
63

vue-search

A Vue 3 project demonstrating how to use fetch() API and two way data binding for quick data search
HTML
8
star
64

BanglaTwitterStatus

Post twitter status in Bangla
7
star
65

vue3-vite-windicss-boilerplate

Vue3 + Vite + WindiCSS (Tailwind) Boilerplate for quick starting your Vue3 app with full support for tailwind
Vue
7
star
66

openshift-php-client

open shift php client for their rest api
PHP
7
star
67

wordpress-com-proxy

proxy script to deliver wordpress.com blog from anywhere with few enhancements
PHP
6
star
68

demo.lwhh.link

My Personal Link Shortener
PHP
6
star
69

CSS3-Keyframe-Transition

Beautiful CSS3 Animation with Two Moving Cars :)
JavaScript
6
star
70

Woocommerce-Disable-Email-Change

Prevent users from changing email address from their WooCommerce dashboard.
PHP
6
star
71

JustSlide

simple full width slider that just works. perfect for showcasing products or portfolio items
JavaScript
6
star
72

jquery-mouse-direction

This can fire custom mouse-direction event on any elements which you can then listen to and bind a listener routine.
JavaScript
6
star
73

StringScrambler

A funny string scrambler program keeping the first and last letters same in each word
Go
6
star
74

nanogallery

beautiful fullscreen gallery with vertical and horizontal thumbnail preview
JavaScript
6
star
75

ResponsiveGalleryWithFiltering

Responsive gallery with filtering using MisItUp and FancySelect
JavaScript
5
star
76

jHoverContainer

Container with Sliding Image and nice rollover effects
JavaScript
5
star
77

freader

5
star
78

vue-content-edit-example

A fun content edit example with Vue 3
Vue
5
star
79

phar-cli-boilerplate

Boilerplate project to create command line applications in PHP and bundle as a phar package
5
star
80

image-slide-with-single-img

Nice image slide animation with a single div, animate css and a little jQuery :)
5
star
81

MyReadingList

I come across a lot of interesting stuffs everyday. Here, I will be keeping track of those things
5
star
82

vue-router

examples with vue-router
Vue
4
star
83

woocommerce-quick-order

Quickly create order for new and existing users with flat discount and coupon codes
PHP
4
star
84

fake-data-generator-from-schema

Generate fake data from a schema using Faker.js
JavaScript
4
star
85

shared-login

[WordPress Plugin] - Create magic login URLs to allow users to login without username and password with various restrictions
JavaScript
4
star
86

phpflickr

flickr api wrapper
PHP
4
star
87

wpcookbook

WordPress Tips & Tricks
3
star
88

web2copy

Web2Copy - From Web to Copy.com Storage Service http://web2copy.com
PHP
3
star
89

issuemattic

wordpress issue tracker theme
JavaScript
3
star
90

meteor-bookmarks-app

A small meteor app which allows anyone to create a URL bookmark site with tags
CSS
3
star
91

RepeatableMetaGroup

Easily create repeatable meta field groups with this RepeatableMetaGroup plugin
PHP
3
star
92

precompiled-brotli-modules-for-nginx

2
star
93

jFlickrPicker

display a small gallery from any flickr user's photo stream to select any numbers of phots
2
star
94

backbone-tutorial

BackBone Tutorial
JavaScript
2
star
95

reverseslide

slide two adjacent slides in opposite direction
2
star
96

xpens.net-website

HTML
2
star
97

course-player-markup

HTML
2
star
98

phonetic-bangla

Just a temporary repo for the phonetic-bangla script
JavaScript
2
star
99

oop-in-php

just some example files for a group of students learning oop in php
PHP
2
star
100

drunk

Simple minimalist WordPress theme
PHP
1
star