A full-stack notes app built with TanStack Start and MongoDB, showcasing type-safe server functions, SSR, and a clean MongoDB integration.
Before you begin, ensure you have:
- Node.js 18+ (Node.js 22+ recommended for best compatibility)
- npm, pnpm, or yarn package manager
- MongoDB - Either:
- Local MongoDB installation, OR
- Free MongoDB Atlas account (sign up here)
git clone https://github.com/didicodes/tanstack-start-mongodb-notesapp.git
cd tanstack-start-mongodb-notesappnpm install
# or
pnpm install
# or
yarn installChoose one of these options:
- Create a free account at MongoDB Atlas
- Create a new cluster (free tier available)
- Create a database user:
- Go to "Database Access"
- Click "Add New Database User"
- Choose password authentication
- Set permissions to "Read and write to any database"
- Whitelist your IP address:
- Go to "Network Access"
- Click "Add IP Address"
- Choose "Allow Access from Anywhere" (0.0.0.0/0) for development
- Get your connection string:
- Go to "Database" → "Connect" → "Connect your application"
- Copy the connection string
- Replace
<password>with your database user password - Replace
myFirstDatabasewithnotes-app
If you have MongoDB installed locally:
macOS (with Homebrew):
brew services start mongodb-communityLinux (with systemd):
sudo systemctl start mongodWindows: MongoDB should start automatically as a service.
# Copy the example environment file
cp .env.example .envEdit .env and add your MongoDB connection string:
# For MongoDB Atlas
# MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/notes-app
# For local MongoDB
# MONGODB_URI=mongodb://localhost:27017/notes-appImportant: Replace username, password, and cluster with your actual values!
npm run devThe app will start at http://localhost:3000