The CMS (Car Management System) Application is a web-based system designed to manage car-related data and specifications. This application allows users to perform Create, Read, Update, and Delete (CRUD) operations on various car-related data components and specification. Here's a comprehensive guide on using the CMS Application.
- Introduction
- Technology Stack
- Project Structure
- Prerequisites
- Installation
- Database Initialization and Configuration
- Running the Application
- Functionalities
The CMS Application simplifies car data management by offering an intuitive web-based interface. Users can effortlessly perform CRUD operations on the following key components:
- Car Colors
- Car Categories
- Car Models
- Car Variants
- Car Engines
- Cars
This application ensures that car-related data can be easily viewed, added, edited, or deleted, with an added layer of security through user authentication.
- HTML
- CSS
- Python
- Flask (Web Framework)
- MySQL (Database)
The project directory includes the following files and directories:
app.py
: The main application file that initializes the Flask instance and connects various functionalities using Blueprints.auth.py
: Contains views for login,register and authentication.car.py
: Contains logic and views for CRUD operations related to Cars.car_category.py
: Contains logic and views for CRUD operations related to Car Categories.car_color.py
: Contains logic and views for CRUD operations related to Car Colors.car_engine.py
: Contains logic and views for CRUD operations related to Car Engines.car_model.py
: Contains logic and views for CRUD operations related to Car Models.car_variant.py
: Contains logic and views for CRUD operations related to Car Variants.cardb.sql
: An SQL script for initializing the database schema.db.py
: Configures the database for the CMS.
templates
: This directory contain all the HTML files.static
: This directory contain CSS and image files.
Before proceeding with the installation and execution of the application, ensure you have the following dependencies installed on your system:
- Python 3.x
- Git
- MySQL server installed and running.
-
Clone the GitHub repository to your desired location:
git clone https://github.com/lokeshdangii/CMS
-
Navigate to the "CMS" directory:
cd CMS
-
Install the required packages and libraries by executing:
pip install -r requirements.txt
Before running the application, it's essential to initialize the database and configure the connection. Follow these steps carefully:
- Import the database schema by running the SQL script (
cardb.sql
) provided in the repository. This script will create the required tables and initial data. Below are the two steps on how to import data in MySQL from the cardb.sql into the new database.
-
Login to MySQL Interpreter
mysql -u root -p
-
Create a new database
CREATE DATABASE new_database_name;
-
Use the newly created database
USE new_database_name;
-
Import the SQL script
source /path/to/cardb.sql;
-
Create a new database
mysql -u [username] -p -e "CREATE DATABASE new_database_name;"
-
Import the data from your SQL file into the newly created database
mysql -u [username] -p new_database_name < /path/to/cardb.sql
-
Create a new database
mysql -uroot -ppassword -e "CREATE DATABASE new_database_name"
-
Import the data from your SQL file into the newly created database
mysql -u username -p new_database_name < path\to\cardb.sql
-
Update the MySQL database configuration in the
db.py
file. Opendb.py
and provide your MySQL database connection details as follows:db_config = { "host": "your_database_host", "user": "your_database_user", "password": "your_database_password", "database": "your_database_name" }
Save the changes.
To launch the application, execute the following command:
flask --app app.py run
This command will start the Flask development server, and you can access the CMS Application in your web browser at http://localhost:5000.
The CMS Application offers the following essential functionalities:
- Manage Car Colors
- Manage Car Categories
- Manage Car Models
- Manage Car Variants
- Manage Car Engines
- Manage Cars
Users can easily perform CRUD operations on these components, enabling them to add, view, update, or delete entries as necessary.