Skip to content

di-void/courierplus-blog-api

Repository files navigation

Courier Blogging System

Overview

This repo contains a solution to an assessment, i.e to build a blogging system with REST API endpoints for interaction and CRUD functionalities.

blog system

Table of Contents

Get started

Requirements

You will need the following tools installed on your computer to run the project.

Installation

  1. Clone the repo

    git clone https://github.com/Di-void/courierplus-blog-api.git
    cd courierplus-blog-api
  2. Install dependencies

    Run Composer to install the required PHP packages.

    composer install
  3. Environment setup

    Copy the example environment file to your environment file.

    cp .env.example .env
  4. Generate application key

    php artisan key:generate
  5. Database migration and seeding

Note

This command will seed the database with a test, authenticated user that will be used to interact with the various actions in the system.

php artisan migrate --seed

Running the Application

  1. Start the development server

    php artisan serve

    This will start the application on http://127.0.0.1:8000

  2. API Testing (with Postman)

    • Import the Postman collection from your Postman app import button
    • Test the endpoints test endpoints

Commands

Running tests

To run tests:

php artisan test

testing

Artisan commands

  • List all artisan commands

    php artisan list

API Endpoints

List of API endpoints.

Blogs

  • GET /api/v1/blogs - Fetch all blogs
  • POST /api/v1/blogs - Create a new blog
  • GET /api/v1/blogs/{id} - Read a blog
  • PATCH /api/v1/blogs/{id} - Update a blog
  • DELETE /api/v1/blogs/{id} - Delete a blog

Posts

  • GET /api/v1/posts - Fetch all posts
  • POST /api/v1/posts - Create a new post
  • GET /api/v1/posts/{id} - Read a post
  • PATCH /api/v1/posts/{id} - Update a post
  • DELETE /api/v1/posts/{id} - Delete a post
  • POST /api/v1/posts/{id}/like - Like a post
  • POST /api/v1/posts/{id}/comment - Comment on a post

About

Blogging System - Assessment

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published