A web application for curating and organizing a personal collection of words, phrases, quotes, and hypotheticals.
- Frontend: Next.js 14+ with TypeScript and Tailwind CSS
- Backend: Netlify Functions (serverless)
- Database: MongoDB
- Authentication: JWT with bcrypt
- Testing: Vitest with fast-check for property-based testing
├── app/ # Next.js app directory
├── components/ # React components
├── lib/ # Utility functions and shared logic
├── netlify/functions/ # Netlify serverless functions
├── types/ # TypeScript type definitions
├── .env.example # Environment variables template
└── netlify.toml # Netlify configuration
- Node.js 18+
- npm or yarn
- MongoDB Atlas account (or local MongoDB instance)
-
Clone the repository
-
Install dependencies:
npm install
-
Copy
.env.exampleto.envand fill in your environment variables:cp .env.example .env
-
Generate a password hash for your admin user:
npx tsx scripts/generate-password-hash.ts yourPassword123
Copy the output and add it to your
.envfile. -
Update the environment variables in
.env:MONGODB_URI: Your MongoDB connection stringJWT_SECRET: A strong secret key for JWT tokens (generate withnode -e "console.log(require('crypto').randomBytes(32).toString('hex'))")ADMIN_USERNAME: Your admin username (default: admin)ADMIN_PASSWORD_HASH: The bcrypt hash from step 4AUTHOR_IMAGE_API_URL: External API URL for author images (optional)AUTHOR_IMAGE_API_KEY: API key if required (optional)
-
Set up database indexes:
npx tsx scripts/setup-db.ts
Run the development server with Netlify Functions:
netlify devOr run Next.js directly (without serverless functions):
npm run devOpen http://localhost:8888 (netlify dev) or http://localhost:3000 (npm run dev) to view the application.
Login at /admin/login with your configured username and password.
Run tests:
npm testRun tests in watch mode:
npm run test:watchnpm run buildThe application is configured for deployment on Netlify:
- Connect your repository to Netlify
- Set environment variables in Netlify dashboard
- Deploy!
See .env.example for required environment variables.
Private project - All rights reserved.