Skip to content

Pop-up store for the Léonard de Vinci Melun high school

Notifications You must be signed in to change notification settings

Lasauce6/VinciShop

Repository files navigation

VinciShop

Lycée Léonard de Vinci

Pop-up store of the business BTS at Lycée Léonard de Vinci in Melun

About The Project

This project was made with the purpose of learning how to use Laravel.

The students of business BTS at Lycée Léonard de Vinci in Melun had to create a pop-up store to sell beekeeping products.

I was in charge of the website, so I decided to use Laravel to learn how to use it.

Built With

Getting Started

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

Prerequisites

Installation

  1. Clone the repo
git clone https://github.com/Lasauce6/VinciShop.git && cd VinciShop
  1. Install Composer packages
composer install
  1. Create a copy of your .env file
cp .env.example .env
  1. Generate an app encryption key
php artisan key:generate
  1. Create an empty database for our application

For Mysql:

mysql -u root -p
CREATE DATABASE the_name_of_your_database;

For Sqlite:

touch database/database.sqlite
  1. In the .env file, add database information to allow Laravel to connect to the database

For Mysql:

DB_CONNECTION=mysql
DB_HOST=your_host
DB_PORT=your_port
DB_DATABASE=the_name_of_your_database
DB_USERNAME=your_username
DB_PASSWORD=your_password

For Sqlite:

DB_CONNECTION=sqlite
DB_DATABASE=your_database_path
  1. Create the tables in the databases

For Mysql:

CREATE TABLE produits (
    id INTEGER PRIMARY KEY,
    nom TEXT NOT NULL,
    description TEXT NOT NULL,
    prix DECIMAL(5,2) NOT NULL,
    image TEXT NOT NULL,
    qte INTEGER NOT NULL
);

CREATE TABLE commandes (
    id INTEGER PRIMARY KEY AUTO_INCREMENT,
    prenom VARCHAR(40) NOT NULL,
    nom VARCHAR(40) NOT NULL,
    email VARCHAR(40) NOT NULL,
    panier TEXT NOT NULL,
    total DECIMAL(5,2) NOT NULL,
    updated_at DATE NOT NULL,
    created_at DATE NOT NULL
);

For Sqlite:

CREATE TABLE produits (
    id INTEGER PRIMARY KEY,
    nom TEXT NOT NULL,
    description TEXT NOT NULL,
    prix DECIMAL(5,2) NOT NULL,
    image TEXT NOT NULL,
    qte INTEGER NOT NULL
);

CREATE TABLE commandes (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    prenom VARCHAR(40) NOT NULL,
    nom VARCHAR(40) NOT NULL,
    email VARCHAR(40) NOT NULL,
    panier TEXT NOT NULL,
    total DECIMAL(5,2) NOT NULL,
    updated_at DATE NOT NULL,
    created_at DATE NOT NULL
);
  1. Migrate the database
php artisan migrate
  1. Start the local development server
php artisan serve
  1. You can now access the server at http://localhost:8000

  2. To create admin credentials, uncomment the function createCreds() in the file app/Http/Controllers/AdminController.php and modify it to your needs. Uncomment the line 27 in the file routes/web.php and access the page http://localhost:8000/admin/createCreds. Then, comment the function createCreds() and the line 27 in the file routes/web.php.

Laravel Logo

About

Pop-up store for the Léonard de Vinci Melun high school

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages