Giter Site home page Giter Site logo

simpleblogmanager's Introduction

Blog Manager Application

Overview

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.

Features

  • 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.

Technologies Used

  • Next.js: For both front-end and back-end development.
  • PostgreSQL: Database management, interfaced with Prisma ORM.
  • Firebase: For image storage.

Getting Started

Prerequisites

  • Node.js
  • PostgreSQL and Prisma
  • Github account for CUD operations (Create, Update, Delete)

Installation

Follow the steps below to set up and run the application:

  1. Clone the repository:
git clone https://github.com/fahiid33/SimpleBlogManager.git
cd blog-manager
  1. Install dependencies:
npm install

This will install all the necessary dependencies for the project.

  1. installing Prisma ORM (if it's not already installed).
npm install -g prisma
  1. 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
  1. 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
  1. Generate the Prisma Client and Migrate the Prisma schema
prisma generate
prisma migrate dev --name init
  1. 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"
  1. Finally run the application:
npm run dev

Access the application: Once the application is running, you can access it at http://localhost:3000.

Troubleshooting

Slow Repository Cloning:

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 

Database Connection Issues:

Ensure PostgreSQL is running and accessible. If using Docker, verify that the container is up and the port is correctly mapped.

Environment Variables:

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 ...)

simpleblogmanager's People

Contributors

fahiid33 avatar

Stargazers

Humam Kharbouch avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.