Setting up a local database
In order to set up a local MySQL database to work with the app, you must include the following variables in your .env file:
DB_HOST='localhost'
DB_PORT=3306
DB_NAME='restauwants'
LOCAL_DB_ROOT_PASSWORD='root'You then must run docker compose up inside a terminal to launch the Docker container associated with the local database, and once the database is running, in a separate terminal the command pnpm run db:push to populate the database with its initial tables.
What if I have problems?
The best way to resolve issues with the local databse is through the Adminer instance. If you need to remove all tables in the database:
- Start the Docker container.
- Visit localhost:8080.
- Log in with your configured username and password.
- Click on the ‘restauwants’ database.
- Select all tables in the database and click ‘drop’.