Skip to content

Commit

Permalink
Merge pull request #199 from setlife-network/release/1.0
Browse files Browse the repository at this point in the history
Release/1.0
  • Loading branch information
otech47 committed Sep 14, 2022
2 parents 9c30908 + 43c3624 commit b96a0a3
Show file tree
Hide file tree
Showing 148 changed files with 13,770 additions and 22,420 deletions.
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
POSTGRES_DB_HOST=
POSTGRES_DB_USERNAME=
POSTGRES_DB_PASSWORD=
POSTGRES_DB_NAME=
POSTGRES_DB_PORT=
API_V1_URL=
106 changes: 67 additions & 39 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,67 +1,79 @@
module.exports = {
'parser': 'babel-eslint',
'extends': 'airbnb',
'plugins': [
'babel'
env: {
browser: true,
es2021: true,
},
extends: [
'plugin:react/recommended',
'airbnb',
],
'parserOptions': {
'ecmaFeatures': {
'jsx': true
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
'ecmaVersion': 2018,
'sourceType': 'module'
ecmaVersion: 'latest',
sourceType: 'module',
},
'rules': {
plugins: [
'react',
'@typescript-eslint',
],
rules: {
'array-callback-return': ['off'],
'arrow-body-style': ['off'],
'arrow-parens': ['off'],
'babel/quotes': ['error', 'single'],
'camelcase': ['off'],
'comma-dangle': ['off'],
'comma-spacing': ['error', { 'before': false, 'after': true }],
'consistent-return': ['off'],
'curly': ['off'],
'default-case': 'off',
'dot-notation': 'off',
'eol-last': ['off'],
'eqeqeq': 'off',
'func-names': ['off'],
'function-paren-newline': ['off'],
'guard-for-in': 'off',
'global-require': ['off'],
'indent': ['error', 4, { 'SwitchCase': 1 }],
'import/prefer-default-export': ['off'],
'import/no-extraneous-dependencies': 'off',
'import/no-import-module-exports': 'off',
'class-methods-use-this': ['off'],
'indent': ['error', 4, { 'MemberExpression': 0, 'ignoreComments': true }],
'import/extensions': 'off',
'import/first': 'off',
'import/no-named-as-default': 'off',
'import/no-named-default': 'off',
'jsx-a11y/anchor-has-content': ['off'],
'jsx-a11y/img-has-alt': ['off'],
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-quotes': ['error', 'prefer-single'],
'import/no-cycle': 'off',
'import/no-unresolved': 'off',
'import/order': 'off',
'jsx-a11y/click-events-have-key-events': ['off'],
'jsx-a11y/no-static-element-interactions': ['off'],
'jsx-quotes': ['off'],
'keyword-spacing': ['error', { 'after': true }],
'linebreak-style': ['off'],
'lines-between-class-members': 'off',
'linebreak-style': 'off',
'max-len': 'off',
'new-cap': 'off',
'no-alert': 'off',
'no-bitwise': 'off',
'no-console': 'off',
'no-class-assign': 'off',
'no-confusing-arrow': 'off',
'no-constant-condition': 'off',
'no-case-declarations': 'off',
'no-else-return': 'off',
'no-empty-pattern': ['off'],
'no-floating-decimal': 'off',
'no-multi-assign': 'off',
'no-mixed-operators': 'off',
'no-nested-ternary': 'off',
'no-path-concat': 'off',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-restricted-globals': 'off',
'no-restricted-syntax': 'off',
'no-return-assign': 'off',
'no-self-compare': 'off',
'no-shadow': 'off',
'no-undef': 'off',
'no-underscore-dangle': 'off',
'no-unused-vars': 'off',
'no-unreachable': 'off',
'no-unneeded-ternary': 'off',
Expand All @@ -72,29 +84,45 @@ module.exports = {
'no-trailing-spaces': 'off',
'no-var': ['off'],
'object-shorthand': 'off',
'object-curly-newline': 'off',
'object-curly-spacing': 'off',
'operator-linebreak': 'off',
'padded-blocks': 'off',
'prefer-arrow-callback': 'off',
'prefer-template': 'off',
'prefer-const': 'off',
'prefer-destructuring': 'off',
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }],
'quote-props': 'off',
'react/destructuring-assignment': ['off'],
'react/forbid-prop-types': ['off'],
'react/jsx-filename-extension': ['off'],
'react/jsx-space-before-closing': ['off'],
'react/jsx-indent': ['error', 4, { 'MemberExpression': 0 }],
'react/jsx-indent-props': ['error', 4],
'react/no-danger': ['off'],
'react/no-unescaped-entities': ['off'],
'react/no-did-mount-set-state': ['off'],
'react/sort-comp': ['off'],
'react/self-closing-comp': ['off'],
'react/prefer-stateless-function': 'off',
'react/prop-types': 'off',
'semi': 'off',
'react/function-component-definition': [
2,
{
namedComponents: ['function-declaration', 'function-expression', 'arrow-function'],
},
],
'react/jsx-filename-extension': [
1,
{
extensions: ['.tsx'],
},
],
'react/jsx-props-no-spreading': ['off'],
'react/jsx-indent': ['off'],
'react/jsx-indent-props': ['off'],
'react/jsx-one-expression-per-line': ['off'],
'react/jsx-no-target-blank': ['off'],
'react/no-array-index-key': ['off'],
'react/react-in-jsx-scope': ['off'],
'semi': ['off'],
'space-before-function-paren': ['off'],
'spaced-comment': ['off'],
'space-in-parens': ['off'],
'vars-on-top': ['off'],
'wrap-iife': ['off']
}
};
'wrap-iife': ['off'],
},
settings: {
react: {
version: 'detect',
},
},
};
22 changes: 18 additions & 4 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,30 @@
# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
sendgrid.env
7 changes: 7 additions & 0 deletions .sequelizerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const path = require('path');

module.exports = {
'config': path.resolve('./pages/api/models', 'config.js'),
'models-path': path.resolve('./pages/api/models', 'index'),
'migrations-path': path.resolve('./pages/api/migrations', '')
};
119 changes: 82 additions & 37 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,68 +1,113 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
# Setlife-solutions

## Available Scripts
## Development

In the project directory, you can run:
### Overview

### `yarn start`
Created with NextJS combines both backend and framework into a single app. React based for the fronted communicating with the back making use of a GraphQL API.

Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
### Project Structure

The page will reload if you make edits.<br />
You will also see any lint errors in the console.
- The `/pages` folder contains the routing of the app
- The `/components` folder contains all the reusable react-based components
- The `/api` folder contains a backend model based on

### `yarn test`
* An GraphQL API using micro apollo
* A sequelize ORM with the model and migrations to connect to a sequelize DB

Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
- The `/config` folder miscellaneous config for multiple purposes including DB credentials

### `yarn build`
```
/ setlife-solutions
|_ config
|_ components
|_ styles
|_ pages
|_ api
|_ v1.ts
|_ migrations
|_ models
|_ graphql
|_ schema
|_ index.ts
|_ resolvers
|_ types
```

Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
### Setup

The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!
1. Clone the repo

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
```
git clone https://github.com/setlife-network/setlife-solutions.git
```

### `yarn eject`
2. Install packages

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
```
cd setlife-solutions
npm install
```

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
3. Copy the sample environment configuration file

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
```
cp .env.example .env
```

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
4. Obtain a `.env` file from a project maintainer or fill out your own values

## Learn More
5. Run the app

```
npm run dev
```

7. UI should open in the browser at `localhost:3000`

8. An API Explorer is accessible in the browser at `localhost:3000/api/v1`

#### Using a local database

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
1. Download PostgreSQL v14 with the client of choice from here https://www.postgresql.org/
2. Create a database and setup the `.env` file with the corresponding credentials
3. Generate the tables running the migrations `npx sequelize-cli db:migrate`
4. Start the app `npm run dev`

To learn React, check out the [React documentation](https://reactjs.org/).
---

### Code Splitting
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
## Getting Started

### Analyzing the Bundle Size
First, run the development server:

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
```bash
npm run dev
# or
yarn dev
```

### Making a Progressive Web App
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Learn More

### Advanced Configuration
To learn more about Next.js, take a look at the following resources:

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

### Deployment
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
## Deploy on Vercel

### `yarn build` fails to minify
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
20 changes: 20 additions & 0 deletions components/ArrowIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react'

const ArrowIcon = () => {
return (
<div className='ArrowIcon'>
<svg
xmlns='http://www.w3.org/2000/svg'
className='my-auto inline ml-4 mt-1 h-4 w-4 md:mt-0 md:w-6 md:h-6'
fill='none'
viewBox='0 0 24 24'
stroke='currentColor'
strokeWidth={2}
>
<path strokeLinecap='round' strokeLinejoin='round' d='M14 5l7 7m0 0l-7 7m7-7H3' />
</svg>
</div>
)
}

export default ArrowIcon
Loading

0 comments on commit b96a0a3

Please sign in to comment.