The easiest way to share your pregnancy journey with loved ones.
Keep friends and family updated with photos, milestones, and weekly progress - no app downloads required.
A comprehensive web application for tracking and sharing pregnancy journeys with family and friends. Built with Go, featuring a modern UI with Tailwind CSS, JWT authentication, SQLite database for data storage, AWS SES for email notifications, and support for photo/video uploads.
- Pregnancy Timeline: Track week-by-week pregnancy progress with updates and photos
- Village Members: Share your journey with family and friends who can view updates
- Media Support: Upload and manage photos and videos for each update
- Mobile Responsive: Beautiful, modern UI that works on all devices
- Secure Authentication: JWT-based authentication with role management
- Automated Updates: Village members receive beautiful HTML emails for new updates
- Welcome Emails: New village members get onboarded with a welcome email
- Milestone Notifications: Celebrate important pregnancy milestones
- AWS SES Integration: Reliable email delivery with tracking
- Single Binary: Go HTTP service serving both API and frontend
- SQLite Database: Lightweight database with automated migrations
- Docker Support: Easy deployment with Docker Compose
- Health Monitoring: Built-in health check endpoints
- CORS Support: API can be consumed by external clients
- Docker and Docker Compose installed
- AWS SES credentials (optional, for email notifications)
- Clone the repository:
git clone https://github.com/yourusername/40-weeks.git
cd 40-weeks- Create environment file:
cp api/.env.example api/.env
# Edit api/.env with your configuration- Start the service:
docker compose up -d- Access the application:
- Web Interface: http://localhost:8081
- Health Check: http://localhost:8081/health
- Demo credentials:
admin/password
- View logs:
docker compose logs -f simple-go- Go 1.20 or higher
- SQLite3
- Install dependencies:
cd api
go mod download- Set up environment:
cp .env.example .env
# Edit .env with your configuration- Run database migrations:
./migrate.sh up- Start the service:
go run main.goThe service will start on port 8080.
| Variable | Default | Description |
|---|---|---|
PORT |
8080 |
Server port |
JWT_SECRET |
your-secret-key-change-this |
JWT signing key (MUST CHANGE) |
DATABASE_URL |
./data/sqlite/core.db |
SQLite database file path |
BASE_URL |
http://localhost:8080 |
Base URL for emails and links |
| Variable | Default | Description |
|---|---|---|
IMAGES_DIRECTORY |
./data/images |
Directory for uploaded images |
VIDEOS_DIRECTORY |
./data/videos |
Directory for uploaded videos |
| Variable | Default | Description |
|---|---|---|
EMAIL_ENABLED |
false |
Enable email notifications |
AWS_REGION |
us-east-1 |
AWS region for SES |
AWS_ACCESS_KEY_ID |
- | AWS access key (required if email enabled) |
AWS_SECRET_ACCESS_KEY |
- | AWS secret key (required if email enabled) |
SENDER_EMAIL |
noreply@example.com |
From email address (must be verified in SES) |
SENDER_NAME |
40Weeks |
From name in emails |
POST /api/login- User loginPOST /api/register- User registrationGET /api/profile- Get current user profile (requires auth)
POST /api/pregnancies- Create new pregnancyGET /api/pregnancies- List user's pregnanciesGET /api/pregnancies/:id- Get pregnancy detailsPUT /api/pregnancies/:id- Update pregnancyDELETE /api/pregnancies/:id- Delete pregnancy
GET /api/pregnancies/:id/timeline- Get pregnancy timelineGET /api/timeline/:code- Get shared timeline (no auth required)POST /api/updates- Create new updateGET /api/updates/:id- Get update detailsPUT /api/updates/:id- Update an updateDELETE /api/updates/:id- Delete update
GET /api/pregnancies/:id/village- List village membersPOST /api/pregnancies/:id/village- Add village memberDELETE /api/pregnancies/:id/village/:memberId- Remove village member
POST /api/media/upload- Upload image or videoGET /api/media/:type/:filename- Retrieve media fileDELETE /api/media/:id- Delete media file
GET /api/email/config-test- Test email configurationPOST /api/email/test- Send test emailGET /api/email/notifications- Get notification historyGET /api/email/statistics- Email delivery statistics
The application includes a comprehensive email notification system powered by AWS SES:
- Verify your domain or email address in AWS SES
- Request production access if sending to unverified emails
- Create IAM user with SES send permissions
- Add AWS credentials to your environment
- Update Notifications: Automatically sent when new updates are posted
- Welcome Emails: Sent to new village members
- Professional Templates: Beautiful, responsive HTML emails
- Delivery Tracking: Monitor email delivery status
When EMAIL_ENABLED=false, emails are logged but not sent, making development safe.
users: User accounts with authenticationpregnancies: Pregnancy records with due dates and settingsupdates: Timeline updates with content and mediavillage_members: Family and friends with view accessmedia: Uploaded photos and videosemail_notifications: Email delivery tracking
Database migrations are managed with golang-migrate:
# Run all pending migrations
cd api && ./migrate.sh up
# Rollback last migration
./migrate.sh down
# Check migration status
./migrate.sh status
# Create new migration
./migrate.sh create "description"- Tailwind CSS: Modern utility-first CSS framework
- shadcn/ui Inspired: Clean component design system
- Vanilla JavaScript: No build step required
- Mobile First: Responsive design for all screen sizes
40-weeks/
├── api/
│ ├── main.go # Application entry point
│ ├── config/ # Configuration management
│ ├── db/ # Database layer and migrations
│ ├── middleware/ # JWT auth and CORS
│ ├── routes/ # HTTP route handlers
│ ├── services/ # Business logic (email, etc)
│ └── public/ # Frontend HTML/CSS/JS
├── docker-compose.yml # Docker composition
├── Dockerfile # Multi-stage build
└── README.md # This file
- Backend changes: Edit Go files in
api/ - Frontend changes: Edit files in
api/public/ - Database changes: Create new migration with
./migrate.sh create - Test locally before committing
- Go: Follow standard Go conventions
- Frontend: Use Tailwind classes, avoid custom CSS
- Git: Conventional commits (feat:, fix:, docs:, etc)
# Production deployment
docker compose -f docker-compose.yml up -d- Build the binary:
cd api && go build -o 40weeks main.go- Run migrations:
./migrate.sh up- Start the service:
./40weeks- Set strong
JWT_SECRETin production - Use HTTPS with a reverse proxy (nginx, Caddy)
- Configure AWS SES for production email delivery
- Set up regular database backups
- Monitor disk space for media uploads
- Authentication: JWT tokens with configurable expiration
- Password Storage: bcrypt hashing with salt
- File Uploads: Validated and sanitized filenames
- SQL Injection: Prevented using parameterized queries
- XSS Protection: Input sanitization and output encoding
- CORS: Configurable cross-origin policies
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details.
- Built with Go and Tailwind CSS
- Email delivery powered by AWS SES
- UI inspired by shadcn/ui design system
