Sunday, March 26, 2023
Learning Code
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#
No Result
View All Result
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#
No Result
View All Result
Learning Code
No Result
View All Result
Home Swift

Getting started with Feather CMS

learningcode_x1mckf by learningcode_x1mckf
September 20, 2022
in Swift
0
Getting started with Feather CMS
74
SHARES
1.2k
VIEWS
Share on FacebookShare on Twitter


2020/07/30

Discover ways to arrange your personal web site utilizing Feather CMS. A contemporary Swift-based Content material Administration System powered by Vapor 4.

Vapor

Feather CMS - A modern content management system on top of Swift & Vapor. | Product Hunt Embed

Constructing & working Feather

Feather is on the market an open-source venture on GitHub. It’s written in Swift utilizing the Vapor 4 framework. You may solely want a machine that may run Swift code, it may be a PC with one of many supported Linux distribution or a Mac. You possibly can even attempt to mess around with a Raspberry PI. 🤖

Anyway one the quickest method of putting in Swift is utilizing the Swift Version Manager (aka. swiftenv). You may want a minimum of Swift 5.2 or later (at the moment I wouldd advocate utilizing Swift 5.2.4).

Now you probably have a working Swift set up in your machine, you must seize the supply code of Feather CMS. I want utilizing the command line, however alternatively you may merely obtain the zip from GitHub and extract the package deal utilizing your most popular file supervisor.

git clone https://github.com/BinaryBirds/feather.git

With a purpose to construct and run the appliance you will have to compile the Swift supply recordsdata. The appliance itself is a Vapor based mostly backend server, you may run the venture through the command line or you may open the Package deal.swift file straight utilizing Xcode. 🔨

You need not generate the xcodeproj file anymore, simply open the Package deal.swift file straight. Xcode 11 and later can resolve the Swift package deal dependencies utilizing this manifest.

Feather will attempt to detect and cargo the native configuration utilizing a “dotenv” file if you run the server. In case you are constructing your app utilizing a growth surroundings the dotenv file known as .env.growth in manufacturing mode it is merely named .env and it needs to be situated in your working listing. You possibly can learn extra about this within the offical Vapor 4.0 documentation. 📚

In case you are utilizing Xcode it’s a must to specify a working listing underneath the edit scheme menu merchandise. There are two construct targets within the package deal manifest file, one is the App and the opposite is the Run goal. That is the default Vapor goal configuration, the utility goal incorporates your server code as a library, and the run goal can create an app occasion utilizing your configuration, construct enviornment so it may possibly pay attention on a given port when working in dev or prod mode, however this setup additionally makes potential to unit take a look at the server occasion utilizing a totally totally different (mock) setup. 🎯


Now back to the topic, if you’re utilizing Xcode first wait till the package deal dependencies are utterly loaded, then you must click on on the Run goal and choose the Edit Scheme… menu merchandise. Underneath the Choices tab you must se a Working listing label, there’s a checkbox proper subsequent to it, click on on that & use the file browser to pick the folder the place you downloaded Feather. It’s a must to choose the foundation folder, that needs to be your working listing. (e.g. ~/Downloads/Feather/)

Now the Vapor server will have the ability to load the appropriate dotenv file out of your working listing based mostly in your surroundings. We simply should arrange two properties inside our configuration file.


BASE_URL="http://localhost:8080"


BASE_PATH="/path/to/feather/"

The BASE_URL ought to include the HTTP protocol, the area and the port that you’re utilizing to host the server occasion with out a trailing slash. It’s because detecting the HTTP server area from an incoming request is tougher than you would possibly assume. 😅

Then again the BASE_PATH property is used to determine absolute file useful resource and assests places in your file system, for instance all of the publicly accessible recordsdata go underneath the Public direcory. You too can use the Sources listing to load customized Views or different sort of runtime sources.

Feather CMS comes with a file storage driver referred to as Liquid. Similar to Fluent, this file storage element can use totally different sort of drivers to save lots of recordsdata. By default property might be saved underneath the Public/property listing. Just remember to create this listing and your net server has each learn & write entry to it, use the chmod & chown instructions if essential.🔒

Now we’re prepared with the configuration half, let’s attempt to run the appliance.


swift run Run

vapor construct && vapor run serve

make run

Congratulations, the server ought to pay attention on the 8080 port, go to the http://localhost:8080/ hyperlink utilizing your most popular net browser. Feather will carry out the required set up steps the primary time if you hit this hyperlink. Because of this all of the required database migrations will happend and the tables are going to be pre-pouplated with some pattern information that you would be able to replace afterward. 🥳



Utilizing the CMS

Feather is a totally dynamic modular Swift-based CMS, so you may alter virtually every part on the fly utilizing the admin interface. The default username and password to your working occasion is [email protected] and the password is FeatherCMS. No worries, you may change this utilizing the consumer menu merchandise after you log in to the content material administration system.


The Dashboard is the principle display screen of the admin interface. You possibly can alter the weblog module publish new posts, create classes or edit authors with only a few clicks. Once you click on on the Posts menu you will see a searchable listing of all of the accessible posts (draft, printed, archived). You possibly can press the Edit button to handle a submit, this interface is fairly easy, however you must discover that there’s a particular feather icon on the highest left nook.


In Feather every part that is printed to the general public web site has a particular relation, referred to as content material. This content material sort permits you to specify a slug (permalink), set the standing, publish date of a given content material you make it seem on feeds (RSS, Atom), however it’s additionally potential to allow particular content material filters, such because the Markdown or the Swift syntax highlighter (offered by Ink & Splash).


One other cool characteristic is that you would be able to outline web page templates utilizing Swift code and you’ll hook-them-up to particular routes utilizing the Web page menu throughout the CMS. When you check out the Authors web page, the content material is specified as a web page hook. Web page hooks can be utilized as connection factors between your Swift code and the frontend. You write the code similar to you’ll write an ordinary controller methodology utilizing Vapor, however as an alternative of statically registering the route, you may register the trail dynamically through the CMS. It is a very highly effective characteristic to show customized content material. 💪


One other small, however very good characteristic that you should utilize system variables to customise smaller parts of the location. Underneath the system / variables menu merchandise on the dashboard you may attempt to rewrite among the labels. When you hit a lacking url, you will see a 404 web page, simply attempt to exchange the monkey emoji with one thing that matches your temper. 🙉


In fact Feather is website positioning pleasant so you may customise all of the meta information underneath the content material editor, plus you do not have to fret about lacking hyperlinks, for the reason that CMS can deal with customized redirects. This fashion you may register an previous (eliminated) article and ship the consumer to a brand new location with a correct HTTP (redirect) standing code. (e.g. /old-post/ ~~~301~~~> /new-post/). 🔍



In fact there’s a lot extra, however this time I simply wished to present you a fast tour of Feather. I hope you appreciated the article, an increasing number of modules, filters and new goodies are coming quickly. In case you are a developer and also you wish to be taught extra in regards to the inner construction of Feather, I extremely advocate buying my Practical Server Side Swift e book. It is all about the right way to construct a modular weblog engine utilizing Vapor 4 and Feather has a really related method. ☺️

You might also like

Introducing – AI Utils for macOS

Encoding and decoding data using the Hummingbird framework

Hummingbird routing and requests – The.Swift.Dev.




Feather CMS - A modern content management system on top of Swift & Vapor. | Product Hunt Embed



Source link

Share30Tweet19
learningcode_x1mckf

learningcode_x1mckf

Recommended For You

Introducing – AI Utils for macOS

by learningcode_x1mckf
March 24, 2023
0
Introducing – AI Utils for macOS

⚠️ REQUIRES a FREE OpenAI API key. You will get one utilizing this hyperlink. ⚠️ Improve your productiveness with our AI powered utility application. - accessible...

Read more

Encoding and decoding data using the Hummingbird framework

by learningcode_x1mckf
March 22, 2023
0
Encoding and decoding data using the Hummingbird framework

HTTP is all about sending and receiving information over the community. Initially it was solely utilized to switch HTML paperwork, however these days we use HTTP to switch...

Read more

Hummingbird routing and requests – The.Swift.Dev.

by learningcode_x1mckf
March 17, 2023
0
Hummingbird routing and requests – The.Swift.Dev.

Routing on the server facet means the server goes to ship a response primarily based on the URL path that the consumer referred to as when firing up...

Read more

Building a Scrollable Custom Tab Bar in SwiftUI

by learningcode_x1mckf
March 10, 2023
0
Building a Scrollable Custom Tab Bar in SwiftUI

Whether or not you’re making a social media app or a productiveness device, the tab bar interface can improve the consumer expertise by making it extra intuitive and...

Read more

Beginner’s guide to server-side Swift using the Hummingbird framework

by learningcode_x1mckf
March 8, 2023
0
Beginner’s guide to server-side Swift using the Hummingbird framework

Swift on the Server in 2023 Three years in the past I began to focus on Vapor, the preferred web-framework written in Swift, which served me very...

Read more
Next Post
Generating Random Numbers in JavaScript with Math.random()

Generating Random Numbers in JavaScript with Math.random()

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related News

“Please, for the love of all things holy, find a different color than orange” – Hacking with Swift

“Please, for the love of all things holy, find a different color than orange” – Hacking with Swift

September 7, 2022
Python Full Stack Developer – PythonBlog

Python Full Stack Developer – PythonBlog

December 6, 2022
Pulumi extends infrastructure as code support for Java and YAML

Pulumi extends infrastructure as code support for Java and YAML

November 28, 2022

Browse by Category

  • C#
  • C++
  • Java
  • JavaScript
  • Python
  • Swift

RECENT POSTS

  • 2023 Java roadmap for developers – TheServerSide.com
  • YS Jagan launches Ragi Java in Jagananna Gorumudda, says focused on intellectual development of students – The Hans India
  • Disadvantages of Java – TheServerSide.com

CATEGORIES

  • C#
  • C++
  • Java
  • JavaScript
  • Python
  • Swift

© 2022 Copyright Learning Code

No Result
View All Result
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#

© 2022 Copyright Learning Code

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?