Code-4-Community / integrative-therapy

Project to create a searchable network for integrative therapists across Massachusetts. For Lucy's Love Bus.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ¦‹ Integrative Therapy Search Network

About

This is a Code 4 Community project in collaboration with Lucy's Love Bus.

Lucy's Love Bus assists children with life threatening illnesses and their families. One service they provide is connecting families with resources in their area. It can be difficult, however, to determine what integrative therapy solutions are available.

This service aims to provide a public search network that will allow users to search for therapists vetted by Lucy's Love Bus, and filter based on conditions that are relevant for their familiy.

Getting Started

Read about our development guidlines at CONTRIBUTING.md.

Install Blitz globally and install dependencies. We use yarn instead of npm

npm i -g yarn
yarn global add blitz cross-env start-server-and-test
yarn install

Run your app in the development mode.

blitz dev

If you get a blitz is not found, yarn's bin may not have automatically been added to your PATH, see fix here: yarnpkg/yarn#5353 (comment)

Open http://localhost:3000 with your browser to see the result.

Environment Variables

Ensure the .env.local file has required environment variables:

DATABASE_URL=postgresql://<YOUR_DB_USERNAME>@localhost:5432/integrative-therapy

Ensure the .env.test.local file has required environment variables:

DATABASE_URL=postgresql://<YOUR_DB_USERNAME>@localhost:5432/integrative-therapy_test

Tests

Runs your tests using Jest.

yarn test

Blitz comes with a test setup using Jest and react-testing-library.

Commands

Blitz comes with a powerful CLI that is designed to make development easy and fast. You can install it with npm i -g blitz

  blitz [COMMAND]

  dev       Start a development server
  build     Create a production build
  start     Start a production server
  export    Export your Blitz app as a static application
  prisma    Run prisma commands
  generate  Generate new files for your Blitz project
  console   Run the Blitz console REPL
  install   Install a recipe
  help      Display help for blitz
  test      Run project tests

You can read more about it on the CLI Overview documentation.

What's included?

Here is the starting structure of your app.

integrative-therapy
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ api/
β”‚   β”œβ”€β”€ auth/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ LoginForm.tsx
β”‚   β”‚   β”‚   └── SignupForm.tsx
β”‚   β”‚   β”œβ”€β”€ mutations/
β”‚   β”‚   β”‚   β”œβ”€β”€ changePassword.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ forgotPassword.test.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ forgotPassword.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ login.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ logout.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ resetPassword.test.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ resetPassword.ts
β”‚   β”‚   β”‚   └── signup.ts
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ forgot-password.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ login.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ reset-password.tsx
β”‚   β”‚   β”‚   └── signup.tsx
β”‚   β”‚   └── validations.ts
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ Form.tsx
β”‚   β”‚   β”‚   └── LabeledTextField.tsx
β”‚   β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”‚   └── useCurrentUser.ts
β”‚   β”‚   └── layouts/
β”‚   β”‚       └── Layout.tsx
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ _app.tsx
β”‚   β”‚   β”œβ”€β”€ _document.tsx
β”‚   β”‚   β”œβ”€β”€ 404.tsx
β”‚   β”‚   β”œβ”€β”€ index.test.tsx
β”‚   β”‚   └── index.tsx
β”‚   └── users/
β”‚       └── queries/
β”‚           └── getCurrentUser.ts
β”œβ”€β”€ db/
β”‚   β”œβ”€β”€ migrations/
β”‚   β”œβ”€β”€ index.ts
β”‚   β”œβ”€β”€ schema.prisma
β”‚   └── seeds.ts
β”œβ”€β”€ integrations/
β”œβ”€β”€ mailers/
β”‚   └── forgotPasswordMailer.ts
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ favicon.ico
β”‚   └── logo.png
β”œβ”€β”€ test/
β”‚   β”œβ”€β”€ setup.ts
β”‚   └── utils.tsx
β”œβ”€β”€ .eslintrc.js
β”œβ”€β”€ babel.config.js
β”œβ”€β”€ blitz.config.ts
β”œβ”€β”€ jest.config.ts
β”œβ”€β”€ package.json
β”œβ”€β”€ README.md
β”œβ”€β”€ tsconfig.json
└── types.ts

These files are:

  • The app/ folder is a container for most of your project. This is where you’ll put any pages or API routes.

  • db/ is where your database configuration goes. If you’re writing models or checking migrations, this is where to go.

  • public/ is a folder where you will put any static assets. If you have images, files, or videos which you want to use in your app, this is where to put them.

  • integrations/ is a folder to put all third-party integrations like with Stripe, Sentry, etc.

  • test/ is a folder where you can put test utilities and integration tests.

  • package.json contains information about your dependencies and devDependencies. If you’re using a tool like npm or yarn, you won’t have to worry about this much.

  • tsconfig.json is our recommended setup for TypeScript.

  • .babel.config.js, .eslintrc.js, .env, etc. ("dotfiles") are configuration files for various bits of JavaScript tooling.

  • blitz.config.ts is for advanced custom configuration of Blitz. Here you can learn how to use it.

  • jest.config.js contains config for Jest tests. You can customize it if needed.

You can read more about it in the File Structure section of the documentation.

Tools included

Blitz comes with a set of tools that corrects and formats your code, facilitating its future maintenance. You can modify their options and even uninstall them.

  • ESLint: It lints your code: searches for bad practices and tell you about it. You can customize it via the .eslintrc.js, and you can install (or even write) plugins to have it the way you like it. It already comes with the blitz config, but you can remove it safely. Learn More.
  • Husky: It adds githooks, little pieces of code that get executed when certain Git events are triggerd. For example, pre-commit is triggered just before a commit is created. You can see the current hooks inside .husky/. If are having problems commiting and pushing, check out ther troubleshooting guide. Learn More.
  • Prettier: It formats your code to look the same everywhere. You can configure it via the .prettierrc file. The .prettierignore contains the files that should be ignored by Prettier; useful when you have large files or when you want to keep a custom formatting. Learn More.

Learn more

Read the Blitz.js Documentation to learn more.

The Blitz community is warm, safe, diverse, inclusive, and fun! Feel free to reach out to us in any of our communication channels.

About

Project to create a searchable network for integrative therapists across Massachusetts. For Lucy's Love Bus.


Languages

Language:PLpgSQL 77.1%Language:TypeScript 22.6%Language:JavaScript 0.1%Language:Shell 0.1%