Git Product home page Git Product logo

backendzuristagetwo's Introduction

BackendZuriStageTwo

Person Management API

This project is a simple API for managing persons. It allows you to create, read, update, and delete persons.

Table of Contents

Getting Started

Follow the steps below to get this API up and running on your local machine.

Prerequisites

Make sure you have the following software/tools installed:

  • PHP (>= 7.3)
  • Composer
  • Laravel (optional)
  • MySQL (optional)

Installation

  1. Clone the repository:

    git clone https://github.com/tripletens/BackendZuriStageTwo.git
  2. Change to the project directory: cd BackendZuriStageTwo

  3. Install PHP dependencies: composer install

  4. Generate a unique application key using the following command: php artisan key:generate

Configure Database

  1. Open the .env file and configure your database connection settings. Set the DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, and DB_PASSWORD values according to your local database setup.

Save the changes to the .env file. cp .env.example .env

Migrate and Seed the Database

  1. Run the following command to create the database tables: php artisan migrate

  2. If your application has seeders, you can run them to populate the database with initial data: php artisan db:seed

Serve the Application

  1. To start a local development server, use the following command: php artisan serve

This will start a development server at http://localhost:8000. You can access the Laravel application in your web browser at this address.

Usage

You can use this API to perform CRUD operations on persons. The API provides the following endpoints:

Endpoints

  • Create a Person bash POST /api

    • Request Body:
      {
          "name": "John Doe"
      }
  • Fetch All Persons bash GET /api

  • Fetch a Person by ID bash GET /api/{id}

  • Update a Person by ID bash PUT /api/{id}

    • Request Body:
        {
            "name": "Updated Name"
        }
  • Delete a Person by ID bash DELETE /api/{id}

Testing

To run the tests for this API, you can use the following command:

bash php artisan test

Contributing

If you'd like to contribute to this project, please follow these guidelines:

  • Fork the repository.
  • Create a new branch for your feature or bug fix.
  • Make your changes and commit them.
  • Push your changes to your fork.
  • Create a pull request.

Postman Documentation

https://documenter.getpostman.com/view/21370111/2s9YC2ytRh

License

This project is open-source and available under the MIT License.

This `README.md` provides detailed instructions on how to set up, use, and contribute to your Person Management API project. Please make sure to update the placeholders and add more information as needed.

backendzuristagetwo's People

Contributors

tripletens 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.