-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(docs): 📝 update the docs for development setup #19
- Loading branch information
Showing
7 changed files
with
108 additions
and
6 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
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,54 @@ | ||
## Development Instructions | ||
|
||
### Prerequisites | ||
|
||
- Node.js | ||
- Package Manager (pnpm or npm or yarn) | ||
- Git | ||
- Database (PostgreSQL, MySQL or You can use Supabase) | ||
- GitHub OAuth Credentials (Client ID and Client Secret) [Generate GitHub Secrets](./generate-github-secrets.md) | ||
|
||
### Setting up the project | ||
|
||
1. Go to the [GitHub Releases](https://github.com/mcnaveen/liny/) and Click on the `Fork` button. | ||
2. Clone the repository: | ||
|
||
```bash | ||
git clone https://github.com/YOUR_USERNAME/liny.git | ||
cd liny | ||
``` | ||
|
||
3. Install the dependencies: | ||
|
||
```bash | ||
pnpm install | ||
``` | ||
|
||
> Alternatively, you can use `npm` or `yarn` to install the dependencies. | ||
4. Copy the example environment file and configure it: | ||
|
||
```bash | ||
cp .env.example .env | ||
``` | ||
|
||
5. Open the `.env` file and fill in the required fields. You can leave the SMTP fields empty if not needed. | ||
|
||
| Required Fields | Description | | ||
| ---------------------- | ---------------------------------------------- | | ||
| `DATABASE_URL` | You can use local database or Supabase | | ||
| `NEXTAUTH_SECRET` | (You can use any random string for this) | | ||
| `NEXTAUTH_URL` | (You can use `http://localhost:3000` for this) | | ||
| `NEXT_PUBLIC_APP_URL` | (You can use `http://localhost:3000` for this) | | ||
| `GITHUB_CLIENT_ID` | Required to use GitHub OAuth | | ||
| `GITHUB_CLIENT_SECRET` | Required to use GitHub OAuth | | ||
|
||
> (If you're using Supabase, please refer to the [Supabase Setup Guide](./use-supabase.md) and come back. Otherwise, you can use any other database supported by Prisma [MySQL, PostgreSQL, etc.].) | ||
> Refer to [Generate a GitHub Secret](./generate-github-secrets.md) to generate the `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET`. | ||
6. If you're self-hosting, set `SELFHOSTED` to `true` in the `.env` file to block other users from creating projects in your instance. (Default is `true`) | ||
|
||
7. Run `npx prisma db push` to create the tables. | ||
|
||
8. Run `pnpm run dev` to start the development server. |
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,16 @@ | ||
## Generate GitHub Secrets | ||
|
||
1. Go to the [GitHub -> Settings -> Developer settings -> OAuth Apps](https://github.com/settings/developers) | ||
2. Click on "New OAuth App" | ||
3. Fill in the required fields: | ||
- Application name: "Liny" | ||
- Homepage URL: "http://localhost:3000" | ||
- Authorization callback URL: "http://localhost:3000/api/auth/callback/github" | ||
4. Click on "Register application" | ||
5. Copy the "Client ID" | ||
|
||
6. Click on "Generate a new client secret" | ||
7. Copy the "Client Secret" | ||
|
||
- If you're using a different port, make sure to update the callback URL. | ||
- If you're running the app in production, make sure to update the homepage URL and callback URL to `https://YOURDOMAIN.com/api/auth/callback/github` |
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,24 @@ | ||
## Guide to using Supabase as your database | ||
|
||
### Setting up Supabase | ||
|
||
1. Go to [Supabase](https://supabase.com/) and sign up for an account. | ||
2. If you're prompted to choose an organization, select the default organization. | ||
3. Now, Click on the "New Project" button. | ||
4. Enter the project details: | ||
- Project Name: "Liny" | ||
- Database Password: SOMETHINGSECURE (replace with a secure password) | ||
- Region: "us-east-1" (or closest to you) | ||
5. Click on the "Create Project" button. | ||
6. Once the project is created, you will be redirected to the project dashboard. | ||
7. Click on the green color "Connect" button. | ||
8. A modal will appear. Click on the "Connection String" tab. | ||
9. Copy the connection string. | ||
10. Open the `.env` file and paste the connection string into the `DATABASE_URL` variable. | ||
11. Replace the port `6543` with `5432`. | ||
12. Password is the one you chose in step 4. | ||
13. Now run `npx prisma db push` to create the tables. | ||
|
||
--- | ||
|
||
That's it! You've successfully set up Supabase as your database. |