Skip to content

Commit

Permalink
feat: Update onboarding setup
Browse files Browse the repository at this point in the history
For #61
  • Loading branch information
Xavier-IV committed Jul 24, 2023
1 parent dd3d1ad commit 5e60ca9
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ MAIL_PASSWORD=
#upload thing. Visit https://uploadthing.com/ to register your own dev env storage
UPLOADTHING_SECRET=
UPLOADTHING_APP_ID=

# https://developers.google.com/identity/oauth2/web/guides/get-google-api-clientid
# https://next-auth.js.org/providers/google
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
setup-postgres:
docker run --name basic-postgres --rm -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=4y7sV96vA9wv46VR -e PGDATA=/var/lib/postgresql/data/pgdata -v /tmp:/var/lib/postgresql/data -p 5432:5432 -d postgres:14.1-alpine
docker run --name basic-postgres --rm -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v /tmp:/var/lib/postgresql/data -p 5432:5432 -d postgres:14.1-alpine
30 changes: 18 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,32 @@ Join us today and be part of this open source project that aims to make prayer a

### Prerequisites

- NodeJS 18 (you can use [nvm](https://github.com/nvm-sh/nvm))
- [Docker](https://www.docker.com)
- make
- [yarn](https://yarnpkg.com)
- run `corepack enable` (Node.js >= 16.10)
- run `npm i -g corepack` (Node.js < 16.10)
- [Google Identity](https://developers.google.com/identity/oauth2/web/guides/get-google-api-clientid)
- [UploadThing](https://uploadthing.com/)

### Installation

1. Clone this repo.
2. Run `cd ratemysurau`
3. Run `cp .env.example .env` to create the .env file
4. Get a free API Key at [uploadthing](https://uploadthing.com/) <- I'm using this to upload images to S3
- Create your own account and get the API key
- Or you can reach out to me for API credentials
5. Run the following yarn commands:
- `yarn`
- `yarn setup-db` <- make sure make is installed
- `yarn dev` <- this will start the server and the client
- `yarn db-seed` <- this will seed the database with some data
6. Go to `localhost:3000` to see the app
```bash
$ git clone git@github.com:farhan-helmy/ratemysurau.git

# Copy & update .env base on pre-requisite above
$ cp .env.example .env

$ yarn

# DB Setup
$ yarn db:setup
$ yarn db:migrate
$ yarn db:seed

$ yarn dev
```

## Roadmap

Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"postinstall": "prisma generate",
"lint": "next lint",
"start": "next start",
"db:setup": "make",
"db:migrate": "dotenv -e .env -- prisma db push",
"db:seed": "cross-env NODE_ENV=development prisma db seed",
"db-seed": "cross-env NODE_ENV=development prisma db seed",
"db-seed:local": "NODE_ENV=development dotenv -e .env.local -- prisma db seed",
"update-district": "NODE_ENV=development tsx scripts/updateDistrict.ts",
Expand Down

0 comments on commit 5e60ca9

Please sign in to comment.