The CSV Data Validation and Storage System is a web application built using the Laravel framework. It allows users to upload a CSV file containing user data, validate the data based on specified conditions, store the valid data in a database, and provide a summary report of the uploaded data. Users can also view and filter the list of stored users.
- Laravel
- Bootstrap
- MySQL
- Clone the repository to your local machine.
- Navigate to the project directory.
- Run the following command to install the PHP dependencies:
composer install
- Run the following command to install the JavaScript dependencies:
npm install
- Create a new MySQL database for the project.
- Rename the
.env.example
file to.env
and update the database connection details. - Generate the application key by running the following command:
php artisan key:generate
- Run the database migrations to create the necessary tables:
php artisan migrate
- Build the assets by running the following command:
npm run dev
- Start the development server:
php artisan serve
- Access the application by visiting
http://localhost:8000
in your browser.
-
Upload CSV File:
- Visit the homepage of the application.
- Click on the "Choose File" button to select a CSV file.
- Click the "Upload" button to process the file.
- The system will validate the data and provide a summary report.
-
View User List:
- Click on the "User List" link in the navigation menu.
- Use the filter form to search for users based on name, email, phone number, and gender.
Screenshot 1: Uploading a CSV file.
Screenshot 2: Summary report of the uploaded data.
Screenshot 3: List of stored users with filtering options.
Screenshot 4: Uploading another CSV file.
Screenshot 5: Summary report of the another uploaded data.
Screenshot 6: List of stored users with filtering options after another upload.
- File upload functionality with CSV validation.
- Storage of validated user data in a database.
- Summary report showing total data, successful uploads, duplicates, invalid records, and incomplete records.
- Filtering of user list based on name, email, phone number, and gender.
-
app\Http\Controllers\UserController.php:
- Location:
app\Http\Controllers\UserController.php
- Description: This file is located in the
app\Http\Controllers
directory and contains theUserController
class. It serves as the controller for user-related actions in the application, handling tasks such as rendering views, processing user input, and managing user data.
- Location:
-
app\Models\User.php:
- Location:
app\Models\User.php
- Description: This file is located in the
app\Models
directory and represents theUser
model class. It defines the structure and behavior of theusers
table in the database. TheUser
model is responsible for interacting with theusers
table, performing database operations such as retrieving, creating, updating, and deleting user records.
- Location:
-
routes\web.php:
- Location:
routes\web.php
- Description: This file is located in the
routes
directory and contains the web routes for the application. It defines the URL mappings and associates them with the corresponding controller methods. The routes in this file determine how the application handles incoming HTTP requests and routes them to the appropriate controller actions.
- Location:
-
resources\views\layouts\app.blade.php:
- Location:
resources\views\layouts\app.blade.php
- Description: This file is located in the
resources\views\layouts
directory and serves as the main layout template for the application's views. It provides a consistent structure and styling for all pages. The layout includes a navigation bar with links to upload a CSV file and view the user list. The content of each page is dynamically inserted into the designated section using the Blade templating engine. The layout also includes the necessary CSS styling by linking to the Bootstrap CSS file and the Bootstrap JavaScript bundle for interactive components.
- Location:
-
resources\views\upload.blade.php:
- Location:
resources\views\upload.blade.php
- Description: This file is located in the
resources\views
directory and represents the view for uploading CSV files. It displays a form for selecting a CSV file and uploading it to the server. The form is submitted to the designated route for file upload processing.
- Location:
-
resources\views\summary.blade.php:
- Location:
resources\views\summary.blade.php
- Description: This file is located in the
resources\views
directory and represents the view for displaying a summary report after uploading a CSV file. It shows statistics such as the total number of records, successfully uploaded records, duplicate records, invalid records, and incomplete records. It also presents detailed tables for displaying the invalid records and duplicate records with their respective errors and existing user information.
- Location:
-
resources\views\list.blade.php:
- Location:
resources\views\list.blade.php
- Description: This file is located in the
resources\views
directory and represents the view for displaying the user list. It includes a filter form allowing users to search for specific users based on name, email, phone number, and gender. The user records matching the filter criteria are displayed in a table format, showing columns for name, email, phone number, gender, and address.
- Location:
-
database\migrations\2023_06_08_141350_create_users_table.php:
- Location:
database\migrations\2023_06_08_141350_create_users_table.php
- Description: This file is located in the
database\migrations
directory and contains the migration file for creating theusers
table in the database. The migration defines the schema for theusers
table, specifying the columns such asname
,email
,phone_number
,gender
,address
, and the timestamps for creation and modification. Running this migration sets up the initial database structure required for storing user information.
- Location:
- None at the moment.
- Add pagination to the user list for better performance with a large number of records.
- Implement user authentication and access control for secure data management.
- Provide options for exporting user data in various formats (e.g., CSV, Excel).
This project is licensed under the MIT License.
For any inquiries or support, please email mahidul5130@gmail.com.