Install any dependencies with yarn
yarn install
Start the DB. This will build the container, run any inital migrations, and seed in some fake data
yarn db docker:up
Run the app! This will generate any required files, then start both api and app.
yarn start
Login with pin: 1234
Leveraging yarn workspaces, this application was split into three different packages.
-
db
: Contains all code related to the database. The DB is a postgres database that runs locally using docker. This package also initializes thePrisma
client which is a database toolkit to easy make queries to the database. Ideally this package would contain another wrapper around Prisma to absctract away any specific prisma logic. Then if we ever wanted to change db clients we can just update this package and leave everything else untouched. -
api
: Contains the graphql-api. This package leverages GraphQL-Nexus, which is a declaritive way to create our graphql schema. Nexus also integrates nicely with Prisma in the form of a plugin which quickly creates crud endpoints for our models. -
app
: Contains the React app. Decided to opt for usingcreate-react-app
to quicken development pace. Eventually this should be removed to support SSR and more custom build scripts. Other notable features are the usage ofOvermind
for state management,Urql
which is anApolloClient
replacement,Tailwind
as a CSS Framework, andBlueprintjs
(mainly for icon usage)