This is an Electron.js and Firebase application for uploading a simple text-based blog post.
The process of this application is as follows:
- The user opens the application
- The user is presented with a form to post a blog entry, where the user can choose a title, date, and message for the blog post.
- The message is split by lines, and each 'paragraph' is put in a separate <description> tag.
- On clicking the 'Post' button, a .xml file is created, and the date chosen for the blog post is used as the filename (i.e. <filename>.xml). Note, the implications are as follows:
- As the application uses Firebase, the date becomes the filename for the data sent to Firebase Storage. Thus, as the file is uniquely identified by the date, if a file is uploaded to Firebase Storage with the same date as another file, the new file will overwrite the preexisting file in Firebase Storage.
- This means there can only be one blog post per date.
- This also means that, if a user intends to 'edit' a blog post, this can be imitated by copying the information from the previous blog post and putting it in a new blog post, to overwrite the old one.
- The file is uploaded to Firebase Storage.
Note: The file that is created may not be a pure RSS file. Simply put, it creates a format as follows:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<info>
<title>Title</title>
<date>Date</date>
</info>
<message>
<description>Paragraph 1</description>
<description>Paragraph 2</description>
...
<description>Paragraph n</description>
</message>
</channel>
</rss>
After cloning the repository, there are some important steps to follow before this project can function as intended. You will need:
- Node.js, npm installed
- A Google account (hence also a Firebase account)
First, the user will have to run
cd post-uploader
npm install
This will install the application dependencies. The next step is to create a Firebase project:
- Go to the Firebase Console.
- Create a new project.
- Add a new app, and copy the config information.
- Add the config information to post-uploader/src/index.html (in the TODO space).
- Set up a Firebase Storage bucket.
- Add a folder to the Firebase Storage bucket, 'posts'.
The next step is to run the application:
npm start
This should run the application.
Please change post-uploader/storage.rules as needed to secure Firebase Storage.