/LaravelBlogApi

A blog API using Laravel

Primary LanguagePHPMIT LicenseMIT

LaravelBlogApi

📗 Table of Contents

📖 Laravel Blog API

This is a blog application built with Laravel as the API backend and Vue.js as the frontend. Users can register, login, create, read, update, and delete blog posts. Additionally, users can like and comment on blog posts.

🛠 Built With

Tech Stack

  • PHP Version 8.0.28 with Laravel v9.52.12 framework for the backend API.
  • MySQL database for data storage.
  • Vue.js and Tailwind CSS for the frontend.
  • JWT for authentication.
  • Axios for making API requests.
  • Laravel Mix for compiling frontend assets.
Client
Server
Database

Key Features

  • User registration and login with JWT token-based authentication
  • CRUD functionality for blog posts (title, description, and image)
  • Ability for users to like and comment on blog posts
  • Follows SOLID principles for clean and maintainable code

(back to top)

🚀 Live Demo

  • [Not yet available]

(back to top)

💻 Getting Started

To get a local copy up and running, follow these steps.

Prerequisites

You will need any code editor, dependncy manager and a database, most preferrably, MySQL. PHP version used is 8.1

Setup

Clone this repository to your desired directory:

  git clone https://github.com/rloterh/LaravelBlogApi.git
  cd LaravelBlogApi
  git checkout dev

Install Dependencies:

Open project with a code editor and install this project with:

  composer install
  npm install

Configure Local Environment:

  1. Create a .env file based on the .env.example file and update the database configuration.
  2. Generate the application key and add to the .env file:
  php artisan key:generate

Compile the Vue.js Frontend:

After installing the npm dependencies, run the following command to compile the Vue.js frontend:

  npm run dev

Create and Seed the Database:

Run the following commands to create the necessary database tables and seed some initial data:

  php artisan migrate
  php artisan db:seed

Start the Development Server:

Run the following command to start the Laravel development server:

  php artisan serve

Access Your Application:

Once the server is running, open your web browser and visit

http://127.0.0.1:8000

Register and Login:

If the application requires authentication, you can register a new user and log in using the registration and login forms.

(back to top)

👥 Author

👤 Robert Loterh

GitHub
LINKEDIN
EMAIL
TWITTER

(back to top)

🔭 Future Features

  • Unit and integration tests for API endpoints.
  • Fix The Frontend

(back to top)

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

(back to top)

⭐️ Show your support

If you like this project...

(back to top)

🙏 Acknowledgments

I would like to thank the Propelond team for this task.

(back to top)

📝 License

This project is MIT licensed.

(back to top)