Giter Club home page Giter Club logo

books-library's Introduction

Backend Dev Challenge - Book Library

Assumptions

  1. Restful API for all endpoints.
  2. No matter who returns the book, it will be logged in to original lender in user_action_logs table.

Libraries/Tools used

  • Laravel 8
  • Laravel Sanctum for authentication system.
  • Postgres

How to setup

Run the following commands to setup. If you want to use local php server, given php 7.3+, composer postgres is available

  1. git clone [email protected]/amritms/books-library.git
  2. cd book-library
  3. cp .env.example .env
  4. php artisan key:generate
  5. update .env to change the database name and credentials
  6. composer install
  7. php artisan migrate --seed
  8. php artisan test -> to run the test
  9. php artisan serve
  10. you can access the api at http://localhost:8000/api
  11. visit API documentation

If you want to use docker instead of local php server, given you have docker available

  1. git clone [email protected]/amritms/book-library.git
  2. cd book-library
  3. cp .env.example.docker .env
  4. update .env to change the database name. The docker will create database by reading in the .env file.
  5. docker-compose run --rm library_composer install
  6. docker-compose run --rm library_artisan migrate --seed
  7. docker-compose run --rm library_artisan test -> to run the test
  8. you can access the api at http://localhost/api
  9. visit API documentation

API Documentation

API Documentation

If it was a bigger real project

If it was a bigger real project, doing the following would be better:

  1. Use Laravel fortify because it provides login, registration, password reset, email verification etc out of the box.
  2. Use Laravel sanctum SPA authentication instead of token based authentication because SAP authentication uses Laravel's built-in cookie based session authentication services which provides CSRF protection and session authentication.
  3. Use Repository Pattern while writing code to adhere SOLID principles.
  4. Write more tests.
  5. Implement Route 53 for DNS, AWS Lambda, RDS database with Multiple Availability Zones failover and Read replicas, S3 for storage, Elasticache for caching, SQS for queues, cloudwatch for logs as server infrastructure.

books-library's People

Contributors

amritms avatar

Watchers

 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.