Skip to content

Commit 8dae6bf

Browse files
committed
docs: revamp README with improved developer guide and project structure
1 parent d8e159d commit 8dae6bf

File tree

1 file changed

+52
-68
lines changed

1 file changed

+52
-68
lines changed

README.md

Lines changed: 52 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,83 @@
1-
# ALPHA HKU Official Website
1+
# ALPHA HKU Website
22

3-
This is the official website for the ALPHA University Chapter at the University of Hong Kong, built with Next.js, TypeScript, and shadcn/ui.
3+
![ALPHA HKU Logo](./public/ALPHA-HKU.png)
4+
> The official website for the ALPHA University Chapter at the University of Hong Kong.
45
5-
## Getting Started
6+
This guide is for developers maintaining or contributing to this project.
67

7-
### Prerequisites
8+
## Tech Stack
89

9-
- [Node.js](https://nodejs.org/en/) (v18 or later)
10-
- [pnpm](https://pnpm.io/installation)
10+
- Framework: [Next.js](https://nextjs.org/) (App Router)
11+
- Language: [TypeScript](https://www.typescriptlang.org/)
12+
- UI: [shadcn/ui](https://ui.shadcn.com/)
13+
- Animations: [Framer Motion](https://www.framer.com/motion/)
14+
- Styling: [Tailwind CSS](https://tailwindcss.com/)
15+
- Code Quality: [ESLint](https://eslint.org/) & [Prettier](https://prettier.io/)
16+
- Package Manager: [pnpm](https://pnpm.io/)
1117

12-
### Installation
18+
## Getting Started
1319

14-
1. **Clone the repository:**
20+
### Prerequisites
1521

16-
```bash
17-
git clone https://github.com/ALPHA-HKU/website.git
18-
cd website
19-
```
22+
- Node.js
23+
- pnpm
2024

21-
2. **Install dependencies:**
25+
### Setup
2226

23-
```bash
24-
pnpm install
25-
```
27+
1. Clone the repo:
2628

27-
### Running the Development Server
29+
```bash
30+
git clone https://github.com/ALPHA-HKU-Org/website.git
31+
cd website
32+
```
2833

29-
To start the development server, run:
34+
2. Install dependencies:
3035

31-
```bash
32-
pnpm dev
33-
```
34-
35-
Open [http://localhost:3000](http://localhost:3000) in your browser to see the result.
36+
```bash
37+
pnpm install
38+
```
3639

37-
## Project Structure
40+
3. Run the dev server:
3841

39-
The project follows a standard Next.js App Router structure:
42+
```bash
43+
pnpm dev
44+
```
4045

41-
```bash
42-
├── public/ # Static assets (images, fonts, etc.)
43-
├── src/
44-
│ ├── app/ # Application routes and layouts
45-
│ ├── components/ # Reusable components
46-
│ │ ├── ui/ # shadcn/ui components
47-
│ │ └── ...
48-
│ ├── lib/ # Utility functions
49-
│ └── ...
50-
├── .gitignore
51-
├── next.config.ts
52-
├── package.json
53-
├── README.md
54-
└── tsconfig.json
55-
```
46+
The site will be running at `http://localhost:3000`.
5647

57-
- **`src/app`**: Contains all the application's routes, with each folder representing a URL segment. `layout.tsx` defines the root layout, and `page.tsx` defines the content for each route.
58-
- **`src/components`**: Home to all reusable React components.
59-
- **`src/components/ui`**: This directory is specifically for components added from `shadcn/ui`.
60-
- **`src/lib`**: Contains shared utility functions, such as the `cn` function for merging Tailwind CSS classes.
61-
- **`public`**: Stores all static assets that are served directly, such as images and the site's manifest.
48+
## Available Scripts
6249

63-
## Building for Production
50+
- `pnpm dev`: Starts the development server with Next.js Turbo.
51+
- `pnpm build`: Creates a production-ready build.
52+
- `pnpm start`: Starts the production server (requires `pnpm build` first).
53+
- `pnpm lint`: Runs ESLint to find code quality issues.
54+
- `pnpm prettier --write .`: Formats all files. It's recommended to use the [Prettier VSCode extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) for format-on-save.
6455
65-
To create a production-ready build, run the following command:
56+
## Project Structure
6657
6758
```bash
68-
pnpm build
59+
.
60+
├── src/
61+
│ ├── app/ # Next.js App Router pages and layouts.
62+
│ ├── components/
63+
│ │ ├── features/ # Self-contained features (e.g., theme toggle, cursor).
64+
│ │ ├── layout/ # Global layout components (Header, Footer).
65+
│ │ ├── sections/ # Reusable page sections (e.g., Hero, WhoWeAre).
66+
│ │ └── ui/ # Base UI components from shadcn/ui.
67+
│ └── lib/ # Utilities (cn function) and site configuration.
68+
├── public/ # Static assets (images, icons).
6969
```
7070
71-
This will generate an optimized build in the `.next` directory, which can then be deployed.
72-
73-
## `shadcn/ui` Integration
71+
## Working with `shadcn/ui`
7472
75-
We leverage `shadcn/ui` for our core UI components to ensure consistency and accessibility.
76-
77-
### Existing Components
78-
79-
The following `shadcn/ui` components are currently in use:
80-
81-
- `Button`
82-
- `Card`
83-
- `Carousel`
84-
- `Collapsible`
85-
- `DropdownMenu`
86-
- `NavigationMenu`
87-
- `Sheet`
73+
This project uses `shadcn/ui`. Do not install components from npm or other package managers directly. Use the CLI to add new components to ensure they are added correctly to the project.
8874
8975
### Adding New Components
9076
91-
To add a new component, use the `shadcn` CLI. This is the recommended approach as it handles all dependencies automatically.
92-
93-
For example, to add the `Button` component, run:
77+
To add a new component, run the following command, replacing `button` with the component you need:
9478
9579
```bash
9680
pnpm dlx shadcn@latest add button
9781
```
9882
99-
This will add the new component to `src/components/ui` and ensure it's ready for use.
83+
This command will add the new component file (e.g., `button.tsx`) to `src/components/ui`. You can then import and use it throughout the application.

0 commit comments

Comments
 (0)