Welcome to the Phoenican repository!

Inspired by the Phoenicians' high ability to price and market, this tool was developed!

🤷 How it works ? This tool has the function of capturing data from a CSV file to update the database.

👨‍💻 What was used?

Technologies and Skills
Frontend
~ Javascript
~ Vite + React
~ Axios
~ csv-parser
Backend
~ Typescript
~ Express
~ ORM(Prisma)
~ SQL Database(MySQL)
~ Postman
~ MySQL Workbench



UML Data Model

In this project, we provide a UML data model to represent the Product and Pack entities. Below is the textual representation of the classes and their relationships:

Class Product

  • code: BigInt
  • name: String
  • costprice: Decimal
  • salesprice: Decimal

Relationships:

  • packs: A product can have multiple packs (one-to-many).
  • components: A product can have multiple components (one-to-many).

Class Pack

  • id: BigInt
  • pack_id: BigInt
  • product_id: BigInt
  • qty: BigInt

Relationships:

  • pack: A pack



Flow application

-> Click on the link https://youtu.be/cd-5jhuSElE to see the application flow



Guidelines

1º Step

Clone the repository:

git clone git@github.com:oligregz/phoenician-manager.git



2º Step

Access the project directory:

cd phoenician-manager



3º Step

Install the project's dependencies in the application's parent directory with the commands:

yarn
yarn dev-i



4º Step

Navigate to the 'backend' directory, configure your environment variable according to the examples passed in the .env.example file and then rename it to .env



5º Step

Perform the necessary table migrations for your database with the command:

yarn prisma migrate dev

Attention: Make sure you have the database created on your machine or on a docker container. If your models were not created in the database, copy the migration files created in the "migrations" directory that is inside the prism directory and run them in your database.



6º Step

Fill your database with the data passed in the "database.sql" file present in the application's parent directory.



7º Step

Make sure you are in the application's parent directory and launch it in the terminal with:

yarn dev

Tip: The application can have the backend and frontend layers started separately, pay attention to the json!



OBS:

If you want to view the application's request routes, navigate in your terminal to https://editor.swagger.io/ Go to 'file' and attach the application documentation json file which is in the '/doc-api' directory