-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.md
142 lines (105 loc) · 3.02 KB
/
README.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# CRUD Blog on Rails. Geo-Targeted Banner Ads
[![CRUD Blog on Rails. Geo-Targeted Banner Ads](https://github.com/cmirnow/CRUD-Blog/blob/master/app/assets/images/management_images_active_storage.jpg)](https://masterpro.ws/create-blog-on-rails)
## Features
* Convenient site administration panel
* Ease of management
* Geo-Targeted Banner ADS
* Text editor
* Built-in visit analytics
* Categories
* Articles
* Pagination of the list of articles
* AJAX Contact Form
* AJAX Comments
* Comments Pre-Moderation by default
* Notifications of new comments by email
* Upload images to base64, to local storage, to AWS S3
* Preview an Image. Various preview options can be passed to the Active Storage variant method.
* Tags
* Meta Tags
* Open Graph Protocol and Twitter Card Meta Tags
* RSS
* User-Friendly URLs
* Sitemap
* Current Weather by IP on Google Map
* Advanced Slider
* PhotoGallery
* Lightbox
* JavaScript Time Greeting
[![CRUD Blog on Rails. Geo-Targeted Banner Ads](https://github.com/cmirnow/CRUD-Blog/blob/master/app/assets/images/edit_post.jpg)](https://masterpro.ws/deploy-blog-on-rails-to-heroku)
For Beginners: How to Start. [Deploying Rails Blog on Heroku](https://masterpro.ws/deploy-blog-on-rails-to-heroku).
[![CRUD Blog on Rails. Geo-Targeted Banner Ads](https://github.com/cmirnow/CRUD-Blog/blob/master/app/assets/images/ahoy_visits.jpg)](https://masterpro.ws/create-blog-on-rails)
# Quickly start
The application needs postgreSQL. Make sure this (for example) works:
```
$ sudo service postgresql-12 restart
Redirecting to /bin/systemctl restart postgresql-12.service
```
Next:
```
$ sudo -u postgres psql
postgres=# CREATE DATABASE analytics_app_development;
CREATE DATABASE
```
Next:
```
$ git clone https://github.com/cmirnow/CRUD-Blog.git
$ cd CRUD-Blog
```
Set your login and password to db/seeds.rb
Ready to get started?
```
$ bundle install
$ yarn install --check-files
$ rake db:migrate
$ rake db:seed
$ bundle exec figaro install
```
Edit:
```
#config/application.yml
RECAPTCHA_SITE_KEY: "*************************"
RECAPTCHA_SECRET_KEY: "**************************"
GMAIL_USER_NAME: '****@***********'
GMAIL_PASSWORD: '************'
DOMAIN_NAME: 'https://mstp.herokuapp.com' #For example
SEND_EMAIL_TO: '****@*********'
SUBJECT_EMAIL: 'Hurray! You got a new form!'
SUBJECT_COMMENT_EMAIL: 'You got a new comment!'
KEY_OPENWEATHERMAP: '*******************************'
GOOGLE_MAP_KEY: '*************************************'
AWS_ACCESS_KEY_ID: '********************'
AWS_SECRET_ACCESS_KEY: '*********************************'
REGION: "*********"
BUCKET: "*********"
```
```
# config/storage.yml
amazon:
service: S3
access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
region: <%= ENV['REGION'] %>
bucket: <%= ENV['BUCKET'] %>
```
OK, let's go:
```
$ rails s
```
Now login:
```
127.0.0.1:3000/admin
```
Сreate your first categories and articles.
Finally, create a sitemap:
```
rails sitemap:refresh
```
## Running specs
```
$ bundle exec rspec
```
or
```
$ bundle exec rspec -fd
```