Git Product home page Git Product logo

neami-challenge's Introduction

Neami Challenge

Installation and usage instructions

Get started with Docker

# Turn off other mysql and apache services running(like MAMP etc)
# Install and setup Docker for Mac or Windows if not already

# Build docker containers
# below command will take about 5 minutes. Please be patient
cd neami-challenge
docker-compose build

# Run all
docker-compose up

# Run commands inside containers
docker-compose exec <container> <command>
# e.g. docker-compose exec lumen-api php artisan migrate:refresh --seed

Neami Backend

Configuration & Usage

  1. Rename or copy .env.example file to .env
  2. Update APP_KEY and JWT_SECRET with your own secret keys
  3. Set your database credentials in your .env file to match Docker settings
  4. Set your APP_URL in your .env file.
  5. docker-compose exec lumen-api php artisan migrate:refresh --seed
  6. Above command will freshly migrate and seed default roles, permissions and users for testing.
  7. Visit http://localhost:8000 to access Lumen API

Permissions and Roles

User roles and permissions are handled by this Laravel Permission library.

After seeding, default permissions manage-users, delete-users will be created.

And default role super-admin with all permissions will be created.

Authentication and Authorization

  1. Authentication is implemented using JSON Web Tokens with the help of PHP-JWT library
  2. JWT token is saved in localStorage and set to expire after 24hrs.
  3. Logged in user's information also stored in localStorage. Note that the authorization process does not rely on this localStorage user information.
  4. Authorized users only routes are protected by Vue Router meta option permission. Refer vue-spa/src/router/index.js
  5. All protected routes will trigger '/permissions' API call automatically to get fresh set of user's permissions and store it in Vue memory. Unauthorized entries will be redirected to /store

Usage

  1. Visit localhost:8080 in your browser
  2. Hot Module Replacement is enabled by default by the docker configuration.
  3. For admin level access visit /login and use the default super admin User/Password: [email protected]/000000.
  4. For user level access visit /login and use the default user User/Password: [email protected]/000000

CoreUI for Vue.js

Neami Challenge Frontend is built on top of CoreUI for Vue.js. Refer its extensive documentation to understand the file structure, layouts, and components.

TODO

  1. Users CRUD operations as administrator
  2. Option to add/remove roles & permissions to each user as administrator
  3. New page to maintain roles and permissions CRUD operations
  4. Push the production build to https://neami.iamraja.com

neami-challenge's People

Contributors

iamroi avatar

Watchers

 avatar  avatar

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.