Couchbase Capella Starter

Couchbase Capella Starter
Type: Code
Framework: Next.js
CSS: Tailwind
Database: Couchbase
  • Overview: A Next.js project integrated with Couchbase Capella for managing user profiles, using Vercel for deployment.

Prerequisites for Vercel Deployment:

  • A Vercel account.
  • Access to a Couchbase Capella database with the Query Service enabled or signing up for a free Capella database during the integration flow.
  • Creation of a user_profile bucket and a profile collection within the _default scope in Capella.

Deployment Steps on Vercel:

  • Click on the Deploy button provided in the documentation.
  • Follow the steps prompted, including the integration step that connects to Couchbase Capella.
  • Upon deployment, sample profiles will be automatically added, and you can interact with the application to create, update, and delete user profiles.

Common Pitfalls and FAQs:

  • Issues like infinite loading, bucket not found, or parsing errors typically indicate incorrect bucket setup or environment variable configuration.
  • A 504 Gateway Timeout error usually suggests connectivity issues between the application and the database.

Live Demo:

Tech Stack:

  • Next.js for the frontend.
  • Tailwind CSS for styling.
  • Couchbase Capella as the backend database.
  • Vercel for deployment.

Running Locally:

  • Requires a Couchbase Capella database or a local Couchbase 7+ database.
  • Node.js & NPM installed.
  • Clone the project and install dependencies with npm install.
  • Manually create a user_profile bucket and profile collection in Capella for local development.
  • Update .env.local with the necessary environment variables, including Couchbase credentials and connection string.
  • Initialize the database with npm run init-db:local and optionally load sample data with npm run load-sample-data.
  • Run the application with npm run dev and access it at localhost:3000.

Sample Data:

  • The project includes a MOCK_DATA.json file for testing, which can be manually imported into Capella or loaded locally using the provided npm script.

Additional Notes:

  • The .env.default file is for testing and Gitpod instances to facilitate setup.
  • For Capella databases, manual setup of the bucket, collection, and indices is necessary, followed by npm run build-indexes to create required indices.

Running Tests:

  • Integration tests are included and can be run after initializing the database with npm run init-db:default followed by npm test.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.