Skip to content

Commit cb96b89

Browse files
committed
add final changes
1 parent 507ece5 commit cb96b89

File tree

3 files changed

+123
-15
lines changed

3 files changed

+123
-15
lines changed

README.md

Lines changed: 122 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,128 @@
1-
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
1+
![image](./public/snap.png)
22

3-
## Getting Started
3+
![Static Badge](https://img.shields.io/badge/next-v14%2e2%2e5-f7df1e) ![Static Badge](https://img.shields.io/badge/tailwindcss-v3%2e4%2e1-38bdf8)
44

5-
First, run the development server:
5+
"[Next.js](https://nextjs.org/) is a React framework for building full-stack web applications. You use React Components to build user interfaces, and Next.js for additional features and optimizations."
6+
7+
This guide provides a first-hand experience on building a **Next.js** project with [Tailwind CSS](https://tailwindcss.com/) and deploying it on [GitHub Pages](https://pages.github.com/) using [GitHub Actions](https://github.com/features/actions).
8+
9+
## 🛠️ Installation
10+
11+
**1. Create your project.**
12+
13+
```bash
14+
# terminal
15+
npx create-next-app@latest
16+
```
17+
18+
And answer the next prompts based on your project specification needs. <small>[reference here](https://nextjs.org/docs/getting-started/installation)</small>
619

720
```bash
21+
What is your project named? project_name
22+
Would you like to use TypeScript? No / Yes
23+
Would you like to use ESLint? No / Yes
24+
Would you like to use Tailwind CSS? No / Yes
25+
Would you like to use `src/` directory? No / Yes
26+
Would you like to use App Router? (recommended) No / Yes
27+
Would you like to customize the default import alias (@/*)? No / Yes
28+
```
29+
30+
**2. Start build process.**
31+
32+
```bash
33+
# terminal
834
npm run dev
9-
# or
10-
yarn dev
11-
# or
12-
pnpm dev
13-
# or
14-
bun dev
1535
```
1636

17-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
37+
**3. Happy coding. ^^**
38+
39+
```jsx
40+
<p className="text-red-400 font-bold mt-10">Tailwind is working.</p>
41+
```
42+
43+
## 🗂️ File Structure
44+
45+
Sample project structure for reference.
46+
47+
```
48+
my-nextjs-app/
49+
├── public/
50+
│ ├── images/
51+
│ └── favicon.ico
52+
├── src/
53+
│ ├── components/
54+
│ │ └── Header.js
55+
│ ├── pages/
56+
│ │ ├── api/
57+
│ │ │ └── hello.js
58+
│ │ └── index.js
59+
│ ├── styles/
60+
│ │ ├── globals.css
61+
│ ├── utils/
62+
│ │ └── helpers.js
63+
│ └── hooks/
64+
│ └── useExample.js
65+
├── .gitignore
66+
├── package.json
67+
├── README.md
68+
└── next.config.js
69+
```
70+
71+
## 🛫 How to deploy to GitHub Pages
1872

19-
You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file.
73+
Deploying to github pages is totally up to you, be it through **[GitHub Actions](https://docs.github.com/en/actions/deployment/about-deployments/deploying-with-github-actions)**, or via **[gh-pages](https://www.npmjs.com/package/gh-pages)** package, or manually.
2074

21-
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
75+
> [!NOTE]
76+
>
77+
> Also take note that [GitHub Pages](https://pages.github.com/) have limitations, it's free, yes, but it has a limit.
2278
23-
## Learn More
79+
### ❗ via GitHub Actions in `Settings > Pages`
80+
81+
**1. Modify src paths.**
82+
83+
```js
84+
// page.js
85+
<Image
86+
src="./vercel.svg"
87+
alt="Vercel Logo"
88+
className="dark:invert"
89+
width={100}
90+
height={24}
91+
priority
92+
/>
93+
```
94+
95+
**2. Modify `next.config.mjs` to enable static exports.** <small>[reference here](https://nextjs.org/docs/pages/building-your-application/deploying/static-exports)</small>
96+
97+
```js
98+
/** @type {import('next').NextConfig} */
99+
const nextConfig = {
100+
output: 'export',
101+
};
102+
103+
export default nextConfig;
104+
```
105+
106+
**3. Add `actions`.**
107+
108+
Use default action configuration from `Settings > Pages` or use the `.github/workflows/publish.yml` file.
109+
110+
**4. Visit your deployed site in `Settings > Page`. ^^**
111+
112+
### ❗ via manually configuring github pages settings ❗
113+
114+
**1. Create your project.**
115+
Start coding your project, either use a framework like React, Vue, or not.
116+
117+
**2. Publish production build to GitHub.**
118+
Push your _production build_ to your github repo. After that, check if your `index.html` file is uploaded, since it is one of the core files needed for your website to work.
119+
120+
**3. Configure your GitHub Pages on repo Settings.**
121+
Navigate to `Settings > Pages > Build and deployment`. Make sure the **Source** says 'Deploy from a branch', and then configure the **Branch** settings and change it to your branch with the files.
122+
123+
---
124+
125+
### Learn More
24126

25127
To learn more about Next.js, take a look at the following resources:
26128

@@ -29,8 +131,14 @@ To learn more about Next.js, take a look at the following resources:
29131

30132
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31133

32-
## Deploy on Vercel
134+
### Deploy on Vercel
33135

34136
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35137

36138
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
139+
140+
---
141+
142+
🌎 [kerbethecoder](https://kerbethecoder.com/)
143+
📫 krby.cnts@gmail.com
144+
📌 July 30, 2024

next.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
3-
// basePath: process.env.NODE_ENV === 'production' ? '/sveltekit' : '',
3+
// basePath: process.env.NODE_ENV === 'production' ? '/next' : '',
44
output: 'export',
55
};
66

public/snap.png

106 KB
Loading

0 commit comments

Comments
 (0)