kimek / playground-vanilla-php-login

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vanilla PHP Login System

A test login system built in 4 hours with vanilla PHP, featuring user registration, login, and file uploads.

Note: This code is a demonstration of my skills and is not perfect.

Requirements

  • PHP: 7.0 or above
  • MySQL: 5.7 or above
  • PHP Modules:
    • php-mysql
    • php-pdo

Installation

  1. Clone the repository:

    git clone https://github.com/kimek/playground-vanilla-php-login.git
    cd playground-vanilla-php-login
  2. Set up the database:

    • Create a new MySQL database, tables, user:
      mysql -u your_username -p < migration/migration.sql
  3. Configure the application:

    • If you would like to use custom DB credentials, update config.php.
  4. Ensure required PHP modules are installed:

    • You can check for installed modules using the following command:
      php -m
    • To install missing modules, use:
      sudo apt-get install php-mysql php-pdo

Usage

  1. Start your local development server:

    php -S localhost:8000
  2. Access the application:

Features

  • User Registration
  • User Login
  • File Upload

Folder Structure

  • public/index.php - Main entry point for the application.
  • public/api.php - Vanilla api script.
  • public/assets/ - Contains stylesheets and JavaScript files.
  • public/uploads/ - File upload folder.
  • config/config.php - Configuration file for database.
  • migration/migration.sql - Contains the SQL schema for setting up the database.
  • src/controllers/userSystem.php - Login and registration handling script.
  • src/inc/file_handling.php - File upload handling script.
  • src/inc/json_helper.php - Json helper for api.
  • src/inc/db_connection.php - DB handling script.
  • src/view/ - Basic page content.

Contributing

If you wish to contribute to this project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature-name).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/your-feature-name).
  5. Open a Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

Contact

For any questions or inquiries, please create contribution issue ticket.

About


Languages

Language:PHP 61.1%Language:CSS 33.3%Language:JavaScript 5.6%