This project is a full-stack application using Next.js 15 for the frontend and Laravel 11 for the backend. It allows users to:
- Create accounts and log in/logout using JWT authentication.
- Manage a to-do list with CRUD functionality (Create, Read, Update, Delete).
The backend is a Laravel-based API, while the frontend is a Next.js application that communicates with the API.
- Node.js (v18+)
- Composer (v2+)
- PHP (v8.2+)
- MySQL
- React
- Laravel Sanctum
- Database migration tools
-
Clone the repository:
git clone https://github.com/iamdul/Todo-App.git cd server -
Install dependencies:
composer install
-
Set up environment variables:
- Duplicate the
.env.examplefile as.env. - Update database connection settings (e.g., DB_DATABASE, DB_USERNAME, DB_PASSWORD).
- Duplicate the
-
Generate the application key:
php artisan key:generate
-
Run migrations:
php artisan migrate
-
Run the development server:
php artisan serve
The server will be available at
http://127.0.0.1:8000.
-
Navigate to the frontend folder:
cd client -
Install dependencies:
npm install
-
Set up environment variables:
- Duplicate the
.env.local.examplefile as.env.local.
- Duplicate the
-
Run the development server:
npm run dev
The application will be available at
http://localhost:3000.
-
Create an Account:
- Navigate to the registration page on the frontend and provide the required details.
- The data will be sent to the backend API for validation and storage.
-
Log in:
- Enter your credentials on the login page.
- Upon successful login, a JWT will be stored in the browser’s local storage.
-
Manage To-Do List:
- Add, view, update, and delete tasks using the to-do list interface.
- All actions are authorized using the JWT.
- Ensure that the backend server is running before testing the frontend.
- Use Postman or a similar tool to test API endpoints during development.
- Refer to the respective
package.jsonandcomposer.jsonfiles for additional dependencies.
-
Frontend not connecting to API:
- Verify that the API URL in
.env.localmatches the backend’s URL.
- Verify that the API URL in
-
Database errors:
- Ensure migrations have been run and the database credentials are correct in the
.envfile.
- Ensure migrations have been run and the database credentials are correct in the
Feel free to submit issues or pull requests to improve the project. For major changes, please open an issue first to discuss your ideas.