Code Monkey home page Code Monkey logo

client-manager's Introduction

Client Manager

This is a full-stack application built with PHP and MySQL. It is a simple client manager that allows you to add, edit, and delete clients and their addresses.

edit-page

What I learned

There aren't a lot of recent resources online when it comes to using pure PHP in 2024, so I wrote a blog post sharing the things I learned.

Learning PHP in 2024 - DEV Community

Overview

The application has the following structure:

  • public/index.php is the application's entry point, where the autoloader is required and the application is started.
  • src/Core contains the application core, such as implementing the Router, Database, Renderer, etc.
  • src/Handlers contains the request handlers for the application routes.
    • GET requests call the handler loader method if it exists
    • POST requests call the action method if it exists.
    • Handlers can also have a render method to render the HTML template.
  • src/Middleware contains the middleware classes such as Auth and Guest middlewares for protected routes.
  • src/templates contains the HTML templates rendered with Plates.
  • src/routes.php registers the application routes and their handlers.
  • src/utils.php contains helper functions like dd for debugging.

Running with Docker

  1. Make sure you have Docker installed:
docker -v
  1. Start the application and the database with Docker Compose:
docker-compose up -d
  1. Open your browser and navigate to http://localhost:8888.

You can log in with the following credentials:

Email: [email protected]
Password: 123456

Running locally

  1. Make sure you have PHP 8.*, Composer, and Docker installed:
php -v
composer -v
docker -v
  1. Install the dependencies:
composer install
  1. Start the database with Docker Compose:
docker-compose up -d db

This command will start a MySQL database on port :3306.

You can also use a local version of MySQL, just make sure to update the .env file with your database credentials.

  1. Start the application:
composer start

This command will copy the .env.example file to .env and start the PHP built-in server.

  1. Open your browser and navigate to http://localhost:8888.

You can log in with the following credentials:

Email: [email protected]
Password: 123456

Cleaning up Docker

To stop the Docker containers, run:

docker-compose down -v --rmi all

This will stop the containers, remove the volumes, and delete the images.


Made with ๐Ÿงก by @jvzaniolo

client-manager's People

Contributors

jvzaniolo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.