Coder Social home page Coder Social logo

ngemoji's Introduction

Build Status

#NGemoji NGemoji is a lightweight API for naija emojis built using the Slim framework. It allows basic API calls and performs CRUD operations as requested by the end user.

#Testing phpspec for testing is used to perform tests on the classes. The TDD principle has been employed to make the application robust

Run this in your terminal to execute the tests

/vendor/bin/phpspec run

#Install

  • To install this package, PHP 5.5+ and Composer are required
composer require dara/ngemoji

#Environment variables

In order to use this package, you need to create a .env file in your project root folder with the following details provided

P_DRIVER = 'mysql';
P_HOST   = 'localhost';
P_DBNAME = 'db_name';
P_USER   = 'db_username';
P_PASS   = 'db_password';

#usage

  • Register a new user

Call the /auth/register API endpoint with the following options

method   = POST

form parameters

username = anyusername 
password = anypassword
  • Login user

Call the /auth/login API endpoint with the following options

method = POST

header parameters

token = generatedToken
  • Logout user

Call the /auth/logout API endpoint with the following options

method = GET

header parameters

token = generatedToken
  • Add an emoji

Call the /emojis API endpoint with the following options

method = POST

form parameters

name       = anyEmojiName
category   = anyCategory
char       = anyEmojiChaaracter
keywords   = keyword1, keyword2

header parameters

token = generatedToken
  • Update an emoji

Call the /emojis/:id API endpoint with the following options

method = PUT/PATCH

form parameters

name       =  anyEmojiName
category   =  anyCategory
char       =  anyEmojiChaaracter
keywords   =  keyword1, keyword2

header parameters

token = generatedToken
  • Delete an emoji

Call the /emojis/:id API endpoint with the following options

method = DELETE

header parameters

token = generatedToken

Change log

Please check out CHANGELOG file for information on what has changed recently.

Contributing

Please check out CONTRIBUTING file for detailed contribution guidelines.

Credits

NGemoji is maintained by Dara Oladosu.

License

NGemoji is released under the MIT Licence. See the bundled LICENSE file for more details.

ngemoji's People

Contributors

dara-tobi avatar

Watchers

James Cloos avatar Prosper Otemuyiwa avatar  avatar

ngemoji's Issues

README

From the readme, i discovered that for every request I have to pass in username and password with token. Thats very very wrong.

Why will I have to do that? Then, what's the use of the token generated?

Once I have been registered, When I login with the username and password, it should generate a token that I should just use for subsequent requests.

I dont need no username and password, only the token for all the other requests that needs authorization. Please Fix!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.