Skip to content

Latest commit

 

History

History
64 lines (41 loc) · 1.7 KB

README.md

File metadata and controls

64 lines (41 loc) · 1.7 KB

Authentication App 🔒

This is a basic example of an authentication application with a backend built in Laravel and a frontend in React.js. The app demonstrates user login functionality and includes a test user for demonstration purposes.

This app requires Docker to work, make sure you have docker installed in your system.

Installation 🛠️

Follow these steps to set up and run the application on your local machine:

1. Install Dependencies 🧰

Use Docker to install dependencies via Laravel Sail:

docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v $(pwd):/var/www/html \
    -w /var/www/html \
    laravelsail/php83-composer:latest \
    composer install --ignore-platform-reqs

2. Start the backend containers 🚀

Start the backend containers using Laravel Sail in detached mode:

./vendor/bin/sail up -d

3. Run Database Migrations 🗄️

Run the migrations to set up the database schema. Note that you may encounter a Connection refused error if the Sail containers are not fully ready. If this happens, wait a few seconds and retry the command.

./vendor/bin/sail art migrate

4. Seed the Database 🌱

Seed the database with a test user:

./vendor/bin/sail art db:seed

5. Install Frontend Dependencies and Run the App 🚀

Install the required frontend dependencies and compile assets:

npm i
npm run dev

6. Access the Application 🌐

Open http://localhost in your browser. You should see the login form. Use the following test credentials to log in:

After successful login, you will be redirected to a page showing the user's email and name. 🎉