Slide 1

Slide 1 text

Let's start your first OSS with CakePHP by itosho / Connehito Inc. CakeFest 2019 Tokyo, Japan

Slide 2

Slide 2 text

Hello, everyone!

Slide 3

Slide 3 text

About Me Sho ITO @itosho - Backend Engineer, CakePHP Contributor - Like Baseball⚾, Basketball - CTO, Connehito Inc. - From the beginning, we used CakePHP in all backend systems

Slide 4

Slide 4 text

About Our Company

Slide 5

Slide 5 text

Creating services that people cannot live without Connehito uses the power of technology to provide support to mothers in their daily decision makings about family matter

Slide 6

Slide 6 text

Brand that supports mothers' each step Business Lineup

Slide 7

Slide 7 text

No.1 app for mothers in Japan! One third of mothers in Japan are using mamari Communication amongst users about their worries and experiences about childbearing and childcare Q&A Community App Delivery of useful articles about childbearing and childcare. Many articles are supervised by experts Web Media A subscription service provides more useful functions e.g. premium articles, shopping coupons, premium search functions Mamari Premium

Slide 8

Slide 8 text

Have you ever wanted to create OSS?

Slide 9

Slide 9 text

But, it's hard to take action, isn't it?

Slide 10

Slide 10 text

Let’s take the first step TODAY!

Slide 11

Slide 11 text

Today’s Topics 1. Let’s create OSS! 2. Make it better! 3. Accelerate your OSS activity!

Slide 12

Slide 12 text

1. Let’s create OSS!

Slide 13

Slide 13 text

About Easy Query - Behavior Plugin for CakePHP - https://github.com/itosho/easy-query - Easily some complicated queries - e.g. upsert, bulk upsert bulk insert, and insert once(insert select query) - Requirements: PHP 7.0+, CakePHP 3.5+, MySQL 5.6+ - Looking for someone to support PostgreSQL !

Slide 14

Slide 14 text

Usage

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

Step1. Prepare an OSS

Slide 17

Slide 17 text

Create a Repository - Well begun is half done. - If you don’t mind - on GitHub - MIT Licence - Naming is important - Googleability - cake prefix

Slide 18

Slide 18 text

The name and meta infomartion Lists packages required Autoload mapping

Slide 19

Slide 19 text

Step2. Write codes

Slide 20

Slide 20 text

The most fun process - Describe only bulkInsert() - Please check the repository for details

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Decomposed the Entity array data into fields and data Query builder realizes processing of the bulk inser

Slide 23

Slide 23 text

Step3. Write test codes

Slide 24

Slide 24 text

Test codes are necessary for OSS - We can release OSS without test codes - But, OSS without test codes is not reliable for developers - TDD is a good choice

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

Assert Arrange Act

Slide 28

Slide 28 text

Step4. Setup CI

Slide 29

Slide 29 text

Finished writing code, not done yet - Travis CI is a best tool for OSS - Static code analysis and lint tool improve quality of OSS - Static code analysis: PHPStan - Lint tool: CakePHP Code Sniffer

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Step5. Clean up the document

Slide 36

Slide 36 text

README is like a entrance - README is very important - Requirements - Installation - Usage - It’s kind to have badges - https://poser.pugx.org/

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

Done!

Slide 39

Slide 39 text

2. Make it better

Slide 40

Slide 40 text

I might as well - Making it useful for many people - not only for self-satisfaction - I researched some popular OSS - found some common points

Slide 41

Slide 41 text

Good OSS has “3Cs” 1. Convenience 2. Clarity 3. Continuity

Slide 42

Slide 42 text

Convenience - Big benefits required - The effort to solve a problem is often more bother than the pain that causes it... - Case: Easy Query - High performance of bulkInsert() - A CakePHP standard method, saveMany() doesn't have it - Inspection: insert 100 records to a tags table - saveMany() 2.93 sec - bulkInsert() 2.01 sec - Enviorment: CentOS6, MySQL5.6, CPU 2core, Memory 2GB (Docker for Mac)

Slide 43

Slide 43 text

Clarity - Anyway can use it quickly - mature documentation - “When in Rome, do as the Romans do” - intuitive and simplie - Case: Easy Query - bulkInsert() has same interface with saveMany()

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

Continuity - GitHub’s star is not all! - The change is drastic - Even a popular OSS is not remembered half a year later - It is also important to improve continuously - Case: Easy Query - I updated it last week - I declare today that I will upgrade Easy Query to CakePHP4 within half a year!

Slide 46

Slide 46 text

Done!

Slide 47

Slide 47 text

3. Accelerate your OSS activity!

Slide 48

Slide 48 text

Next Step - OSS activity is fun and good! - But, it is difficult to continue...

Slide 49

Slide 49 text

- Connehito has a company program for encouraging OSS activities - Smile Program! - To put it simply, it is an output support program - It started half a year ago Smile Program

Slide 50

Slide 50 text

What is a smile program? - Save up miles when our members contribute to the outside community - Members can then spend miles Engineer A Miles bank Engineer B Save Up! (by Output) - OSS Contribution - Presenting and Writing Spend! (for Input) - Getting certified - Attend Oversea Conferences

Slide 51

Slide 51 text

Concept - Money is not the motivation - When in need of support, a member can get it - Evaluating the value of output and input

Slide 52

Slide 52 text

Let me show you how it actually works

Slide 53

Slide 53 text

Smile Counter - CMS for Smile Program - Featutes - Request for output and input - Review for output and input - Mile management - Member management - Member Rankings - Made with CakePHP4!

Slide 54

Slide 54 text

Why did we start Smile Program?

Slide 55

Slide 55 text

We are raised by the engineer's community Engineer’s Community Connehito Inc Grow! - Using many OSS like CakePHP - Referring to other company’s case study

Slide 56

Slide 56 text

Simply, I want to give back to it.

Slide 57

Slide 57 text

Ecosystem Community Connehito Grow Take - Many OSS - Case Study - Conference Community Connehito Grow Take - Many OSS - Case Study - Conference Give - Contribution - Case Study - Sponsor

Slide 58

Slide 58 text

Win-Win Relationship!

Slide 59

Slide 59 text

Summary - If you have the will, you can create OSS now - Keep in mind the "3Cs" when creating OSS - “3Cs” are Convenience, Clarity and Continuity - Connehito will continue to use CakePHP - And we aim to be an indispensable company for CakePHP community!

Slide 60

Slide 60 text

Thank you!