This project is a general-purpose AutoMind system, "AutoMind," designed to manage various aspects of a business, including products, sales, customers, and more. It is powered by the Laravel framework.
- 1. Project Overview
- 2. Tech Stacks
- 3. Architectural Overview
- 4. Installation for Local Network
- 5. Usage
- 6. Project Structure
- 7. Contribution Guidelines
- 8. To Dos
AutoMind is a web-based Enterprise Resource Planning (ERP) solution built with Laravel. It provides modules for managing product inventory, processing sales, tracking expenses, handling customer information, and more. The system aims to offer a robust and extensible foundation for small to medium-sized businesses.
- Laravel: 11.48.0
- PHP: 8.4.1
- Databases:
- MySQL 5.7+ (Recommended with XAMPP, version may vary) (Optional)
- SQLite (Optional)
- Frontend: Vue.js (for frontend components, as suggested by
lara-vuedirectory)
This project adheres to modern software design principles, specifically implementing the Repository and Service Patterns to ensure a clean separation of concerns and maintainability. This architecture also aligns with SOLID principles:
- Repository Pattern: Data access logic (e.g., fetching, storing, updating, deleting records) is encapsulated within dedicated Repository classes (e.g.,
ProductRepository,SaleRepository). This abstracts the data source from the business logic, making it easier to swap out ORMs or databases in the future without affecting the core application. - Service Layer: Business logic and complex operations are housed in Service classes (e.g.,
ProductService,SaleService). These services coordinate between one or more repositories, perform validation, and execute multi-step processes. Controllers interact solely with these services, keeping them thin and focused on handling HTTP requests and responses.
This approach significantly enhances testability, modularity, and scalability of the application.
This guide provides instructions for setting up the project on a local machine.
- Install the latest stable Composer (PHP dependency manager).
- Ensure Node.js and npm (Node Package Manager) are installed for frontend dependencies.
- (Optional, for MySQL): Install the latest stable XAMPP (includes Apache, MySQL, PHP).
- Clone the project from your Git repository to your web server's document root (e.g.,
xampp/htdocsfor XAMPP users). - Rename the cloned folder to your desired project name (e.g.,
AutoMind).
Navigate to your project's root directory in your terminal (e.g., cd C:/xampp/htdocs/AutoMind).
- Run
composer installto install PHP dependencies. - Duplicate the
.env.examplefile and rename it to.env. - Generate an application key:
php artisan key:generate. - Open the
.envfile in a text editor to configure your database:
- In your project's
database/directory, create an empty file nameddatabase.sqlite. - Modify your
.envfile as follows:Ensure to provide the full absolute path to yourDB_CONNECTION=sqlite DB_DATABASE=/absolute/path/to/your/project/database/database.sqlite # Comment out or remove MySQL-specific variables # DB_HOST=127.0.0.1 # DB_PORT=3306 # DB_USERNAME=root # DB_PASSWORD=
database.sqlitefile.
- Start your XAMPP application (Apache and MySQL services).
- Go to your browser and open
localhost/phpmyadmin. Create a new database namedtinyerp. - Modify your
.envfile as follows:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=tinyerp DB_USERNAME=root # Or your MySQL username DB_PASSWORD= # Your MySQL password (leave blank if none)
- Run Migrations and Seeders:
php artisan migrate --seed
- Install Laravel Passport:
Note: A default user will be inserted with username
php artisan passport:install
admin@tinyerp.comand passwordadmin@12345.
- In your project's root directory in the terminal, run
npm installto install JavaScript dependencies. - Compile frontend assets:
npm run dev # For development npm run prod # For production
If you're using XAMPP's Apache, configure it to serve your project's public directory.
- Open the
xampp/apache/conf/httpd.conffile. - Change the
DocumentRootand<Directory>directives to point to your project'spublicfolder. For example, if your project folder isAutoMind:DocumentRoot "C:/xampp/htdocs/AutoMind/public" <Directory "C:/xampp/htdocs/AutoMind/public"> AllowOverride All Require all granted </Directory>
- Restart the Apache service in XAMPP.
- You can now access the application in your browser by navigating to
localhost.
Once installed, the application exposes a RESTful API. You can interact with it using tools like Postman or by building a frontend client.
Default Admin Credentials:
- Username:
admin@tinyerp.com - Password:
admin@12345
Use these credentials to obtain an OAuth token via Laravel Passport, which will then allow you to access protected API endpoints.
Key directories and their roles:
app/Http/Controllers/API: Contains the API controllers, now lean and interacting primarily with the Service layer.app/Repositories: Houses the Repository classes, responsible for abstracting data access logic from the application.app/Services: Contains the Service classes, where the core business logic and orchestration of repositories reside.database/migrations: Database schema definitions.database/seeds: Initial data for the database.database/database.sqlite: The SQLite database file (if using SQLite).public: The web server's document root.resources/js: Frontend JavaScript files, including Vue.js components.routes/api.php: API route definitions.
Contribution guidelines will be added in a future update. Please adhere to the existing code style and architectural patterns.
- Dashboard
- User account CRUD
- Purchasing Module