Skip to content

marceloxhenrique/Nexus

Repository files navigation

Nexus

Nexus is a modern blogging platform where writers, thinkers, and creators can share their insights and stories with the world. Whether you’re passionate about technology, literature, or personal experiences, Nexus provides a seamless and engaging space for self-expression.

Technologies

TYPESCRIPT_BADGE ReactJS Next.js Tailwind Shadcn/ui Zod React Query Prisma AWS Vercel

Prerequisites

Install and Run Nexus Locally

1. Clone the repository

git clone [email protected]:marceloxhenrique/nexus.git
cd Nexus

2. Install dependencies

npm install
# or
yarn install

3. Set up environment variables

Create a .env file in the root directory and add your credentials:

# Required: Used by both Prisma and the app to connect to your database
DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public"

#Only needed if you're running Postgres using Docker
POSTGRES_USER=johndoe
POSTGRES_PASSWORD=randompassword
POSTGRES_DB=mydb

# Backend API URL
NEXT_PUBLIC_BACKEND_URL=http://localhost:3000/api

# BetterAuth configuration
BETTER_AUTH_SECRET=YOUR_SECRET
BETTER_AUTH_URL=http://localhost:3000

# AWS (used for image uploads)
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_BUCKET_NAME=
AWS_BUCKET_REGION=
NEXT_PUBLIC_AWS_URL=

# OAuth credentials
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=

# Email (for notifications/auth)
USER_GMAIL=
PASSWORD_GMAIL=

# Cron job security
CRON_SECRET=

Note:

If you're using Docker to run your database (recommended for local development), the POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB variables will be used to initialize the container.

You still must set DATABASE_URL, it's required by both Prisma and the application to connect to the database.

Start the database container with:

docker compose up -d

4. Run prisma migrations

npx prisma migrate dev

5. Run the development server

npm run dev
# or
yarn dev

Then open http://localhost:3000 in your browser.

Features

  • Write & Publish: Create and share blog posts easily.
  • User Authentication: Secure login and registration powered by BetterAuth.
  • Rich Content: Format your articles with images, links, and code blocks.
  • Comments: Readers can comment on articles and engage in discussions.
  • User Profiles: Personalized profile pages showcasing user info and articles.
  • Image Uploads: Drag-and-drop images upload with AWS S3 integration.
  • Likes & Following: Users can like articles and follow their favorite authors.
  • Blog Experience: A clean, Medium-inspired blogging platform focused on reading and writing.

Contribute

If you want to contribute, fork this repo, create your work branch and get your hands dirty!

  1. git clone [email protected]:marceloxhenrique/nexus.git
  2. git checkout -b feature/NAME
  3. Follow commit patterns

  4. Open a Pull Request explaining the problem solved or feature made, if exists, append screenshot of visual modifications and wait for the review!