A quantified self app to help you track anything about yourself.
It can be helpful to have time series data to understand health and wellbeing issues. It can be hard to remember to fill in the information needed to build up data like this.
The idea with notimon is to get notifications periodically to help you collect the data regardless of your schedule. To make it as effortless as possible, notimon shows multiple choice questions. You can answer any number of the questions you have time for by selecting the most fitting option.
Run the database
docker compose up dbThis will create two databases:
notimon(main development database)notimon_test(test database)
Install dependencies
# Install dependencies
npm installSet up the database
# Generate Prisma client
npx prisma generate
# Make and run database migrations locally
npx prisma migrate devRun the dev server
npm run dev
This is a Next.js project bootstrapped with create-next-app.
NEXTAUTH_SECRETyour-super-secret-jwt-secret-here-replace-with-random-stringNEXTAUTH_URLe.g.http://localhost:3000DATABASE_URLe.g.postgresql://postgres:postgres@localhost:5432/notimon
npx prisma migrate deploy
npm run send-questionsts-node --project tsconfig.node.json scripts/sendDailyQuestions.tse.g.
0 9 * * * cd /path/to/notimon && /usr/local/bin/npm run send-questionsNotimon supports web push notifications for Chrome and Safari on iOS. When the send-questions command runs, users who have:
- Subscribed to at least one question
- Enabled push notifications
Will receive a notification saying "Time to fill in your answers!"
- Generate VAPID keys:
npm install -g web-push
web-push generate-vapid-keys- Add environment variables to
.env.local:
VAPID_PUBLIC_KEY=your_vapid_public_key_here
VAPID_PRIVATE_KEY=your_vapid_private_key_here- Users can enable push notifications in their Account page
For detailed setup instructions including Safari iOS support, see PUSH_NOTIFICATIONS_SETUP.md.
The test database is automatically created when you start Docker. To manage migrations:
# Deploy all pending migrations to the test database (safe for CI/CD)
npm run prisma:migrate:testBefore running tests for the first time, make sure to set up the test database:
npm testThe admin CLI allows you to manage topics and questions. Here's how to use it:
# Create a new topic
npm run admin -- create-topic -n "Health" -d "Health-related questions"
# List all topics
npm run admin -- list-topics# Create a new question (with options)
npm run admin -- create-question -t "How many hours did you sleep?" -o "0-4" "4-6" "6-8" "8+"
# Create a question and associate it with topics
npm run admin -- create-question -t "How many hours did you sleep?" -o "0-4" "4-6" "6-8" "8+" --topics topic_id_1 topic_id_2
# List all questions
npm run admin -- list-questions
# Associate an existing question with a topic
npm run admin -- add-question-to-topic -q question_id -t topic_id# Reset a user password by email (password is entered via hidden prompt)
npm run admin -- reset-user-password -e "user@example.com"Each command supports the --help flag for more information:
npm run admin -- --help
npm run admin -- create-topic --help
npm run admin -- create-question --help
npm run admin -- reset-user-password --helpRemember: When passing arguments to the admin script through npm, you need to add -- before the arguments.