-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from setlife-network/release/1.0
Release/1.0
- Loading branch information
Showing
148 changed files
with
13,770 additions
and
22,420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', '') | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.