Welcome to the Techozon Blog Platform! This is a demo project built using Next.js, Tailwind CSS, and Firebase Firestore. It showcases a simple blog application where users can read and explore blog posts.
To get started with this project, follow the steps below to set it up on your local machine.
Go to the Firebase Console.
Create a new project (e.g., techozon-blog-platform
).
Navigate to the Firestore Database section and create a new database.
Set up your database rules to allow read/write access during development. (Make sure to secure these rules in production!) ```json service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read, write: if true; // Adjust rules for production } } }
Create a blogs
collection and add some sample blog documents with the following structure:
{
"title": "Blog Title",
"content": "This is the content of the blog post.",
"imageUrl": "https://example.com/image.jpg",
"createdAt": "2024-10-01T16:52:44.855Z",
"author": "Author Name"
}
Obtain your Firebase configuration details from the project settings and add them to a .env.local
file in your project root:
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_auth_domain
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_storage_bucket
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
src/
├── app/
│ ├── blog/
│ │ ├── [id]/
│ │ │ └── page.js # Blog detail page
│ │ └── page.js # Blog listing page
│ ├── layout.js # Main layout for the application
│ └── page.js # Home page
├── components/
│ ├── BlogCard.js # Blog card component
│ └── Navbar.js # Navigation bar component
├── firebase/
│ └── config.js # Firebase configuration
├── styles/
│ └── globals.css # Global CSS styles
└── public/
└── favicon.ico # Favicon for the app
Clone this repository:
git clone https://github.com/yourusername/techozon-blog-platform.git
cd techozon-blog-platform
Install the dependencies:
npm install
Run the development server:
npm run dev
Open your browser and go to http://localhost:3000
to view the application.
This application can be easily deployed on Vercel. Follow these steps:
.env.local
file.If you would like to contribute to this project, feel free to fork the repository and submit a pull request. Make sure to adhere to the coding standards and write clear commit messages.
This project is licensed under the MIT License. See the LICENSE file for more details.
Thank you for checking out the Techozon Blog Platform! Feel free to reach out with any questions or feedback.
### Final Note:
Make sure to replace `yourusername` with your actual GitHub username in the clone command, and update any other details as necessary for your project. Let me know if you need any further modifications!