This repo contains a boilerplate setup for spinning up 3 Docker containers:
- A MySQL 8 container for obvious reasons
- A Python Flask container to implement a REST API
- A Local AppSmith Server
Important - you need Docker Desktop installed
- Clone this repository.
- Create a file named
db_root_password.txt
in thesecrets/
folder and put inside of it the root password for MySQL. - Create a file named
db_password.txt
in thesecrets/
folder and put inside of it the password you want to use for the a non-root user named webapp. - In a terminal or command prompt, navigate to the folder with the
docker-compose.yml
file. - Build the images with
docker compose build
- Start the containers with
docker compose up
. To run in detached mode, rundocker compose up -d
.
Guardians is an application with the goal to provide deals and discounts to consumers on technology that is out of the mainstream large corporations. Within our design, we have Customers, Discounts, Notifications, and Products, all with the appropriate fields attributed to each one. Each customer has a first name, last name, email(s), phone number, and a promotion score. This promotional score is important because when a customer uses another customer's promo code, their promotion score increases. Each discount has the amount, the added date, the amount of likes (customers can like a discount to save it for later or emphasize the usefulness of it), the referral code, the expiration date, the retailer id, and the brand id. Notifications have a discount id for the discount it is associated with, the text of what the notification is actually saying, the status, and the date and time at which the notification is posted.The products have a name, cost, tutorial (this is for our users who may be less familiar with technology and need some guides on how/when this product could be used), product type (i.e. Computer, Phone, GPS, etc.), and brand id.
Instructions:
- Clone the repository to your local machine.
- Ensure you have Docker installed on your system.
- Add any necessary secret files containing passwords to the appropriate directories (e.g.,
secrets/
). - Build and start the containers using Docker Compose: docker-compose up
- Once the containers are up and running, the services should be accessible.
- SQL files will be automatically executed to set up the database schema and populate initial data.
- Make sure you add two .txt files called db_password and db_root_password in the secrets folder with your desired passwords for connection to the database
Shoutout to Haley, Shruthi, and Kyle for writing the SQL files. Grace added some things to the python files (discounts.py, customers.py, products.py) and is also writing the readme. Snehit did a lot of brainstorming our project idea and coming up with Guardians as a whole. We used Shruthi's computer for all of the AppSmith files, with Haley and Shruthi focused on the functionality of the AppSmith pages while Grace focused on the UI design.