This is a full-stack CRUD (Create, Read, Update, Delete) application for managing a store. The application is built with Node.js for the backend, Vue.js for the frontend, Axios for making HTTP requests, and Bootstrap for styling.
- Create new clients
- Read and display clients
- Update existing client
- Delete client
- Backend: Node.js, Express
- Frontend: Vue.js
- HTTP Client: Axios
- Styling: Bootstrap
- Database: MySQL
Make sure you have the following installed on your system:
- Node.js (https://nodejs.org/)
- MySQL (https://www.mysql.com/)
-
Clone the repository:
git clone [email protected]:LuisHub18/initial_project.git cd initial-project
-
Install backend dependencies:
cd backend npm install
-
Install frontend dependencies:
cd ../frontend/store npm install
-
Set up the database:
- Create a new database in MySQL.
- Run the provided SQL script to create the necessary tables.
- Update the database configuration in the backend code (e.g.,
database.js
).
-
Navigate to the backend directory:
cd backend
-
Start the backend server:
npm start
The backend server will start on
http://localhost:3000
.
-
Navigate to the frontend directory:
cd ../frontend/store
-
Start the frontend development server:
npm run dev
The frontend development server will start on
http://localhost:5173
.
- GET /api/clients: Retrieve all clients
- GET /api/clients/:id: Retrieve a specific client by ID
- POST /api/clients: Create a new client
- PUT /api/clients/:id: Update an existing client by ID
- DELETE /api/clients/:id: Delete client by ID
index.js
: Entry point of the backend applicationroutes/
: Contains route definitionscontrollers/
: Contains controller logic for handling requests
src/
: Contains the source code for the frontend applicationcomponents/
: Contains Vue componentsviews/
: Contains Vue views (pages)router/
: Contains Vue Router configurationstore/
: Contains Vuex store configuration (if applicable)
public/
: Contains static assetsmain.js
: Entry point of the frontend application
-
Install MySQL and create a new database.
-
Create the necessary tables using the following SQL script:
CREATE TABLE clientes ( id INT, nombre VARCHAR(100), apellido VARCHAR(100), direccion VARCHAR(200), telefono VARCHAR(20), curp VARCHAR(20), rfc VARCHAR(20), codigo_postal VARCHAR(10) );
-
Update the
database.js
file with your MySQL database credentials.
- Thanks to the open-source community for providing the tools and libraries used in this project.
- Special thanks to the developers who contributed to Vue.js, Node.js, Axios, Bootstrap, and MySQL.