This project is a full-stack web application that allows users to search for Chinese poetry based on different dynasties, including Tang and Song poems, as well as Shijing. The application uses React for the frontend and Node.js/Express for the backend.
Features
- View Random classic Poems at Home Page
- Search poems by dynasty (Tang, Song)
- Search Shijing poems
- Pagination support for browsing multiple pages of results
- Responsive design with Tailwind CSS
- RESTful API backend with Express and MongoDB
- Node.js (v14 or higher)
- MongoDB
git clone https://github.com/liuyuelintop/mern-chinese-poetry.git
cd mern-chinese-poetrycd server
npm install
cd client
npm install
Create a .env file in the server directory and add the following environment variables:
MONGO_URI=mongodb://localhost:27017/poetrydb
PORT=5001
Update the API_BASE_URL in client/src/api/poem.js to match your backend URL:
const API_BASE_URL = "http://localhost:5001/api";cd server
npm startThe backend server will start on http://localhost:5001.
cd client
npm start- React
- React Query
- React Router
- Axios
- Tailwind CSS
- Node.js
- Express
- MongoDB
- Mongoose
- async-handler (for handling async operations)
- Cors
GET /api/poems/dynasty/:dynasty?page=1&limit=10
GET /api/search/shijing?title=&chapter=§ion=&page=1&limit=10
mern-chinese-poetry/
├── client/
│ ├── public/
│ ├── src/
│ │ ├── api/
│ │ ├── components/
│ │ ├──hooks/
│ │ ├── pages/
│ │ ├── App.js
│ │ └── index.js
│ ├── tailwind.config.js
│ ├── postcss.config.js
│ └── package.json
├── server/
│ ├── controllers/
│ ├── db/
│ ├── middlewares/
│ ├── models/
│ ├── routes/
│ ├── .env
│ ├── index.js
│ └── package.json
└── README.md from https://github.com/liuyuelintop/mern-chinese-poetry
No comments:
Post a Comment