This project is built using Fastify, TypeScript, and VueJS. It includes database migration using Prisma, CRUD APIs for categories and products, and supports MySQL for the database.
Make sure you have the latest versions of Node.js, npm, and MySQL installed on your machine.
-
Clone the repository:
git clone https://github.com/abuuer/abuuer-fastify-vue-fullstack_project.git
-
Navigate to the project directory:
cd abuuer-fastify-vue-fullstack_project
docker-compose up
this Docker Compose configuration sets up a development environment with three services: a Vue.js client, a Node.js server, and a MySQL database, each running in its own container. The dependencies are managed during container initialization. Additionally, the Prisma migration is configured to create the necessary database tables, and a seed script is executed to populate the database during the setup process.
-
Install dependencies for the Fastify backend:
cd server npm install
-
Install dependencies for the VueJS frontend:
cd client npm install
-
Ensure MySQL is running on your machine.
-
Create a new MySQL database for the project.
-
Configure the database connection in the
server/.env
file:DATABASE_URL=mysql://USER:PASSWORD@HOST:PORT/DATABASE
Run migrations to create the categories and products tables:
cd server
npx prisma migrate dev
npm run seed
-
Start the Fastify backend server:
cd server npm run dev
The Fastify server will be running on
http://localhost:3000
. -
Start the VueJS frontend:
cd client npm run serve
The VueJS application will be available on
http://localhost:8080
.
-
Backend:
- Built with Fastify and Typescript.
- Uses Prisma for database interaction.
- Implements CRUD operations for categories and products.
- Displays categories as a tree structure.
- Shows the count of products for recursive children categories.
- Handles image resizing during uploading to be 320 * 320.
-
Frontend:
- Developed with the latest version of Vue.js.
- Utilizes Vue Router for navigation.
- Implements CRUD operations for categories and products.
- Displays top parent categories and children of the selected category.
- Includes a delete button with a confirmation message.
-
Database:
- MySQL is used as the database.
- Fastify
- TypeScript
- VueJS
- Prisma
- MySQL
You can easily import the Postman collection associated with this project. Follow the steps below:
-
Locate to the project directory level:
- The file is located in the root directory under the name "fastify-vue-fullstack-project.postman_collection.json"
-
Open Postman:
- Launch Postman on your system.
-
Click on the "Import" button:
- Locate the "Import" button in the top-left corner of the Postman interface.
-
Choose "Import File":
- Select the option to "Import File."
-
Select the Postman collection file:
- Browse and choose the Postman collection file from the project directory.
This project is licensed under the MIT License - see the LICENSE file for details.