https://github.com/thekid/dialog
Dialog photoblog
https://github.com/thekid/dialog
mongodb photoblog php8 xp-framework
Last synced: 8 months ago
JSON representation
Dialog photoblog
- Host: GitHub
- URL: https://github.com/thekid/dialog
- Owner: thekid
- Created: 2022-09-13T20:14:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-07-19T21:40:11.000Z (11 months ago)
- Last Synced: 2025-07-19T23:55:39.509Z (11 months ago)
- Topics: mongodb, photoblog, php8, xp-framework
- Language: PHP
- Homepage:
- Size: 596 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
Awesome Lists containing this project
README
# Dialog photoblog
[](https://github.com/thekid/dialog/actions)
[](https://github.com/xp-framework/core)
[](https://github.com/xp-framework/core/blob/master/LICENCE.md)
[](http://php.net/)
[](http://php.net/)
See https://dialog.friebes.info/
## Prerequisites
* Create a [MongoDB Atlas account](https://account.mongodb.com/account/register)
* Install [XP runners](https://github.com/xp-runners/reference) and [Composer](https://getcomposer.org/).
## Setup
First, create the import user:
```bash
$ echo -n "secret-password-here" | sha256sum
4323135e32ac4...
# Copy the connection URI from MongoDB Atlas
$ mongosh mongodb+srv://[USER]:[PASSWORD]@[PROJECT].[ORG].mongodb.net
$ use dialog
$ db.users.insert({handle: "import", pass: "4323135e32ac4..."});
# ...
```
Store the connection string in a configuration file named *config.ini*:
```ini
[mongo]
uri=mongodb+srv://[USER]:[PASSWORD]@[PROJECT].[ORG].mongodb.net/?readPreference=nearest
```
Then, run composer to install PHP and JavaScript dependencies.
```bash
$ composer up
# ...
```
## Running locally
Now, Dialog can be run locally.
```bash
$ xp serve
# ...
```
Open http://localhost:8080/ to see the empty page
## Importing local directories
Next, we'll import some pictures:
```bash
$ xp import import-target/ http://import:pass@localhost:8080/api
# ...
```
### Content
Expects the following directory structure:
```
import-target
|- content.md
|- image-1.jpg
|- image-2.jpg
`- image-(n).jpg
```
### Journey
Expects the following directory structure:
```
import-target
|- journey.md
|- part-1
| |- content.md
| |- image-1.jpg
| `- image-2.jpg
|- part-2
| |- content.md
| |- image-1.jpg
| `- image-2.jpg
`- part-(n)
```