A fully-featured Medium-like blog platform built with modern web development tools. The project provides a seamless experience for creating, reading, updating, and deleting blog posts. It includes user authentication, input validation, and scalable backend architecture.
- Frontend: Responsive user interface built with React.
- Backend: Serverless backend powered by Cloudflare Workers and the Hono framework.
- Database: PostgreSQL database for reliable data storage.
- ORM: Prisma for database management and queries.
- Authentication: JSON Web Tokens (JWT) for secure user authentication.
- Validation: Zod for schema validation.
- Programming Language: TypeScript for type-safe development.
Technology | Purpose |
---|---|
React | Frontend framework |
Cloudflare Workers | Serverless backend architecture |
Hono | Lightweight web framework |
PostgreSQL | Database |
Prisma | ORM for database operations |
Zod | Schema validation library |
JWT | Authentication mechanism |
TypeScript | Language for type safety |
medium-like-blog/
├── frontend/ # React application
├── backend/ # Cloudflare Workers code
├── prisma/ # Prisma schema and migrations
├── public/ # Static assets
├── scripts/ # Utility scripts
└── README.md # Project documentation
-
Clone the repository:
git clone https://github.com/your-username/medium-like-blog.git cd medium-like-blog
-
Install dependencies for the frontend:
cd frontend npm install
-
Install dependencies for the backend:
cd ../backend npm install
-
Set up the PostgreSQL database:
- Create a new PostgreSQL database.
- Update the
.env
file in thebackend/
directory with your database connection string.
-
Apply Prisma migrations:
npx prisma migrate deploy
-
Start the development server:
- Frontend:
cd frontend npm start
- Backend:
cd ../backend npm run dev
- Frontend:
Create a .env
file in the backend/
directory with the following variables:
DATABASE_URL=your-database-url
JWT_SECRET=your-jwt-secret
- Start the frontend and backend servers as described above.
- Access the application .
- Create an account, log in, and start writing blog posts!
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add some feature"
- Push to the branch:
git push origin feature-name
- Open a pull request.