Skip to content

developermithu/nextjs-api-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a8b764d Β· Mar 25, 2025

History

56 Commits
Mar 19, 2025
Mar 25, 2025
Mar 24, 2025
Mar 21, 2025
Mar 24, 2025
Mar 25, 2025
Mar 25, 2025
Mar 19, 2025
Mar 19, 2025
Mar 24, 2025
Mar 25, 2025
Mar 19, 2025

Repository files navigation

Next.js + Laravel Rest API

A minimalist seo friendly blog application built with Next.js and Laravel REST API.

Features

  • πŸ” Authentication with Laravel Sanctum
  • πŸ‘€ User and Admin roles
  • πŸ“ Blog post management
  • 🎨 Modern UI with Tailwind CSS
  • πŸ”„ Real-time data updates with SWR
  • πŸ“± Responsive design

Installation

  1. Clone the repository:
git clone https://github.com/developermithu/nextjs-api-blog.git
cd nextjs-api-blog
  1. Install dependencies:
npm install or bun install
  1. Create a .env.local file in the root directory and add the following content:
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
  1. Start the development server:
npm run dev or bun dev
  1. Open http://localhost:3000 in your browser to view the application.

Login with the following credentials:

# Admin Info:
Email: [email protected]
Password: admin

# User Info:
Email: [email protected]
Password: user

Project Structure

β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ (auth)/              # Authentication routes
β”‚   β”‚   β”œβ”€β”€ (main)/              # Public routes
β”‚   β”‚   β”œβ”€β”€ dashboard/           # Protected dashboard routes
β”‚   β”‚   β”œβ”€β”€ styles/              # Global styles
β”‚   β”‚   β”œβ”€β”€ layout.jsx           # Root layout
β”‚   β”‚   └── page.jsx             # Home page
β”‚   β”œβ”€β”€ components/              # Reusable components
β”‚   β”œβ”€β”€ hooks/                   # Custom React hooks
β”‚   β”œβ”€β”€ lib/                     # Utilities and configurations
β”‚   └── services/                # API service functions

Authentication

The application uses Laravel Sanctum for authentication. The authentication flow is handled through the useAuth hook, which provides:

  • Login, Register and Logout functionality

Dependencies

Key dependencies used in this project:

Made with ❀️ by developermithu

About

Minimalist blog using Next.js and Laravel Rest API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published