pointfreeco

所属分类:模式识别(视觉/语音等)
开发工具:Swift
文件大小:3914KB
下载次数:0
上传日期:2023-06-18 23:48:10
上 传 者sh-1993
说明:  [www.pointfree.co](http:www.pointfree.co)的来源,这是一个关于函数编程和Swift编程语言的视频系列。
(The source for [www.pointfree.co](http: www.pointfree.co), a video series on functional programming and the Swift programming language.)

文件列表:
.PointFree.xccolortheme (7323, 2023-10-30)
.pf-env.example (796, 2023-10-30)
CC-LICENSE.md (19093, 2023-10-30)
Dockerfile (933, 2023-10-30)
Dockerfile.local (550, 2023-10-30)
LICENSE (1073, 2023-10-30)
Makefile (4617, 2023-10-30)
Package.resolved (9946, 2023-10-30)
Package.swift (19662, 2023-10-30)
Point-Free.xccolortheme (7323, 2023-10-30)
PointFree.playground (0, 2023-10-30)
PointFree.playground\Pages (0, 2023-10-30)
PointFree.playground\Pages\About.xcplaygroundpage (0, 2023-10-30)
PointFree.playground\Pages\About.xcplaygroundpage\Contents.swift (483, 2023-10-30)
PointFree.playground\Pages\Account.xcplaygroundpage (0, 2023-10-30)
PointFree.playground\Pages\Account.xcplaygroundpage\Contents.swift (490, 2023-10-30)
PointFree.playground\Pages\Blog.xcplaygroundpage (0, 2023-10-30)
PointFree.playground\Pages\Blog.xcplaygroundpage\Contents.swift (548, 2023-10-30)
PointFree.playground\Pages\Database.xcplaygroundpage (0, 2023-10-30)
PointFree.playground\Pages\Database.xcplaygroundpage\Contents.swift (653, 2023-10-30)
PointFree.playground\Pages\Email Tester.xcplaygroundpage (0, 2023-10-30)
PointFree.playground\Pages\Email Tester.xcplaygroundpage\Contents.swift (592, 2023-10-30)
PointFree.playground\Pages\Episode Page.xcplaygroundpage (0, 2023-10-30)
PointFree.playground\Pages\Episode Page.xcplaygroundpage\Contents.swift (522, 2023-10-30)
PointFree.playground\Pages\Homepage.xcplaygroundpage (0, 2023-10-30)
PointFree.playground\Pages\Homepage.xcplaygroundpage\Contents.swift (550, 2023-10-30)
PointFree.playground\Pages\Invoices.xcplaygroundpage (0, 2023-10-30)
... ...

# [www.pointfree.co](http://www.pointfree.co) [![Swift 5.7](https://img.shields.io/badge/swift-5.7-ED523F.svg?style=flat)](https://swift.org/download/) [![CI](https://github.com/pointfreeco/pointfreeco/workflows/CI/badge.svg)](https://actions-badge.atrox.dev/pointfreeco/pointfreeco/goto) [![@pointfreeco](https://img.shields.io/badge/contact-@pointfreeco-5AA9E7.svg?style=flat)](https://twitter.com/pointfreeco) This repo contains the full source code for the [Point-Free](http://www.pointfree.co) website, a video series exploring Swift and functional programming. The codebase is split into 3 pieces: * `PointFree`: This is the core application, and is responsible for routing requests, loading data and rendering HTML and CSS. * `Styleguide`: This library contains functions and data types for creating a consistent style across the entire website. * `Server`: This is the actual executable server. It uses [NIO](https://github.com/apple/swift-nio) to handle the low-level server responsibilities, and hands everything else over to the `PointFree` package. ![Point-Free Homepage](.github/pointfreeco-announcement-homepage.png) ## Getting Started Interested in a [video tour of the code base](https://www.pointfree.co/episodes/ep22-a-tour-of-point-free)? video poster image The repo contains an extensive test suite and some playgrounds to explore. To get things running: * Open up a terminal window and grab the code: ``` sh git clone https://github.com/pointfreeco/pointfreeco.git cd pointfreeco ``` * Make sure [`cmark`](https://github.com/commonmark/cmark) is installed. You can install it with Homebrew: ``` sh brew install cmark # or your preferred installation method ``` * Make sure [Postgres](https://www.postgresql.org) is installed _and running_. It's our database of choice. You can install it with Homebrew: ``` sh brew install postgres # or your preferred installation method brew services start postgresql # or your preferred launch method make db ``` (If you use Postgres.app, EnterpriseDB, or another installation method, please follow some additional instructions in the [CPostgreSQL](https://github.com/vapor-community/cpostgresql) README.) With the project open in Xcode, you can: * Run the server locally * Select the `Server` target * Run: Command+R * Visit `http://localhost:8080` * Explore our playgrounds * Select the `PointFree` target * Build: Command+B * Open a [playground](https://github.com/pointfreeco/pointfreeco/tree/main/PointFree.playground)! ## Some fun things to explore There're a lot of fun things to explore in this repo. For example: * We develop web pages in playgrounds for a continuous feedback loop. This is made possible by the fact that the entire server stack is composed of pure functions with side-effects pushed to the boundaries of the application. It allows us to load up any request in isolation, including `POST` requests, all without ever worrying about doing a side-effect. ![Server side Swift in a playground](.github/pointfreeco-playgrounds.png) * We use [snapshot testing](https://github.com/pointfreeco/swift-snapshot-testing) to capture full data structures in order to verify their correctness. Not only do we do this in the traditional way of taking screenshots of web pages at various break points (e.g. on [iPhone](https://github.com/pointfreeco/pointfreeco/blob/fe09eae4***35b603ee8083bdfdcee45b3fed81b0/Tests/PointFreeTests/__Snapshots__/LaunchSignupTests/testHome.3._375.0x667.0.png) and [desktop](https://github.com/pointfreeco/pointfreeco/blob/fe09eae4***35b603ee8083bdfdcee45b3fed81b0/Tests/PointFreeTests/__Snapshots__/LaunchSignupTests/testHome.5._800.0x600.0.png)), but we can also snapshot any entire request-to-response lifecycle (e.g. the `POST` to a signup page does the correct [redirect](https://github.com/pointfreeco/pointfreeco/blob/fe09eae4***35b603ee8083bdfdcee45b3fed81b0/Tests/PointFreeTests/__Snapshots__/LaunchSignupTests/testSignup.1.Conn.txt)). ``` – Step ResponseEnded – Request POST http://localhost:8080/launch-signup email=hello@pointfree.co – Response Status 302 FOUND Location: /?success=true ``` ## Xcode Color Theme Like the color theme we use in our episodes? Run `make colortheme` to install locally! ## Related projects Point-Free uses a bunch of interesting open-source software: * — [swift-html](https://www.github.com/pointfreeco/swift-html): A Swift DSL for type-safe, extensible, and transformable HTML documents. * [swift-web](https://www.github.com/pointfreeco/swift-web): A collection of types and functions for dealing with common web server concerns, such as HTML render, CSS preprocessing, middleware and more. * [swift-prelude](https://www.github.com/pointfreeco/swift-prelude): Offers a standard library for experimental functional programming in Swift. * · [swift-tagged](https://www.github.com/pointfreeco/swift-tagged): Helps us create strong contracts with our data boundaries, like JSON from [GitHub](https://github.com/pointfreeco/pointfreeco/blob/d2dd9ff0f8caf0c8660eace050b7436c02e19aba/Sources/PointFree/GitHub.swift#L56) and [Stripe](https://github.com/pointfreeco/pointfreeco/blob/d2dd9ff0f8caf0c8660eace050b7436c02e19aba/Sources/PointFree/Stripe.swift#L92), and our [PostgreSQL data](https://github.com/pointfreeco/pointfreeco/blob/d2dd9ff0f8caf0c8660eace050b7436c02e19aba/Sources/PointFree/Database.swift#L95). * “ [swift-snapshot-testing](https://www.github.com/pointfreeco/swift-snapshot-testing): Powers our testing infrastructure by taking snapshots of various data structures to guarantee the correctness of their output. We use this on everything from [middleware](https://github.com/pointfreeco/pointfreeco/blob/27f6eae212c1fea48da24b1f16a26043baaea4aa/Tests/PointFreeTests/__Snapshots__/LaunchSignupTests/testSignup.1.Conn.txt) to ensure requests are correctly transformed into responses, and even entire web pages to make sure the site looks correct at a variety of sizes (e.g. on [iPhone](https://github.com/pointfreeco/pointfreeco/blob/fe09eae4***35b603ee8083bdfdcee45b3fed81b0/Tests/PointFreeTests/__Snapshots__/LaunchSignupTests/testHome.3._375.0x667.0.png) and [desktop](https://github.com/pointfreeco/pointfreeco/blob/fe09eae4***35b603ee8083bdfdcee45b3fed81b0/Tests/PointFreeTests/__Snapshots__/LaunchSignupTests/testHome.5._800.0x600.0.png)). Explore more of our open-source on the [Point-Free](https://github.com/pointfreeco) organization. ## Learn More Brandon gave a talk about most of the core ideas that went into this project at [Swift Summit 2017](http://www.swiftsummit.com). The two sides of writing testable code ## Find this interesting? Then check out [Point-Free](https://www.pointfree.co)! ## License The content of this project itself is licensed under the [CC BY-NC-SA 4.0 license](https://creativecommons.org/licenses/by-nc-sa/4.0/), and the underlying source code used to format and display that content is licensed under the [MIT license](LICENSE).

近期下载者

相关文件


收藏者