Next.js(React),Go kit(Golang)で「SENRYU」を個人開発した

今回はじめて個人開発でアプリを作りました!!今年の1月に個人開発をしようと考えてから、アプリ企画・技術選定をして、開発途中で作るアプリを変えたりと色々と迷走しましたが、なんとか一区切りつきました!!(8か月ぐらいかかるなんてチンタラやってたなあ(笑)) 開発したアプリや今まで考えていたことなどをまとめます。 アプリ概要 川柳を共有することができるSNSアプリ「SENRYU」を開発しました。 機能 ログイン ユーザー登録 ログアウト 川柳一覧表示 マイ川柳一覧表示 川柳投稿 フロントエンド Next.js(React) フロントエンドにはNext.jsを利用しました。TypeScriptを使ってみたくて、TypeScriptと相性がいいReactを選択して、最近話題のNext.jsにしようと決めました。 Next.jsはルーティング設定が楽だし、SSG, SSR, SPAをページごとに設定できて便利だしと使って良かったなと思っています。ただ、認証はFirebaseやNextAuth.jsを利用して他のSNSアカウントとかでログインする実装にするのが楽だと感じました。 Material-UI ReactのUIコンポーネントライブラリであるMaterial-UIを利用してUIの基礎を作りました。簡単に見た目を整えることができるので、とても便利です。 styled-components Material-UIの見た目を調整したい時にCCS in JSのstyled-componentsを利用しました。TypeScript内でCSSを書けるので普段CSSとかを書かない僕には使いやすかったです。 バックエンド Go kit(Golang) 個人的にGolangを利用したかったのとマイクロサービス構成でアプリを作ってみたいという理由からGo kitを利用しました。使ってみた感想としてあまり日本語のドキュメントとかなく調べるのが大変でしたが、Golangにはホットリロードがあってコンパイルが速く言語に慣れれば開発スピードが上がりそうだなと思いました。 データベース MongoDB NoSQLを利用したことがなかったので今回利用しました。MongoDBの基礎的な知識を身につけることはできましたが、RDBMSよりもNoSQLを利用するメリットがあんまりわからなかったです。 開発環境 Docker マイクロサービス構成でアプリ開発をしていたので、それぞれのサービス毎にコンテナを作成しました。ローカルでDockerコンテナを立てて開発するときはVSCodeのRemote Containerが非常に便利でした。ぜひ使ってみてほしいです。 対象リポジトリ senryu-frontend senryu-user senryu-post 記事を書くまでの経緯 元々、今年の1月に他のサービス開発を考えていました。技術選定の時には Next.js(React) TypeScript Go kit(Golang) MongoDB Docker Github Actions AWS K8s マイクロサービス でアプリを開発してリリースをしようと思っていました。せっかくの個人開発だし勉強もかねて挑戦してやる!っていう気持ちで技術選定をしましたが、今思うとDocker以外はほぼ経験がなかったのでめちゃくちゃ無謀だったなと思います。(笑) そんな感じで技術選定をしてから要件や仕様決めて開発を始めましたが、わからないことが多すぎで全然進捗がなかったです。。亀の足のような遅さでしたがなんとか進めていた 4月頃か5月頃に気づいてしまいました。 「クラウドでK8s使うと金けっこうかかるやんけ!」 今思うと当たり前だし、調査不足すぎだよ自分。。ということがあり、最初に作りたかったサービスは世にリリースするのが厳しいなと思いましたが、せっかくある程度までは勉強して作っていたので、違うサービスとして開発をしてGithubで公開してポートフォリオ的な感じにしようと決めました。 といった経緯で今に至ります。結果的には個人開発したアプリをリリースすることはできませんでしたが、Next.jsとGolangを学べたり個人開発の雰囲気を味わえたので良かったです。 最後に 個人開発はすべてを自分で考えないといけないので、とても大変ですが技術選定や作業の進め方など誰からも指図されずに好きなようにできるので、楽しいし学びが多いですね。

September 20, 2020 · 1 min · 60 words · Yu

AtCoder用にPythonの環境構築

本記事は以前Qiitaに投稿した内容を本ブログに持ってきています。 はじめに 最近、AtCoderを始めました。 AtCoderは競技プログラミングサイトで、毎週リアルタイムのコンテストが開催されていて、AtCoderで評価されたレーティングを利用して、転職活動ができるAtCoderJobsというサービスが話題になっているそうです。 最初、シェルがfishでHomebrewなどが入っている状態で色々試していましたが、うまくいかなかったので、Mac環境をきれいにして環境構築をしました。 環境 macOS Catalina 10.15.2 Homebrew 2.1.15 bash 3.2.57 シェルをbashに戻す ターミナルで以下コマンドを叩いて、ターミナルの再起動をするとシェルがbashに戻ります。 $ chsh -s /bin/bash Homebrewをアンインストールする 以下コマンドを叩いてパスワードを入力すると、Homebrewをアンインストールできます。 $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" Homebrewの公式サイトに記載されています。 Homebrewインストールする 以下コマンドを叩く。 $ usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" インストールできたか確認するために、以下コマンドを叩きます。 $ brew doctor すると、Warningが大量に出たので、brew doctorでWarningが出たので解決方法まとめました。(for Mac)を参考に解決しました。 Warning: Unbrewed dylibs were found in /usr/local/include. のログに関しては残すことを忘れてしまっていたので、上記記事を引用しています。 Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks! Warning: Unbrewed header files were found in /usr/local/include. If you didn't put them there on purpose they could cause problems when building Homebrew formulae, and may need to be deleted. Unexpected header files: /usr/local/include/arith.h /usr/local/include/binary_log_types.h /usr/local/include/cdt.h /usr/local/include/cgraph.h /usr/local/include/color.h /usr/local/include/decode.h /usr/local/include/demux.h /usr/local/include/encode.h /usr/local/include/errmsg.h /usr/local/include/fcfreetype.h /usr/local/include/fcprivate.h /usr/local/include/fontconfig.h /usr/local/include/freetype/config/ftconfig.h /usr/local/include/freetype/config/ftheader.h /usr/local/include/freetype/config/ftmodule.h /usr/local/include/freetype/config/ftoption.h /usr/local/include/freetype/config/ftstdlib.h /usr/local/include/freetype/freetype.h /usr/local/include/freetype/ftadvanc.h /usr/local/include/freetype/ftbbox.h /usr/local/include/freetype/ftbdf.h /usr/local/include/freetype/ftbitmap.h /usr/local/include/freetype/ftbzip2.h /usr/local/include/freetype/ftcache.h /usr/local/include/freetype/ftchapters.h /usr/local/include/freetype/ftcid.h /usr/local/include/freetype/ftdriver.h /usr/local/include/freetype/fterrdef.h /usr/local/include/freetype/fterrors.h /usr/local/include/freetype/ftfntfmt.h /usr/local/include/freetype/ftgasp.h /usr/local/include/freetype/ftglyph.h /usr/local/include/freetype/ftgxval.h /usr/local/include/freetype/ftgzip.h /usr/local/include/freetype/ftimage.h /usr/local/include/freetype/ftincrem.h /usr/local/include/freetype/ftlcdfil.h /usr/local/include/freetype/ftlist.h /usr/local/include/freetype/ftlzw.h /usr/local/include/freetype/ftmac.h /usr/local/include/freetype/ftmm.h /usr/local/include/freetype/ftmodapi.h /usr/local/include/freetype/ftmoderr.h /usr/local/include/freetype/ftotval.h /usr/local/include/freetype/ftoutln.h /usr/local/include/freetype/ftparams.h /usr/local/include/freetype/ftpfr.h /usr/local/include/freetype/ftrender.h /usr/local/include/freetype/ftsizes.h /usr/local/include/freetype/ftsnames.h /usr/local/include/freetype/ftstroke.h /usr/local/include/freetype/ftsynth.h /usr/local/include/freetype/ftsystem.h /usr/local/include/freetype/fttrigon.h /usr/local/include/freetype/fttypes.h /usr/local/include/freetype/ftwinfnt.h /usr/local/include/freetype/t1tables.h /usr/local/include/freetype/ttnameid.h /usr/local/include/freetype/tttables.h /usr/local/include/freetype/tttags.h /usr/local/include/ft2build.h /usr/local/include/geom.h /usr/local/include/graphviz_version.h /usr/local/include/gvc.h /usr/local/include/gvcext.h /usr/local/include/gvcjob.h /usr/local/include/gvcommon.h /usr/local/include/gvconfig.h /usr/local/include/gvplugin.h /usr/local/include/gvplugin_device.h /usr/local/include/gvplugin_layout.h /usr/local/include/gvplugin_loadimage.h /usr/local/include/gvplugin_render.h /usr/local/include/gvplugin_textlayout.h /usr/local/include/gvpr.h /usr/local/include/lt_dlloader.h /usr/local/include/lt_error.h /usr/local/include/lt_system.h /usr/local/include/mux.h /usr/local/include/mux_types.h /usr/local/include/my_command.h /usr/local/include/my_list.h /usr/local/include/mysql.h /usr/local/include/mysql/client_plugin.h /usr/local/include/mysql/plugin_auth_common.h /usr/local/include/mysql/udf_registration_types.h /usr/local/include/mysql_com.h /usr/local/include/mysql_time.h /usr/local/include/mysql_version.h /usr/local/include/mysqld_error.h /usr/local/include/mysqlx_ername.h /usr/local/include/mysqlx_error.h /usr/local/include/mysqlx_version.h /usr/local/include/pack.h /usr/local/include/pathgeom.h /usr/local/include/pathplan.h /usr/local/include/png.h /usr/local/include/pngconf.h /usr/local/include/textspan.h /usr/local/include/types.h /usr/local/include/usershape.h /usr/local/include/xdot.h Warning: Your Xcode (10.3) is outdated. Please update to Xcode 11.3 (or delete it). Xcode can be updated from the App Store. Warning: Broken symlinks were found. Remove them with `brew cleanup`: /usr/local/lib/node_modules/expo-cli/node_modules/.bin/detect-libc /usr/local/lib/node_modules/expo-cli/node_modules/.bin/prebuild-install まずは、Warning: Unbrewed header files were found in /usr/local/include.の解決をします。 ...

March 16, 2020 · 6 min · 1133 words · Yu