Skip to content

Commit

Permalink
Chore/added sample env (#768)
Browse files Browse the repository at this point in the history
* chore: added an example .env file and linked to it from README
  • Loading branch information
JohnAllenTech authored Feb 25, 2024
1 parent fa2c72d commit ae9491b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,39 @@ We have a fantastic community growing on Discord. Click [here](https://discord.g
2. Clone with `git clone https://github.com/YOUR_USERNAME/codu.git`.
3. Navigate to the project directory `cd codu`.
4. Install dependencies with:

```bash
npm install
```
- If you have any issues installing dependencies, check your node version against that defined in the `.nvmrc`. If you're using `nvm`, you can run `nvm use` before installing dependencies.

- If you have any issues installing dependencies, check your node version against that defined in the `.nvmrc`. If you're using `nvm`, you can run `nvm use` before installing dependencies.

5. Create a `.env` file and add the following variables. You can copy the contents of `.env.example` with `cat .env.example > .env`.
```
# This default value is if you run our local docker-compose.yml file to create the database.
DATABASE_URL=postgresql://postgres:[email protected]:5432/postgres
# Setup your GitHub ID & Secret on GitHub: https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps
# For development, make sure you set up this with a Homepage URL of http://localhost:3000/ and an Authorization callback URL of http://localhost:3000/api/auth
GITHUB_ID=YOUR_GITHUB_APP_ID
GITHUB_SECRET=YOUR_GITHUB_APP_SECRET
NEXTAUTH_URL=http://localhost:3000/api/auth
```

For a more detailed how to guide on setting them up [go to the Environment Variables section](#environment-variables).

```
# This default value is if you run our local docker-compose.yml file to create the database.
DATABASE_URL=postgresql://postgres:[email protected]:5432/postgres
# Setup your GitHub ID & Secret on GitHub: https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps
# For development, make sure you set up this with a Homepage URL of http://localhost:3000/ and an Authorization callback URL of http://localhost:3000/api/auth
GITHUB_ID=YOUR_GITHUB_APP_ID
GITHUB_SECRET=YOUR_GITHUB_APP_SECRET
NEXTAUTH_URL=http://localhost:3000/api/auth
```

For a more detailed how to guide on setting them up [go to the Environment Variables section](#environment-variables).

6. [Make sure your database is running](#database_url) and setup the tables in the database with Prisma by running:

```bash
npx prisma db push
```

7. Seed the database with some mock data by running:

```bash
npx prisma db seed
```

8. Finally, run the development server:

```bash
Expand Down Expand Up @@ -105,11 +113,11 @@ NEXTAUTH_URL=http://localhost:3000/api/auth
```

For more information, you can read the documentation [here](https://next-auth.js.org/configuration/options).
**Example .env file can be found [here](./sample.env). You can rename this to .env to get started**

## 👨‍💻 Contribution Guidelines

- Contributions are **greatly appreciated**. Contributions make the open-source community an amazing place to learn, inspire, and create.

- Check out our [contribution guidelines](/CONTRIBUTING.md) for contributiong to our repo. It includes
- How to Contribute
- How to create a Pull Request
Expand Down
4 changes: 4 additions & 0 deletions sample.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
GITHUB_ID= ### Replace with GitHub OAuth ID (https://github.com/settings/applications/new)
GITHUB_SECRET= ### Replace with GitHub OAuth Secret (https://github.com/settings/applications/new)
NEXTAUTH_URL=http://localhost:3000/api/auth
DATABASE_URL=postgresql://postgres:[email protected]:5432/postgres

0 comments on commit ae9491b

Please sign in to comment.