An open API service indexing awesome lists of open source software.

https://github.com/manthanank/dev-to-clone-app

Dev.to Clone
https://github.com/manthanank/dev-to-clone-app

angular api bootstrap devto tailwindcss

Last synced: about 1 month ago
JSON representation

Dev.to Clone

Awesome Lists containing this project

README

          

# Dev.to Clone

A feature-rich clone of the [Dev.to](https://dev.to) developer community platform, built with **Angular 21** and **Tailwind CSS 4**. It integrates with the official Dev.to API to fetch real articles, tags, and user data.

![Angular](https://img.shields.io/badge/Angular-21-DD0031?logo=angular&logoColor=white)
![TypeScript](https://img.shields.io/badge/TypeScript-5.9-3178C6?logo=typescript&logoColor=white)
![TailwindCSS](https://img.shields.io/badge/TailwindCSS-4.2-06B6D4?logo=tailwindcss&logoColor=white)
![License](https://img.shields.io/badge/License-MIT-green)

---

## ✨ Features

- πŸ“° **Home Feed** β€” Browse the latest articles fetched from the Dev.to API
- πŸ“– **Post Detail** β€” Full article view with reading time and reaction counts
- πŸ‘€ **User Profiles** β€” View any developer's profile and their published articles
- ✍️ **Create Post** β€” Write and publish new blog posts (authenticated)
- πŸ”– **Reading List** β€” Save articles to your personal reading list
- 🏷️ **Tags** β€” Browse articles by tags/topics
- πŸ“‹ **Listings** β€” Community job listings and classifieds
- πŸŽ™οΈ **Podcasts** β€” Discover developer podcasts
- πŸŽ₯ **Videos** β€” Watch developer video content
- βš™οΈ **Settings** β€” Manage account settings and API configuration
- πŸ” **Authentication** β€” Login, register, forgot password, and reset password flows
- πŸŒ™ **Dark / Light Mode** β€” Full theme toggle support
- πŸ“± **Responsive Design** β€” Mobile-first, fully responsive layout

---

## πŸ› οΈ Tech Stack

| Technology | Version | Purpose |
| --------------------------------------------------- | ------- | -------------------------- |
| [Angular](https://angular.io/) | 21.x | Frontend framework |
| [TypeScript](https://www.typescriptlang.org/) | 5.9.x | Type-safe JavaScript |
| [Tailwind CSS](https://tailwindcss.com/) | 4.2.x | Utility-first CSS styling |
| [RxJS](https://rxjs.dev/) | 7.8.x | Reactive programming |
| [Dev.to API](https://developers.forem.com/api/) | v1 | Articles, users & tag data |
| [Karma + Jasmine](https://karma-runner.github.io/) | - | Unit testing |

---

## πŸ“ Project Structure

```text
src/
β”œβ”€β”€ app/
β”‚ β”œβ”€β”€ core/ # Singleton services & guards
β”‚ β”‚ β”œβ”€β”€ auth.service.ts # Authentication logic
β”‚ β”‚ β”œβ”€β”€ auth.guard.ts # Route protection
β”‚ β”‚ β”œβ”€β”€ api-config.service.ts # API key & URL configuration
β”‚ β”‚ └── header/ # App header component
β”‚ β”œβ”€β”€ models/ # TypeScript interfaces
β”‚ β”‚ β”œβ”€β”€ post.interface.ts
β”‚ β”‚ β”œβ”€β”€ user.interface.ts
β”‚ β”‚ └── comment.interface.ts
β”‚ β”œβ”€β”€ pages/ # Route-level page components
β”‚ β”‚ β”œβ”€β”€ home/ # Home feed
β”‚ β”‚ β”œβ”€β”€ post-detail/ # Article detail page
β”‚ β”‚ β”œβ”€β”€ profile/ # User profile page
β”‚ β”‚ β”œβ”€β”€ create-post/ # New post editor
β”‚ β”‚ β”œβ”€β”€ reading-list/ # Saved articles
β”‚ β”‚ β”œβ”€β”€ tags/ # Tags browser
β”‚ β”‚ β”œβ”€β”€ listings/ # Job listings
β”‚ β”‚ β”œβ”€β”€ podcasts/ # Podcasts page
β”‚ β”‚ β”œβ”€β”€ videos/ # Videos page
β”‚ β”‚ β”œβ”€β”€ settings/ # Account settings
β”‚ β”‚ β”œβ”€β”€ about/ # About page
β”‚ β”‚ β”œβ”€β”€ not-found/ # 404 page
β”‚ β”‚ └── auth/ # Authentication pages
β”‚ β”‚ β”œβ”€β”€ login/
β”‚ β”‚ β”œβ”€β”€ register/
β”‚ β”‚ β”œβ”€β”€ forgot-password/
β”‚ β”‚ └── reset-password/
β”‚ └── shared/ # Reusable components & services
β”‚ β”œβ”€β”€ data.service.ts # Dev.to API data fetching
β”‚ β”œβ”€β”€ theme.service.ts # Dark/light mode toggle
β”‚ └── post-card/ # Reusable post card component
β”œβ”€β”€ environments/ # Environment configuration
└── styles.scss # Global styles
```

---

## πŸš€ Getting Started

### Prerequisites

- [Node.js](https://nodejs.org/) v20 or higher
- [npm](https://www.npmjs.com/) v10 or higher
- [Angular CLI](https://angular.io/cli) v21

### Installation

1. **Clone the repository**

```bash
git clone https://github.com/manthanank/dev-to-clone-app.git
cd dev-to-clone-app
```

2. **Install dependencies**

```bash
npm install
```

3. **Configure the environment** *(optional)*

To use the Dev.to API with your own API key, update `src/environments/environment.ts`:

```ts
export const environment = {
production: false,
apiUrl: 'https://dev.to/api',
apiKey: 'YOUR_DEV_TO_API_KEY' // optional
};
```

> You can also set the API key at runtime via the **Settings** page in the app.

4. **Start the development server**

```bash
npm start
```

Navigate to `http://localhost:4200/`. The app reloads automatically on file changes.

---

## πŸ“œ Available Scripts

| Command | Description |
| ----------------- | ------------------------------------------------ |
| `npm start` | Run the development server at `localhost:4200` |
| `npm run build` | Build the production bundle to `dist/` |
| `npm run watch` | Build in development watch mode |
| `npm test` | Run unit tests via Karma |

---

## πŸ”Œ Dev.to API Integration

This app uses the [Forem API v1](https://developers.forem.com/api/) (Dev.to's public API) to fetch real content.

- **Articles** β€” Fetched via `GET /articles`
- **Article Detail** β€” Fetched via `GET /articles/{id}`
- **User Profile** β€” Fetched via `GET /users/{username}`
- **Tags** β€” Fetched via `GET /tags`
- **Authenticated User** β€” Fetched via `GET /users/me` (requires API key)

A CORS proxy is configured in `proxy.conf.json` for local development.

---

## πŸ” Authentication

Authentication is simulated locally and supports:

- **Email/Password Login** β€” Creates a local session stored in `localStorage`
- **Registration** β€” Registers a new user profile locally
- **API Key Login** β€” Provide a Dev.to API key to authenticate as your real Dev.to account
- **Forgot / Reset Password** β€” Simulated password reset flow
- **Auth Guard** β€” Protects the `/new` (Create Post) route from unauthenticated access

---

## πŸ—ΊοΈ Routes

| Path | Page | Protected |
| ------------------- | --------------- | --------- |
| `/` | Home Feed | No |
| `/post/:id` | Post Detail | No |
| `/user/:username` | User Profile | No |
| `/new` | Create Post | βœ… Yes |
| `/reading-list` | Reading List | No |
| `/tags` | Tags | No |
| `/about` | About | No |
| `/settings` | Settings | No |
| `/listings` | Listings | No |
| `/podcasts` | Podcasts | No |
| `/videos` | Videos | No |
| `/login` | Login | No |
| `/register` | Register | No |
| `/forgot-password` | Forgot Password | No |
| `/reset-password` | Reset Password | No |
| `/**` | 404 Not Found | No |

---

## 🀝 Contributing

Contributions are welcome! Please follow these steps:

1. Fork the repository
2. Create a new branch: `git checkout -b feature/your-feature-name`
3. Commit your changes: `git commit -m 'feat: add your feature'`
4. Push to the branch: `git push origin feature/your-feature-name`
5. Open a Pull Request

---

## πŸ“„ License

This project is licensed under the [MIT License](LICENSE).

---

## πŸ™ Acknowledgements

- [Dev.to](https://dev.to) β€” For the inspiration and their public API
- [Forem](https://www.forem.com/) β€” The open-source platform behind Dev.to
- [Angular Team](https://angular.io/) β€” For the excellent framework