Welcome to the Blog Manager Application! This full-stack application is built with Next.js, providing users with a seamless experience for managing blog posts. It features user authentication, real-time commenting, category-based filtering, and more.
-
Authentication:
- Users can log in using GitHub authentication.
- Non-authenticated users can only view blogs and cannot create, edit, delete, or comment on blog posts.
-
Blog Management:
- Create Blogs: Authenticated users can create new blog posts by uploading an image and providing a title, description, and category.
- Update Blogs: Users can update their existing blog posts.
- Delete Blogs: Users can delete their existing blog posts.
-
Comments: Users can add comments to blog posts in real-time by clicking on the blog name.
-
Category and Search:
- Users can view blog posts by category.
- Users can search for blog posts by name.
-
Theme: Users can switch between dark and light modes.
-
Logout: Users can log out, limiting their access to only viewing blog posts.
- Next.js: For both front-end and back-end development.
- PostgreSQL: Database management, interfaced with Prisma ORM.
- Firebase: For image storage.
- Node.js
- PostgreSQL and Prisma
- Github account for CUD operations (Create, Update, Delete)
Follow the steps below to set up and run the application:
- Clone the repository:
git clone https://github.com/fahiid33/SimpleBlogManager.git
cd blog-manager
- Install dependencies:
npm install
This will install all the necessary dependencies for the project.
- installing Prisma ORM (if it's not already installed).
npm install -g prisma
- Install PostgreSQL
install PostgreSQL on your local machine if it's not already installed.
Ubuntu:
sudo apt update
sudo apt install postgresql postgresql-contrib
Mac (using Homebrew):
brew install postgresql
- Create Database and User
If you are not using Docker, you need to manually create the database and user in PostgreSQL:
Switch to the PostgreSQL user:
sudo -i -u postgres
Open the PostgreSQL prompt:
psql
Create the database and user, and grant the user access to the database:
sql
CREATE DATABASE mydb;
CREATE USER new_user WITH ENCRYPTED PASSWORD 'newuser123';
GRANT ALL PRIVILEGES ON DATABASE mydb TO new_user;
Exit the PostgreSQL prompt:
\q
Exit the PostgreSQL user:
exit
- Generate the Prisma Client and Migrate the Prisma schema
prisma generate
prisma migrate dev --name init
- Set up environment variables
Create a .env file in the root directory and add the following variables:
DATABASE_URL="postgresql://new_user:newuser123@localhost:5432/mydb?schema=public"
URL = "http://localhost:3000"
- Finally run the application:
npm run dev
Access the application: Once the application is running, you can access it at http://localhost:3000.
If the cloning process is slow, you can try a shallow clone to only fetch the latest commits:
git clone --depth 1 https://github.com/fahiid33/SimpleBlogManager.git
Ensure PostgreSQL is running and accessible. If using Docker, verify that the container is up and the port is correctly mapped.
Double-check the .env file for correct database connection details.
For any issues or contributions, feel free to open a pull request or issue on the repository.
[!NOTE]
the domain in about section of the repository will only show you how website look, you will not be able to do CRUD operations e.g interact with the database, it's just a preview of what the website is looking like (in progress ...)