A Nuxt application with Google OAuth authentication and MongoDB integration.
- Google OAuth authentication using nuxt-auth-utils
- MongoDB integration with Mongoose
- User session management
- Modern UI with Tailwind CSS and shadcn/ui components
- Image hosting integration with freeimage.host
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Enable the Google+ API
- Go to "Credentials" and create an "OAuth 2.0 Client ID"
- Set the authorized redirect URI to:
http://localhost:3000/auth/google(for development) - Copy the Client ID and Client Secret
The application uses freeimage.host for image hosting. To set this up:
- Visit freeimage.host
- Create an account and get your API key
- Add the API key to your environment variables
Create a .env file in the root directory with the following variables:
# Google OAuth Configuration
NUXT_OAUTH_GOOGLE_CLIENT_ID=your_google_client_id_here
NUXT_OAUTH_GOOGLE_CLIENT_SECRET=your_google_client_secret_here
# Session Configuration (optional - will be auto-generated in development)
NUXT_SESSION_PASSWORD=your_session_password_here_min_32_chars
# MongoDB Connection
MONGODB_URI=mongodb://localhost:27017/adpl
# Freeimage.host API Key
FREEIMAGE_API_KEY=your_freeimage_api_key_here- Install and start MongoDB locally or use MongoDB Atlas
- The application will automatically create the necessary collections and indexes
- Users will be stored in the
userscollection with their Google profile information
Make sure to install dependencies:
# npm
npm install
# pnpm
pnpm install
# yarn
yarn install
# bun
bun installStart the development server on http://localhost:3000:
# npm
npm run dev
# pnpm
pnpm dev
# yarn
yarn dev
# bun
bun run devBuild the application for production:
# npm
npm run build
# pnpm
pnpm build
# yarn
yarn build
# bun
bun run buildLocally preview production build:
# npm
npm run preview
# pnpm
pnpm preview
# yarn
yarn preview
# bun
bun run previewCheck out the deployment documentation for more information.