A modern, full-stack blogging platform built with React, TypeScript, and Hono.js. ExpressLog allows users to create, read, update, and manage blog posts with user authentication and a responsive design.
- User Authentication: Secure signup and login with JWT tokens
- Blog Management: Create, read, update, and delete blog posts
- User Profiles: Personal user dashboard and profile management
- Responsive Design: Modern UI built with Tailwind CSS
- Protected Routes: Secure access to user-specific features
- Real-time Updates: Dynamic content loading and state management
- React 19 - Modern React with latest features
- TypeScript - Type-safe development
- Vite - Fast build tool and development server
- Tailwind CSS - Utility-first CSS framework
- React Router - Client-side routing
- Axios - HTTP client for API calls
- React Icons - Icon library
- Headless UI - Accessible UI components
- Hono.js - Fast, lightweight web framework
- Prisma ORM - Type-safe database client
- PostgreSQL - Relational database
- JWT - JSON Web Tokens for authentication
- Cloudflare Workers - Serverless deployment
- ESLint - Code linting and formatting
- PostCSS - CSS processing
- pnpm - Fast, disk space efficient package manager
- TypeScript - Static type checking
expresslog/
├── frontend/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components
│ │ ├── contexts/ # React context providers
│ │ ├── hooks/ # Custom React hooks
│ │ └── routes/ # Route configurations
│ └── public/ # Static assets
├── backend/ # Hono.js API server
│ ├── src/
│ │ ├── routes/ # API route handlers
│ │ ├── middlewares/ # Custom middleware
│ │ └── prismaFunction.ts
│ └── prisma/ # Database schema and migrations
└── common/ # Shared types and utilities
- Node.js (v18 or higher)
- pnpm package manager
- PostgreSQL database
- Cloudflare account (for deployment)
-
Clone the repository
git clone <repository-url> cd expresslog
-
Install dependencies
# Install frontend dependencies cd frontend pnpm install # Install backend dependencies cd ../backend pnpm install # Install common package dependencies cd ../common pnpm install
-
Set up environment variables
Create
.env
file in the backend directory:DATABASE_URL="postgresql://username:password@localhost:5432/expresslog" JWT_SECRET="your-secret-key"
-
Set up the database
cd backend npx prisma generate npx prisma db push
-
Run the development servers
Backend:
cd backend pnpm dev
Frontend:
cd frontend pnpm dev
POST /api/v1/user/signup
- User registrationPOST /api/v1/user/signin
- User loginPOST /api/v1/verify-token
- Token verification
GET /api/v1/blog/bulk
- Get all blogsPOST /api/v1/blog
- Create new blog (protected)PUT /api/v1/blog
- Update blog (protected)GET /api/v1/blog/:id
- Get specific blogDELETE /api/v1/blog/:id
- Delete blog (protected)
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
password String
blog Blog[]
}
model Blog {
id Int @id @default(autoincrement())
title String
content String
published Boolean @default(false)
createdAt DateTime @default(now())
author User @relation(fields: [authorId], references: [id])
authorId Int
}
The frontend is configured for deployment on Netlify with the following settings:
- Build command:
pnpm run build
- Publish directory:
dist
- Base directory:
frontend
The backend is deployed using Cloudflare Workers:
cd backend
pnpm deploy
Frontend:
pnpm dev
- Start development serverpnpm build
- Build for productionpnpm lint
- Run ESLintpnpm preview
- Preview production build
Backend:
pnpm dev
- Start development serverpnpm deploy
- Deploy to Cloudflare Workerspnpm cf-typegen
- Generate Cloudflare types
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Shashwat Shiv - GitHub
⭐ If you found this project helpful, please give it a star!