A social story-sharing web application where users can share daily thoughts and emotions, interact with posts, and track their daily MeoMeo scores.
- Frontend: React 18+ with Vite, TypeScript
- Backend: Netlify Functions (Node.js/TypeScript)
- Database: Turso (cloud SQLite)
- Authentication: JWT tokens
- Deployment: Netlify
- Node.js 18+ installed
- npm or yarn package manager
- Turso account (free tier sufficient) - Sign up here
- Netlify CLI (for local development) -
npm install -g netlify-cli
# Install frontend dependencies
cd frontend
npm install
# Install backend function dependencies
cd ../netlify/functions
npm install- Create a Turso account at https://turso.tech
- Install Turso CLI:
brew install tursodatabase/tap/turso(macOS) or see Turso docs - Login:
turso auth login - Create a database:
turso db create thatlameomeo - Get your database URL and auth token:
turso db show thatlameomeo # Note the URL and auth token
Create a .env.local file in the project root:
# Copy the example file
cp .env.example .env.localThen edit .env.local with your values:
# Turso Database
TURSO_DATABASE_URL=libsql://your-database-name-org.turso.io
TURSO_AUTH_TOKEN=your-auth-token-here
# JWT Secret (generate a strong random string)
# You can generate one with: openssl rand -base64 32
JWT_SECRET=your-strong-random-secret-key-here
# Netlify (for local dev)
NETLIFY_DEV=true# Run initial schema migration
turso db shell thatlameomeo < migrations/001_initial_schema.sql
# Run additional migrations (likes, comments, etc.)
turso db shell thatlameomeo < migrations/002_add_likes_comments.sqlSince the app uses admin-provided accounts (no sign-up), you need to create users manually:
# Using the helper script
node scripts/create-user.js <username> <password>
# Example:
node scripts/create-user.js admin mypassword123
node scripts/create-user.js alice secretpass
node scripts/create-user.js bob password123Or manually using Turso CLI:
# First, hash your password using the helper script
node scripts/hash-password.js mypassword123
# Then insert the user (replace <hashed-password> with the output)
turso db shell thatlameomeo
INSERT INTO users (username, password_hash, meomeo_score, theme_preference)
VALUES ('admin', '<hashed-password>', 0, 'default');You'll need two terminal windows:
Terminal 1 - Frontend:
cd frontend
npm run devFrontend will be available at http://localhost:3000
Terminal 2 - Netlify Functions (Backend):
# From project root
netlify devFunctions will be available at http://localhost:8888/.netlify/functions/
The frontend is configured to proxy API requests to the Netlify Functions automatically.
- Open http://localhost:3000 in your browser
- Login with one of the accounts you created
- Start sharing stories!
node scripts/create-user.js <username> <password>
# Examples:
node scripts/create-user.js admin admin123
node scripts/create-user.js alice alice123
node scripts/create-user.js bob bob123-
Hash a password:
node scripts/hash-password.js yourpassword
-
Insert user into database:
turso db shell thatlameomeo
Then in the SQL shell:
INSERT INTO users (username, password_hash, meomeo_score, theme_preference, display_name) VALUES ('username', '<hashed-password-from-step-1>', 0, 'default', 'Display Name');
thatlameomeo/
├── frontend/ # React + Vite app
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API service layer
│ │ └── hooks/ # Custom React hooks
│ └── package.json
├── netlify/
│ └── functions/ # Serverless API functions
│ ├── login.ts
│ ├── stories.ts
│ ├── users.ts
│ ├── likes.ts
│ ├── comments.ts
│ ├── shares.ts
│ └── utils/
├── migrations/ # Database migrations
├── scripts/ # Helper scripts
├── .env.local # Environment variables (git-ignored)
└── netlify.toml # Netlify configuration
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLintnpm run format- Format code with Prettier
npm run lint- Run ESLintnpm run format- Format code with Prettier
| Variable | Description | Required |
|---|---|---|
TURSO_DATABASE_URL |
Turso database connection URL | Yes |
TURSO_AUTH_TOKEN |
Turso database authentication token | Yes |
JWT_SECRET |
Secret key for JWT token signing | Yes |
NETLIFY_DEV |
Enable Netlify dev mode | Optional |
- Ensure functions are in
netlify/functions/directory - Check
netlify.tomlfunctions path is correct - Verify function exports default handler
- Make sure
netlify devis running
- Verify
TURSO_DATABASE_URLandTURSO_AUTH_TOKENare set in.env.local - Check Turso database is active
- Ensure network allows outbound connections
- Try running:
turso db show thatlameomeoto verify connection
- Verify
JWT_SECRETis set in environment - Check token expiration (default 24h)
- Ensure token is included in Authorization header
- Netlify Functions handle CORS automatically
- If issues occur, check
netlify/functions/utils/errors.tsfor CORS configuration
- Frontend default port: 3000 (change in
frontend/vite.config.ts) - Netlify dev default port: 8888 (change with
netlify dev --port <port>)
- Install Netlify CLI:
npm install -g netlify-cli - Login:
netlify login - Initialize site:
netlify init - Add environment variables in Netlify dashboard:
- Go to Site Settings → Environment Variables
- Add all variables from
.env.local
- Deploy:
netlify deploy --prod
- ✅ User authentication with JWT
- ✅ Create and share stories (public/private)
- ✅ Like and comment on posts
- ✅ Share posts with shareable links
- ✅ Profile management (avatar, display name)
- ✅ Archive and delete posts
- ✅ Daily MeoMeo score tracking
- ✅ Theme selection (4 cat-themed styles)
- ✅ User feed with interactions
MIT