Modified to fit my family use, this version is based on Original Application here: Sprout Track (https://github.com/Oak-and-Sprout/sprout-track)
- Fixed time picker to automatically switch to minute selection
- Fixed feeding default unit in Quick Stats
- Allow to use keyboard at login screen for desktop user
- Added new unit (drops) in medicine section
- Added chart function to have an overview about entries
- Added note function for feed entry
- Added tool to reset admin password
- Added setting to enable/disable swiping to change date in log entry
- Change Setup Wizard logic
- Add support for Hermes notification service when it's time for feeding or diary (can notify in advance 1/5/10/15/30 mins)
- Git (to clone the repository)
- Node.js (v22+) and NPM (v10+)
- Bash shell (for running the setup script)
- Clone the repository:
git clone https://github.com/leonguyen52/sprout-track.git
cd sprout-track- If deploying to a restricted directory (like /var/www), set proper permissions:
# For standard web server directories like /var/www
sudo chown -R $(whoami):$(whoami) .
# Or specify your web server user (e.g., www-data)
# sudo chown -R www-data:www-data .- Give execute permissions to the scripts folder:
chmod +x scripts/*.sh- Run the setup script:
./scripts/setup.shTry out Sprout Track at our live demo: https://www.sprout-track.com/demo
The demo environment is refreshed every 1 hour.
- ID:
01 - PIN:
111111
To deploy the latest version using Docker:
x64:
docker pull sprouttrack/sprout-track:0.94.24x64arm64:
docker pull sprouttrack/sprout-track:0.94.24arm64docker-compose up -d- Next.js with App Router
- TypeScript
- Prisma with SQLite (
/prisma) - TailwindCSS for styling
- Docker for containerization (optional)
- Git (to clone the repository)
- Node.js (v22+) and NPM (v10+)
- Bash shell (for running the setup script)
- Clone the repository:
git clone https://github.com/leonguyen52/sprout-track.git
cd sprout-track- If deploying to a restricted directory (like /var/www), set proper permissions:
# For standard web server directories like /var/www
sudo chown -R $(whoami):$(whoami) .
# Or specify your web server user (e.g., www-data)
# sudo chown -R www-data:www-data .- Give execute permissions to the scripts folder:
chmod +x scripts/*.sh- Run the setup script:
./scripts/setup.shThis setup script will:
- Install all dependencies
- Generate the Prisma client
- Run database migrations
- Seed the database with initial data (default PIN: 111222)
- Build the Next.js application
After setup completes, you can run the application in development or production mode as instructed in the setup output.
If you prefer to set up manually or the setup script doesn't work for your environment:
-
Ensure Node.js (v22+) and NPM (v10+) are installed
-
Install dependencies:
npm install- Generate Prisma client:
npm run prisma:generate- Run database migrations:
npm run prisma:migrate- Seed the database:
npm run prisma:seednpm run dev- Build the application:
npm run build- Run the production server:
npm run startOpen http://localhost:3000 with your browser to see the result.
The default security PIN after setup is: 111222
Default /family-manager password is: admin Note: The family manager settings page is where you can set domain, whether to use https://, email settings, and download the database. It's recommended you download the database before each upgrade.
After installation, when you first access the application, you'll be guided through a setup wizard that helps you configure the essential settings for your Sprout Track instance.
The application includes a built-in Setup Wizard (src/components/SetupWizard) that walks you through the following steps:
-
Family Setup
- Enter your family name and link/slug
- On initial setup you can import data from a previous version (just import the old *.db file from the /db folder)
-
Security Setup
- Choose between a system-wide PIN or individual caretaker PINs
- For system-wide PIN: Set a 6-10 digit PIN
- For individual caretakers: Add caretakers with their own login IDs and PINs
- First caretaker must be an admin
- Each caretaker needs a 2-character login ID and 6-10 digit PIN
-
Baby Setup
- Enter baby's information (first name, last name, birth date, gender)
- Configure warning times for feeding and diaper changes
- Default warning times: Feed (2 hours), Diaper (3 hours)
The Setup Wizard ensures your application is properly configured with the necessary security settings and initial data before you start tracking your baby's activities.
npm run dev- Start development servernpm run build- Build for productionnpm start- Start production servernpm run lint- Run ESLint
By default, the application runs on port 3000. To change the port:
- Open
package.jsonin your preferred text editor - Locate the "scripts" section
- Modify the "dev" and/or "start" scripts to include the
-pflag followed by your desired port number:
"scripts": {
"dev": "next dev -p 4000", // Development server will run on port 4000
"start": "next start -p 8080" // Production server will run on port 8080
}This change will persist across application updates. For Docker deployments, use the PORT environment variable as described in the Docker section.
npm run prisma:generate- Generate Prisma clientnpm run prisma:migrate- Run database migrationsnpm run prisma:seed- Seed the database with initial datanpm run prisma:studio- Open Prisma Studio to view/edit database
./scripts/setup.sh- Complete initial setup (Node.js check, dependencies, database, build)./scripts/env-update.sh- Check and update environment configuration (creates ENC_HASH if missing)./scripts/update.sh- Update application (git pull, prisma operations, build)./scripts/deployment.sh- Full deployment process (backup + update + service management)./scripts/backup.sh- Create a backup of the application and database./scripts/service.sh {start|stop|restart|status}- Manage the application service
./scripts/generate-test-data.sh- Interactive test data generation with customizable parameters./scripts/generate-test-data-automated.sh- Automated test data generation (for cron jobs/CI/CD)./scripts/generate-test-data.js- JavaScript data generation logic
./scripts/family-migration.js- Migrate existing data for multi-family support./scripts/family-update.sh- Update database after multi-family migration./scripts/ensure-utc-dates-improved.js- Convert all database dates to UTC format
1. Backup your database:
Before upgrading, it is recommended to back up your baby-tracker.db file. You can do this by downloading the file from the settings page in either the main app or the family manager pages.
2. For Docker deployments:
- Stop the old container.
- Pull the latest Docker image.
- Start the new container.
- Import your backed-up database file from the inital setup page. The import process will automatically handle any required database migrations or updates.
3. For local (non-Docker) builds:
- Run the deployment script:
This script will handle all necessary updates and migrations. You do not need to re-import your database, as the script manages updates in place.
./scripts/deployment.sh
The application can be configured using environment variables in the .env file. Here are the available options:
| Variable | Description | Default | Example |
|---|---|---|---|
DATABASE_URL |
Path to the SQLite database | "file:../db/baby-tracker.db" |
"file:/path/to/custom/db.sqlite" |
SERVICE_NAME |
Name of the systemd service | "baby-tracker" |
"sprout-track" |
AUTH_LIFE |
Authentication token validity period in seconds | "86400" (24 hours) |
"43200" (12 hours) |
IDLE_TIME |
Idle timeout before automatic logout in seconds | "28800" (8 hours) |
"3600" (1 hour) |
APP_VERSION |
Application version | "0.9.0" |
"1.0.0" |
COOKIE_SECURE |
Whether cookies require HTTPS connections | "false" |
"true" |
ENC_HASH |
Encryption hash for admin password security | Auto-generated | 64-character hex string |
The ./scripts/env-update.sh script automatically manages environment variables:
- Creates
.envfile if it doesn't exist - Generates a secure
ENC_HASH(64-character random hex) if missing - Used during setup and deployment processes
- DATABASE_URL: Changing this after initial setup requires migrating your data manually.
- AUTH_LIFE: Lower values increase security but require more frequent logins.
- IDLE_TIME: Determines how long a user can be inactive before being logged out.
- ENC_HASH: Automatically generated for admin password encryption; do not modify manually.
- COOKIE_SECURE:
- Set to
"false"to allow cookies on non-HTTPS connections (development or initial setup) - Set to
"true"when you have an SSL certificate in place (recommended for production) - When set to
"true", the application will only work over HTTPS connections
- Set to








