|
| 1 | +#  |
| 2 | + |
| 3 | +> Example Angular 2 codebase that adheres to the [RealWorld](https://github.com/gothinkster/realworld) spec and API. |
| 4 | +
|
| 5 | +### [Demo](https://angular2.realworld.io) [RealWorld](https://github.com/gothinkster/realworld) |
| 6 | + |
| 7 | +This codebase was created to demonstrate a fully fledged application built with Angular 2 that interacts with an actual backend server including CRUD operations, authentication, routing, pagination, and more. It adheres to the [RealWorld](https://github.com/gothinkster/realworld) frontend specifications and communicates with a [backend API](https://github.com/gothinkster/realworld/blob/master/API.md) for CRUD operations. |
| 8 | + |
| 9 | +**The codebase is now feature complete and the RFC is open. Your input is greatly appreciated; please submit bug fixes via pull requests & feedback via issues.** |
| 10 | + |
| 11 | +We're currently working on some docs for the codebase (explaining where functionality is located, how it works, etc). We also have a **[live workshop we're holding on October 22nd](https://thinkster.io/announcements/angular-2-workshop)** where we'll break the codebase down, explain how everything works, and do a Q&A session. Additionally, an upcoming step-by-step tutorial is being written for [Thinkster.io](https://thinkster.io/) that will cover recreating the codebase from scatch (watch this repo to stay updated!) |
| 12 | + |
| 13 | +## Getting started |
| 14 | + |
| 15 | +Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. |
| 16 | + |
| 17 | +### Building the project |
| 18 | + |
| 19 | +Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. |
| 20 | + |
| 21 | +### Making requests to the backend API |
| 22 | + |
| 23 | +For convenience, we have a live API server running at https://conduit.productionready.io/api for the application to make requests against. You can view [the API spec here](https://github.com/GoThinkster/productionready/blob/master/API.md) which contains all routes & responses for the server. The source code for the backend server (available for Node, Rails and Django) can be found in the [RealWorld repo](https://github.com/gothinkster/realworld). |
| 24 | + |
| 25 | +## Functionality overview |
| 26 | + |
| 27 | +The example application is a social blogging site (i.e. a Medium.com clone) called "Conduit". It uses a custom API for all requests, including authentication. You can view a live demo over at https://angular2.realworld.io |
| 28 | + |
| 29 | +**General functionality:** |
| 30 | + |
| 31 | +- Authenticate users via JWT (login/signup pages + logout button on settings page) |
| 32 | +- CRU* users (sign up & settings page - no deleting required) |
| 33 | +- CRUD Articles |
| 34 | +- CR*D Comments on articles (no updating required) |
| 35 | +- GET and display paginated lists of articles |
| 36 | +- Favorite articles |
| 37 | +- Follow other users |
| 38 | + |
| 39 | +**The general page breakdown looks like this:** |
| 40 | + |
| 41 | +- Home page (URL: /#/ ) |
| 42 | + - List of tags |
| 43 | + - List of articles pulled from either Feed, Global, or by Tag |
| 44 | + - Pagination for list of articles |
| 45 | +- Sign in/Sign up pages (URL: /#/login, /#/register ) |
| 46 | + - Uses JWT (store the token in localStorage) |
| 47 | + - Authentication can be easily switched to session/cookie based |
| 48 | +- Settings page (URL: /#/settings ) |
| 49 | +- Editor page to create/edit articles (URL: /#/editor, /#/editor/article-slug-here ) |
| 50 | +- Article page (URL: /#/article/article-slug-here ) |
| 51 | + - Delete article button (only shown to article's author) |
| 52 | + - Render markdown from server client side |
| 53 | + - Comments section at bottom of page |
| 54 | + - Delete comment button (only shown to comment's author) |
| 55 | +- Profile page (URL: /#/profile/:username, /#/profile/:username/favorites ) |
| 56 | + - Show basic user info |
| 57 | + - List of articles populated from author's created articles or author's favorited articles |
0 commit comments