BlogApp is a full-stack web application designed for creating and managing blog posts. It provides users with an intuitive interface to write and view posts while showcasing dynamic features like server-side rendering and a modern user experience.
Follow these steps to set up and run BlogApp locally on your machine.
Make sure you have the following installed on your system:
Clone the repository:
git clone https://github.com/marinactonci/BlogApp.git
cd BlogApp
Install dependencies:
npm install
Set up environment variables:
DATABASE_URL=postgresql://<username>:<password>@localhost:5432/<your-database-name>
GOOGLE_CLIENT_ID=<your-google-client-id>
GOOGLE_CLIENT_SECRET=<your-google-client-secret>
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=<your-generated-secret>
<your-google-client-id>
and <your-google-client-secret>
with your actual Google OAuth credentials (see below how to obtain them).NEXTAUTH_SECRET
by running the following command:openssl rand -base64 32
http://localhost:3000/api/auth/callback/google
..env
file as GOOGLE_CLIENT_ID
and GOOGLE_CLIENT_SECRET
, respectively.Initialize Prisma: If not already initialized, generate the Prisma schema:
npx prisma init
Migrate Database: Apply migrations to create the database tables:
npx prisma migrate dev
Seed the Database: Populate the database with initial data:
npx ts-node prisma/seed.ts
View the database using Prisma Studio:
npx prisma studio
npm run dev