This is a Newspaper project built using Next.js 14, Node.js 22.x, npm 10.9, TypeScript, Prisma, and PostgreSQL with the latest Tailwind CSS.
Before you begin, ensure you have the following installed:
-
Clone the repository:
git clone https://github.com/sabbir073/nextjs-newspaper-CMS.git
-
Navigate to the project directory:
cd nextjs-newspaper-CMS
-
Install the dependencies:
npm install
-
Create the database:
Ensure your PostgreSQL server is running, and create a new database with user and password. Later I will configure a remote postgresql so you will not need to create db locally.
For now, install postgresql and create database. you can also use your default user postgres and password.
-
Configure Prisma:
Create a .env in project root, or update if its already created.
Update the
DATABASE_URL
in your.env
file to point to your PostgreSQL database:DATABASE_URL="postgresql://USER:PASSWORD@localhost:5432/Databse_name"
-
Migrate the database:
We already have a prisma schema, so Don't worry about the DB table. If you migrate, it will create table automatically.
To create tables based on your Prisma schema, run:
npx prisma migrate dev --name init
-
Seeding the database:
If you have a seed file configured, you can seed the database with initial data:
npm run seed
-
Creating a table:
To create or modify your Prisma schema, edit the
schema.prisma
file. Then run the migration command:npx prisma migrate dev --name create_table_name
-
Updating a table:
Modify the
schema.prisma
file to reflect changes in your table structure. Then run:npx prisma migrate dev --name update_table_name
-
Deleting a table:
Remove the corresponding model from the
schema.prisma
file. Run the migration command to reflect this change:npx prisma migrate dev --name delete_table_name
npx prisma studio
To start the development server, run:
npm run dev
Your application will be running at http://localhost:3000
.
If you would like to contribute to this project, please fork the repository and create a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js
- Tailwind CSS
- Prisma
- PostgreSQL
inbound rules original 103.209.109.237/32