This is a Next.js 13 app with Tailwindcss, Jest, and Prisma.
This app will calculate your today's score by asking simple yes or no questions about today's activity or mood. For example: "Did you work out today?" or "Did you eat healthy today?".
Because the value of activity or mood could be different from one another, each question could have a different weight to the final score.
First, install the dotenv-cli package:
yarn global add dotenv-cli
Create two databases, for the local & test environment, the DBs name is up to you. You can use any database you want as long as Prisma supported it.
Create two .env
files, .env.test
& .env.local
and set the DATABASE_URL
in each file with the corresponding connection URLs like this:
# .env.local
DATABASE_URL=mysql://ziya:my_password@localhost:3306/strive
# .env.test
DATABASE_URL=mysql://ziya:my_password@localhost:3306/strive_test
Migrate the databases
yarn migrate
yarn migrate:test
Before you can use the app locally, you need to manually insert questions
data first. Run yarn studio
to run Prisma studio and insert your questions.
Run the app locally:
yarn dev
Run the integration tests:
yarn test