Skip to content

Commit 6a7e7a3

Browse files
Merge pull request #5 from py-package/feature/documentation
Added Docs
2 parents 49e5604 + e4fb831 commit 6a7e7a3

File tree

3 files changed

+83
-25
lines changed

3 files changed

+83
-25
lines changed

README.md

Lines changed: 56 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,41 @@
1-
# Backup
2-
31
<p align="center">
4-
<img src="https://banners.beyondco.de/Backup.png?theme=light&packageManager=pip+install&packageName=masonite-backup&pattern=topography&style=style_1&description=Backup solution for Masonite.&md=1&showWatermark=1&fontSize=100px&images=https%3A%2F%2Fgblobscdn.gitbook.com%2Fspaces%2F-L9uc-9XAlqhXkBwrLMA%2Favatar.png">
2+
<img src="https://banners.beyondco.de/Masonite%20Backup.png?theme=light&packageManager=pip+install&packageName=masonite-backup&pattern=charlieBrown&style=style_2&description=Backup+solution+for+Masonite+Apps.&md=1&showWatermark=1&fontSize=100px&images=adjustments&widths=50&heights=50">
53
</p>
64

75
<p align="center">
86
<a href="https://docs.masoniteproject.com">
97
<img alt="Masonite Package" src="https://img.shields.io/static/v1?label=Masonite&message=package&labelColor=grey&color=blue&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAA6gAwAEAAAAAQAAAA4AAAAATspU+QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZ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/K43e2UwnMVAJIEBNfWRYR3HfnvivrIzMyo4Hgy+hfscvLo53jItAAAAABJRU5ErkJggg==">
108
</a>
11-
<img alt="GitHub Workflow Status (branch)" src="https://img.shields.io/github/workflow/status/py-package/backup/Test%20Application">
12-
<img src="https://codecov.io/gh/py-package/backup/branch/main/graph/badge.svg?token="/>
13-
<img alt="PyPI" src="https://img.shields.io/pypi/v/backup">
9+
<img alt="GitHub Workflow Status (branch)" src="https://img.shields.io/github/workflow/status/py-package/masonite-backup/Test%20Application">
10+
<img src="https://codecov.io/gh/py-package/masonite-backup/branch/main/graph/badge.svg?token="/>
11+
<img alt="PyPI" src="https://img.shields.io/pypi/v/masonite-backup">
1412
<img src="https://img.shields.io/badge/python-3.6+-blue.svg" alt="Python Version">
15-
<img alt="GitHub release (latest by date including pre-releases)" src="https://img.shields.io/github/v/release/py-package/backup?include_prereleases">
16-
<img alt="License" src="https://img.shields.io/github/license/py-package/backup">
13+
<img alt="GitHub release (latest by date including pre-releases)" src="https://img.shields.io/github/v/release/py-package/masonite-backup?include_prereleases">
14+
<img alt="License" src="https://img.shields.io/github/license/py-package/masonite-backup">
1715
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
1816
</p>
1917

20-
## Introduction
18+
# Masonite Backup (WIP)
2119

2220
Backup solution for Masonite.
2321

24-
## Features
25-
26-
- _Add your package main features here_
27-
- _and here_
28-
29-
## Official Masonite Documentation
22+
### Features
3023

31-
New to Masonite ? Please first read the [Official Documentation](https://docs.masoniteproject.com/).
32-
Masonite strives to have extremely comprehensive documentation 😃. It would be wise to go through the tutorials there.
33-
If you find any discrepencies or anything that doesn't make sense, be sure to comment directly on the documentation to start a discussion!
24+
- [x] Backup Database
25+
- [x] Backup Files
26+
- [x] Store Backup Locally in the filesystem
27+
- [ ] Send Backup Notifications
28+
- [ ] Email Backup
29+
- [ ] Store Backup in other Masonite Supported Storage Drivers [s3]
3430

35-
Have questions or want to talk? Be sure to join the [Masonite Discord Community](https://discord.gg/TwKeFahmPZ)!
3631

37-
## Installation
32+
### Installation
3833

3934
```bash
4035
pip install masonite-backup
4136
```
4237

43-
## Configuration
38+
### Configuration
4439

4540
Add BackupProvider to your project in `config/providers.py`:
4641

@@ -64,17 +59,54 @@ Then you can publish the package resources (if needed) by doing:
6459
python craft package:publish backup
6560
```
6661

67-
## Usage
62+
### Usage
63+
64+
Once you publish the package resources, you can use the `backup` command to backup your database and files. Before that if you want to configure options of backup then you can do that by updating `config/backup.py` configuration file.
65+
66+
```python
67+
# config/backup.py
68+
69+
FILENAME = "backup"
70+
DIRECTORY = "backup"
71+
SOURCE = {
72+
"root": base_path(),
73+
"excludes": [
74+
".git",
75+
"storage",
76+
"venv",
77+
"node_modules",
78+
"__pycache__",
79+
# add more...
80+
],
81+
}
82+
```
83+
84+
**Backup Database and Files**
85+
86+
```bash
87+
python craft backup:run
88+
```
89+
90+
**Backup Database Only**
91+
92+
```bash
93+
python craft backup:run --only-db
94+
```
95+
96+
**Backup Files Only**
97+
98+
```bash
99+
python craft backup:run --only-files
100+
```
68101

69-
_Explain how to use your package_
70102

71103
## Contributing
72104

73105
Please read the [Contributing Documentation](CONTRIBUTING.md) here.
74106

75107
## Maintainers
76108

77-
- [Yubaraj Shrestha](https://www.github.com/py-package)
109+
- [x] [Yubaraj Shrestha](https://www.github.com/py-package)
78110

79111
## License
80112

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
url="https://github.com/py-package/masonite-backup",
2323
# Author details
2424
author="Yubaraj Shrestha",
25-
author_email="info@pypackage.com",
25+
author_email="yubaraj@pypackage.com",
2626
# Choose your license
2727
license="MIT license",
2828
# If your package should include things you specify in your MANIFEST.in file
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# flake8: noqa F501
2+
"""Backup Settings"""
3+
4+
from masonite.utils.location import base_path
5+
6+
"""
7+
|--------------------------------------------------------------------------
8+
| Masonite Backup
9+
|--------------------------------------------------------------------------
10+
|
11+
| This is the configuration file for the Masonite Backup package.
12+
|
13+
"""
14+
15+
FILENAME = "backup" # The filename of the backup file. (without the extension)
16+
DIRECTORY = "backup" # storage/backup
17+
SOURCE = {
18+
"root": base_path(),
19+
"excludes": [
20+
".git",
21+
"storage",
22+
"venv",
23+
"node_modules",
24+
"__pycache__",
25+
],
26+
}

0 commit comments

Comments
 (0)