Skip to content

Victor-Zarzar/blog-post

Repository files navigation

Blog Post - Full Stack Application (NextJS)

TypeScript Next.js Drizzle ORM Docker TailwindCSS GitHub Actions

Modern full-stack blog platform built with Next.js, featuring Drizzle ORM, Better-Auth authentication, Redis (Cache service), internationalization, and containerized deployment.


Tech Stack

Core Technologies

  • TypeScript - Type-safe development
  • React - Latest React features
  • Next.js - React framework with App Router
  • PostgreSQL - Robust relational database
  • Tailwind CSS - Utility-first CSS framework
  • Docker - Containerized deployment

Features & Integrations

  • Authentication System - Secure user authentication and session management
  • Drizzle ORM - Type-safe ORM for PostgreSQL
  • Zod & React Hook Form - Form validation and management
  • Shadcn UI - Beautiful and accessible components
  • Dark Mode - Theme switching with Next Themes
  • i18n - Multi-language support (EN / PT-BR / ES) via Next Intl
  • Nodemailer - Email functionality
  • Sanitize HTML - XSS protection for user inputs
  • Rate Limiter Flexible - API endpoint rate limiting and DDoS protection
  • Sentry - Error tracking and performance monitoring tool
  • Redis Bun API Native - In-memory cache layer for session storage and performance optimization

Prerequisites

Before starting, ensure you have the following installed:

  • Bun (v1 or higher) – primary runtime & package manager
  • Docker – for containerized development and deployment
  • Git

Optional: Node.js (v22 or higher), if you prefer running the app with Node or using Node-based global tooling.


Installation & Setup

1. Clone the Repository

git clone https://github.com/Victor-Zarzar/blog-post
cd blog-post

2. Open in your editor (example: Zed Editor)

zed .

3. Environment Configuration

Copy the example environment file and configure your credentials:

cp .env-example .env

Then edit .env with your actual values. The .env-example file contains detailed comments explaining each variable and how to obtain the necessary credentials.

Key configurations needed:

  • Database: PostgreSQL connection string
  • Sentry: DSN and authentication token from your Sentry project
  • Website URL: Your production domain or http://localhost:3000 for development

Important: Never commit your .env file to version control. It's already in .gitignore.

4. Install Dependencies

make install

Or manually with bun:

bun install

5. Set Up Database

make db-migrate

Or manually:

bun db:generate
bun db:migrate

6. Run the automated tests (Isolated Docker container)

make test

Or manually with bun:

bun test

Usage

Available Commands

View all available Make commands:

make help

Local Development

Start the development server (port 3000):

make dev

Access the application at http://localhost:3000

Docker Deployment

Build and Run

Build the Docker image and start the container:

make run

Stop Container

make stop

View Logs

make logs

Or directly with Docker:

docker logs -f blog-post

Access Container Shell

make shell

Clean Environment

Remove containers, images, and build artifacts:

make clean

Development

Code Linting & Formatting

Check for code issues with Biomejs:

bun biome check

Format all files and apply linting fixes:

bunx biome format --write

This command will automatically format your code according to the project's style rules and fix any auto-fixable linting issues.

Database Management

# Generate
bun db:generate

# Create a new migration
bun db:migrate

# Open Drizzle Studio (Database GUI)
bun db:studio

Build for Production

make prod

Screenshots

Project Mockup

mockup

Project Architecture

architecture


Deployment

Vercel (Recommended - Production)

The application is deployed on Vercel for production use.

Deploy with Vercel

Important: Don't forget to add all environment variables from .env-example to your Vercel project settings.

  • CI/CD Pipeline - .github/workflows/main.yaml for automated checks and builds
  • Dependabot - Monthly dependency updates for GitHub Actions and dependencies

Docker (Optional - Local Development)

Docker is available as an optional tool for local containerized development:

docker build -t blog-post:production .
docker run -d -p 3000:3000 --name blog-post-prod blog-post:production

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contributing

  1. Fork the project
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

Report issues at: https://github.com/Victor-Zarzar/blog-post/issues


License

This project is licensed under the MIT License - see the LICENSE file for details.


Author

Victor Zarzar - @Victor-Zarzar

Project Link: https://github.com/Victor-Zarzar/blog-post


About

Modern full-stack blog platform built with Next.js, featuring Drizzle ORM, Better Auth, PostgreSQL, Redis, i18n and containerized deployment.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors