Home

Awesome

AppwriteBlogExample

This project was generated with Angular CLI version 12.2.10.

I made this blog example to familiarize myself with the Appwrite API. Follow along with my steps below to recreate this yourself!

Screenshot of example blog

Step by step process

Install all the angular stuff with node package manager

Clone this repository. In the terminal, navigate to the repository root and run
npm install (or npm i if you're lazy!)
and node package manager will handle everything automagically.

Install appwrite

Follow the installation instructions for Appwrite, and run it locally for now.

Create a project in Appwrite

Once you've installed Appwrite, go ahead and head to the console at http://localhost/console.

Heads up: you'll need to create a user the first time you do this!

Once you're in, create a project and copy the project ID and replace PROJECT_ID in /src/environment/environment.ts with your unique project ID (the number in single quotes).

Create a user for yourself in the Appwrite project

This user will be the "admin" and will have access to the page where you can create and manage blog posts.

In the console page for your project go the the Users page and Add User for yourself.

Note! If you forget the email and password you created you can reset/change them here!

Create a blogger role in the project

Go to Users - Teams and hit Add Team. Let's call it "Bloggers" for now.

In the Bloggers team overview, add your user to the members.

NOTE! This role is important for later so don't forget.

Create a "blog-post" document collection in the project

Launch a local version of the appwrite-blog-example

In a terminal in the root folder of the repository run npx ng serve.
(The npx command will ensure you can run this with the locally installed @angular/cli rather than requiring a global install)

In a browser, open http://localhost:4200/, this will automatically forward you to the /home page where the blog is!

Create a blog post

Go to http://localhost:4200/login, sign in and fill in the form to make a blogpost! Smash that HOME button (top left corner) and head on back to http://localhost:4200/ to read it in all its glory!