This repository contains SQL scripts to generate a database schema in MariaDB. The schema includes tables for managing recipes, comments, users, tags, and more.
To set up the database locally, you'll need Docker installed. Follow the steps below to build and run the database in a container.
-
Build the Docker Image:
docker build -t smartcooking-mariadb . -
Run the Docker Container:
docker run -d -p 3306:3306 --name Smart-Cooking_Database -e MARIADB_ROOT_PASSWORD=myrootpassword smartcooking-mariadb
-
Access the Database:
docker exec -it Smart-Cooking_Database mariadb -uroot -pmyrootpassword smartcooking
The database schema consists of the following tables:
- image: Stores image data for avatars and recipe images.
- person: Contains information about users such as name, email, and registration date.
- responsibility: Stores responsibilities associated with users.
- person_responsibility: Defines a many-to-many relationship between persons and responsibilities.
- status: Defines status options for recipes.
- language_code: Stores language information for translations.
- recipe: Represents individual recipes with details like author, cook time, and difficulty level.
- recipe_translation: Stores translations of recipe details in different languages.
- tag: Contains tags associated with recipes.
- comment: Stores comments made by users on recipes.
- comment_like: Tracks likes on comments.
- favorite: Stores information about users' favorite recipes.
- recipe_tag: Represents a many-to-many relationship between recipes and tags.
-
Clone the Repository: Clone this repository to your local machine using
git clone. -
Execute SQL Scripts: Run the provided SQL scripts in your MariaDB environment to create the database schema.
-
Customization: Modify the schema or add additional features as per your requirements.
Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or create a pull request.
This project is licensed under the MIT License.