This project serves as a boilerplate for setting up a Next.js application integrated with Firebase. It includes a basic configuration to get you started with server-side rendering (SSR) and Firebase services.
Before starting, make sure you have the following installed:
- Node.js (v16 or higher)
- Bun (for package management):
- Install Bun by running:
curl -fsSL https://bun.sh/install | bash
- Install Bun by running:
-
Firebase Setup:
- Go to the Firebase Console.
- Create a new project or use an existing one.
- In the Project Overview, click on Add App to add a web app.
- Register the app and copy the Firebase configuration.
-
Environment Variables:
- Create a
.env.localfile in the root of the project. - Add your Firebase configuration:
- Create a
-
Firebase Initialization:
- Make sure the
firebaseConfigin thelib/firebase.tsfile matches your Firebase configuration.
- Make sure the
To start the development server:
bun run devThe app will be available at http://localhost:3000.
-
Start Development Server:
bun run dev
-
Build for Production:
bun run build
-
Start Production Server:
bun start
-
Lint the Code:
bun lint
The boilerplate includes configurations for:
- Firebase Authentication
- Firebase Firestore
- Firebase Storage
You can extend this to include other Firebase services as required.
-
Bun Not Found:
- Ensure Bun is installed and added to your
PATH. - Check installation:
bun -v
- Ensure Bun is installed and added to your
-
Firebase Errors:
- Double-check your
.env.localfile for correct Firebase credentials. - Ensure the Firebase project is correctly set up in the Firebase Console.
- Double-check your
-
Port Conflicts:
- If port 3000 is already in use, specify a different port:
bun run dev --port 4000
- If port 3000 is already in use, specify a different port:
This project is licensed under the MIT License. See the LICENSE file for details.