Skip to content

About

成田高等学校付属小学校 お弁当注文サイト

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Order Site

A Laravel-based school lunch ordering and administration system for Narita High School Attached Elementary School (成田高等学校付属小学校).

The platform allows parents or guardians to manage lunch orders, while administrators can manage users, orders, delivery data, menus, notices, holidays, billing, and system records.

Website: https://naritaps.com/

Features

User Features

  • User registration and account management
  • Email verification
  • School lunch ordering
  • Order confirmation and cancellation
  • Notices and announcements
  • Usage guide
  • Terms of service and privacy policy

Administrator Features

  • User management
  • Order management
  • Delivery list management
  • Delivery PDF generation
  • Menu upload
  • Product and billing management
  • Holiday and suspension-date management
  • News management
  • Activity log viewing

Tech Stack

  • PHP 8.1+
  • Laravel 10
  • MySQL
  • Laravel UI
  • Laravel Sanctum
  • Blade
  • Bootstrap 5
  • JavaScript
  • Sass
  • Axios
  • Vite
  • Dompdf

Requirements

Install the following before running the project:

  • PHP 8.1 or later
  • Composer
  • Node.js and npm
  • MySQL or MariaDB

Installation

Clone the repository:

git clone https://github.com/omega0106/order-site-laravel.git
cd order-site-laravel

Install PHP dependencies:

composer install

Install frontend dependencies:

npm install

Create the environment file:

cp .env.example .env

Generate the application key:

php artisan key:generate

Configure your database in .env:

APP_NAME="Order Site"
APP_ENV=local
APP_DEBUG=true
APP_URL=http://127.0.0.1:8000

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=order_site
DB_USERNAME=root
DB_PASSWORD=

Run the database migrations:

php artisan migrate

Create the storage link:

php artisan storage:link

Clear cached configuration:

php artisan optimize:clear

Running Locally

Start the Laravel server:

php artisan serve

Start Vite in another terminal:

npm run dev

Open:

http://127.0.0.1:8000

Production Build

Build frontend assets:

npm run build

Install optimized Composer dependencies:

composer install --no-dev --optimize-autoloader

Cache Laravel configuration:

php artisan config:cache
php artisan route:cache
php artisan view:cache

Main Application Routes

Route Purpose
/ Public top page
/home Lunch ordering page
/confirm Order confirmation
/user User account page
/notice Notices
/usage Usage guide
/userManage User management
/orderManage Order management
/delivery Delivery management and PDF export
/suspension Order suspension management
/restManage Holiday management
/menu Menu management
/news News management
/product Product information
/bill Billing management
/log System logs

Run the following command to see the complete route list:

php artisan route:list

Email Configuration

The project uses Laravel mail for account verification and notifications.

Example local SMTP configuration:

MAIL_MAILER=smtp
MAIL_HOST=127.0.0.1
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="noreply@example.com"
MAIL_FROM_NAME="${APP_NAME}"

After updating email settings:

php artisan config:clear

PDF Generation

Delivery documents are generated with Dompdf.

The main delivery PDF endpoint is:

POST /delivery/pdf

If Japanese text is not rendered correctly, install and configure a Japanese-compatible font on the server.

Testing

Run the test suite:

php artisan test

Format PHP code:

./vendor/bin/pint

Project Structure

app/             Application models, controllers, mail, and services
config/          Laravel configuration
database/        Migrations, factories, and seeders
public/          Public assets
resources/       Blade templates, JavaScript, Sass, and CSS
routes/          Web and API routes
storage/         Logs, cache, sessions, and uploaded files
tests/           Automated tests

Security Notes

Before production deployment:

  • Set APP_DEBUG=false.
  • Do not commit the .env file.
  • Protect administrator routes with authentication and authorization.
  • Validate uploaded menu files.
  • Validate all order and user-management requests.
  • Use HTTPS.
  • Back up the database regularly.
  • Ensure storage and bootstrap/cache are writable.
  • Review email verification and account-management permissions.

Troubleshooting

Vite manifest not found

npm install
npm run build

Environment changes are not applied

php artisan optimize:clear

Storage files are not accessible

php artisan storage:link

Database connection error

Check the DB_* values in .env, then run:

php artisan config:clear

Permission error on Linux

chmod -R 775 storage bootstrap/cache

License

This project uses the Laravel framework, which is licensed under the MIT License. Confirm the license for the custom application code with the repository owner before redistribution.

About

成田高等学校付属小学校 お弁当注文サイト

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages