Welcome to the Blogging App frontend project! This project is built using Next.js 13, React 18, TypeScript, Tailwind CSS, react-hook-form, and Zod validation. This documentation will guide you through the setup and development process.
https://blogging-app-one.vercel.app/
- Node.js 20.5.1. version installed and pnpm 8.6.5. installed.
- Basic knowledge of Next.js, React, TypeScript, Tailwind, react-hook-form, and Zod validation.
-
Clone the repository to your local machine:
git clone https://github.com/michaela9/blogging-app.git
-
Navigate to the project directory and install dependencies: cd blogging-app
pnpm install
- Run the development server:
pnpm dev
src/
│
├── app/
│ ├── public/
│ │ ├── home/
│ │ │ └── page.tsx
│ │
│ └── protected/
│ ├── my-articles/
│ │ └── page.tsx
│
├── components/ # Reusable UI components
│
├── containers/ # Complex components often connected to a store or displaying a list of components
│
└── types/ # TypeScript type definitions
.
.
.
- ESLint: For catching and fixing JavaScript/TypeScript issues.
- Prettier: For consistent code formatting.
-
Linting:
pnpm lint
orpnpm lint:fix
-
Formatting with Prettier:
pnpm format
orpnpm format:fix
const fetchPost = async (formData) => {
try {
const response = await axios.post(url, formData, {
method: "POST",
headers: {
"Content-Type": contentType,
"X-API-KEY": `${process.env.NEXT_PUBLIC_API_KEY}`,
Authorization: token,
},
});
setResponse(response);
return response.data;
} catch (error) {
setError(error as AxiosError);
return null;
} finally {
...
}
}
This project is built with a server-side first approach in mind, but client-side rendering is used almost everywhere. It's structured to allow easy transformation to server-side rendering if required.
For testing purposes, you can use testing user which I will send you via email.
Tests: Automated testing is currently missing and will be added in the future. Comments Logic: The comments functionality is under development.