intro.md
June 19, 2019 ยท View on GitHub
this document is intended to give you a taste of how coderplanets_server works, It still assumes basic knowledge of Elixir/Phoenix and GraphQL. If you're completely new to Elixir/GraphQL, please refer to https://elixir-lang.org/getting-started/introduction or https://www.howtographql.com/ first!
NOTE: since coderplanets_server is build on top of groupher-stack, the whole project is under namespace of
Groupher
Tech Stack
Here's a curated list of packages that used by CPS project. However, the best way to see a complete list of the dependencies is to check mix.ex.
Core
testing
lint
Project Structure
Let's start with understanding why we have chosen our particular structure. since Phoenix 1.3 has a lots of major changes, we recommend you to watch the full video.
In any case, here's the TL;DR:
- You will write your app in the
libandtestfolder. This is the folder you will spend most of your time in. - Configurations are locate in
configfolder - migrations and mock seeds in
privfolder - Most of generator and utils cmds are validable in Makefile, use
make helpsee the full list
lib/
-
groupher_server/we split our logic code into contexts. a context will group related functionality which located in context'sdelegatesdir, By using contexts, we decouple and isolate our systems into 5 manageable, independent parts:accounts/handle account-related logic like: register, profile, mailbox, achievement, billing, customization ...cms/handle content-releated logic like: community curd/operation/reactions, contents(posts, jobs, videos, ..) CURD/operation/reactions ...delivery/handle msg-related logic like: user mentions, system notifications ...log/record important actionsstatistics/handle statistics like: user contributes, community contributes ...
-
groupher_server_web/handle "web-interface" only logicresolvers/graphql resolvers based on Contextschema/graphql schema based on Context, include queries & mutationsmiddleware/common logic like authorize, passport, pagesize_check ...channels/hanlde realtime communitications like graphql subscription ...helper/As the name suggests this folder reusable modules like query_builder, orms ...
test/
master_server/test all the "domain logic"master_server_web/test all the web logic, most are graphql interfacehelper/test all helper functions
config/
config files based on dierent env
deploy/
dev/dev server packer, Docker setttings ..production/production server packer, Docker setttings ..
priv/
mock/seeds script for initrepo/migrations files