Skip to content

Commit eebafc3

Browse files
committed
2 parents 88df5bb + c470611 commit eebafc3

File tree

20 files changed

+957
-148
lines changed

20 files changed

+957
-148
lines changed

.env.example

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
DATABASE_URL="postgresql://postgres:example@localhost:5432/postgres"
1+
DATABASE_URL="postgresql://postgres:example@localhost:5432/postgres"
2+
3+
# Next Auth Discord Provider
4+
# NOTE: The keys below where intentionally committed
5+
# so that beginners don't have to setup their own github app
6+
# just to contribute to this project. This app will only be
7+
# used for local development; it's not used in production.
8+
GITHUB_CLIENT_ID="63b03dd1a029181eede8"
9+
GITHUB_CLIENT_SECRET="fe61fec0056b571d01d0a1e25945904237d164e8"
10+
11+
NEXTAUTH_SECRET="my_ultra_secure_nextauth_secret"
12+
NEXTAUTH_URL="http://localhost:3000"

.eslintrc.json

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
11
{
2-
"extends": "next/core-web-vitals"
2+
"extends": [
3+
"next/core-web-vitals",
4+
"plugin:@typescript-eslint/recommended",
5+
"plugin:jsx-a11y/recommended"
6+
],
7+
"parser": "@typescript-eslint/parser",
8+
"parserOptions": {
9+
"project": "./tsconfig.json"
10+
},
11+
12+
"rules": {
13+
"react/jsx-props-no-spreading": "off",
14+
"quotes": ["error", "double", { "allowTemplateLiterals": true }],
15+
"react/react-in-jsx-scope": "off",
16+
"jsx-a11y/anchor-is-valid": "off",
17+
"no-unused-vars": "warn",
18+
"@typescript-eslint/no-empty-interface": "warn",
19+
20+
"import/extensions": 0,
21+
"import/no-extraneous-dependencies": 0,
22+
"import/prefer-default-export": 0,
23+
"import/order": [
24+
2,
25+
{
26+
"groups": [
27+
"builtin",
28+
"external",
29+
"internal",
30+
"parent",
31+
"sibling",
32+
"index"
33+
],
34+
"newlines-between": "always",
35+
"pathGroups": [
36+
{
37+
"pattern": "@/**",
38+
"group": "internal"
39+
}
40+
],
41+
"alphabetize": {
42+
"order": "asc"
43+
}
44+
}
45+
]
46+
}
347
}

CONTRIBUTING.md

Lines changed: 83 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,95 @@
11
# Contributing
22

3-
When contributing to this repository, please first discuss the change you wish to make via [issues](https://github.com/webdevcody/code-racer/issues), [discord](https://discord.gg/4kGbBaa).
3+
When contributing to this repository, please first discuss the change you wish to make via [issues](https://github.com/webdevcody/code-racer/issues), [discord](https://discord.gg/4kGbBaa).
44

55
Please note if you are working on a certain issue then make sure to stay active with development.
66

7-
## Contribution Process
7+
## Git Commit, Branch, and PR Naming Conventions
88

9-
1. Get started with these [instructions](https://github.com/webdevcody/code-racer#installation) to get code on your local machine.
10-
2. Check open issues or start an issue to work within.
11-
*Note: when starting an issue, first check if there is already same issue exists and then discuss on discord server.*
9+
When you are working with git, please be sure to follow the conventions below on your pull requests, branches, and commits:
1210

13-
4. Checkout a new branch
14-
5. Do your work. Save changes and commit.
15-
6. Push your branch to your fork.
11+
```
12+
PR: [#ISSUE ID] Title of the PR
13+
Branch: [ISSUE ID]-title-of-the-pr (shorter)
14+
Commit: [[ISSUE ID]] [ACTION]: what was done
15+
```
16+
17+
Examples:
18+
19+
```
20+
PR: #2 Add Docker container for Postgres
21+
Branch: 2-add-container-postgres
22+
Commit: [2] feat: add docker container for postgres
23+
```
24+
25+
## Prerequisites
26+
27+
You will need to [install docker](https://www.docker.com/get-started/) on your local machine.
28+
29+
If you do not have docker, go here to download and install: https://www.docker.com/get-started/
30+
31+
If you are getting WSL error when you launch your desktop docker application, go here and follow these steps for windows: https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package.
32+
33+
## Installation
34+
35+
To get started with Code Racer locally, follow these steps
36+
37+
1. Fork my repo and clone your fork
38+
```sh
39+
git clone https://github.com/webdevcody/code-racer.git
40+
```
41+
2. Navigate to the project directory
42+
```sh
43+
cd code-racer
44+
```
45+
3. Install NPM packages
46+
```sh
47+
npm i
48+
```
49+
4. Generate a version of Prisma Client that is tailored to the models.
50+
```js
51+
npx prisma generate
52+
```
53+
5. Create a .env file inside the project's root directory.
54+
55+
6. Copy and paste variables from `.env.example` into `.env`
56+
57+
7. Open Docker Desktop Application and go back to your VSCode terminal and run this command:
58+
```sh
59+
docker compose up -d
60+
```
61+
8. Once your database is ready, push your prisma schema to the database.
62+
```sh
63+
npx prisma db push
64+
```
65+
9. Finally start your dev server.
66+
```sh
67+
npm run dev
68+
```
69+
70+
Open your browser and visit http://localhost:3000 to see the application running.
71+
72+
## Working on New Features
73+
74+
If you're new to github and working with open source repositories, I made a video a while back which walks you through the process:
75+
[![How to make a pull request on an open source project](https://img.youtube.com/vi/8A4TsoXJOs8/0.jpg)](https://youtu.be/8A4TsoXJOs8)
76+
77+
If you want to work on a new feature, follow these steps.
78+
79+
1. Fork the repo
80+
2. Clone your fork
81+
3. Checkout a new branch
82+
4. Do your work
83+
5. Commit
84+
6. Push your branch to your fork
1685
7. Go into github UI and create a PR from your fork & branch, and merge it into upstream MAIN
1786

87+
## Pulling in changes from upstream
88+
89+
You should pull in the changes that we add in daily, preferably before you checkout a new branch to do new work.
90+
91+
1. git checkout main
92+
2. git pull upstream main
1893

1994
## Code of Conduct
2095

@@ -40,4 +115,3 @@ representing a project or community include using an official project e-mail
40115
address, posting via an official social media account, or acting as an appointed
41116
representative at an online or offline event. Representation of a project may be
42117
further defined and clarified by project maintainers.
43-

README.md

Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Code Racer is a multiplayer coding game where developers can compete against eac
1818

1919
## Contribution
2020

21-
We welcome contributions from the community! If you'd like to contribute to Code Racer, please follow refer to [CONTRIBUTION.md](CONTRIBUTION.md), but we have these base guidelines:
21+
We welcome contributions from the community! If you'd like to contribute to Code Racer, please follow refer to [CONTRIBUTING.md](./CONTRIBUTING.md), but we have these base guidelines:
2222

2323
- Fork the repository.
2424
- Create a new branch for your feature or bug fix.
@@ -29,76 +29,6 @@ We welcome contributions from the community! If you'd like to contribute to Code
2929

3030
Please ensure that your code adheres to the project's coding standards and conventions.
3131

32-
## Getting Started
33-
34-
### Prerequisites
35-
36-
You will need to [install docker](https://www.docker.com/get-started/) on your local machine.
37-
38-
If you do not have docker, go here to download and install: https://www.docker.com/get-started/
39-
40-
If you are getting WSL error when you launch your desktop docker application, go here and follow these steps for windows: https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package.
41-
42-
### Installation
43-
44-
To get started with Code Racer locally, follow these steps
45-
46-
1. Fork my repo and clone your fork
47-
```sh
48-
git clone https://github.com/webdevcody/code-racer.git
49-
```
50-
2. Navigate to the project directory
51-
```sh
52-
cd code-racer
53-
```
54-
3. Install NPM packages
55-
```sh
56-
npm i
57-
```
58-
4. Generate a version of Prisma Client that is tailored to the models.
59-
```js
60-
npx prisma generate
61-
```
62-
5. Create a .env file inside the project's root directory.
63-
64-
6. Copy and paste variables from `.env.example` into `.env`
65-
66-
7. Open Docker Desktop Application and go back to your VSCode terminal and run this command:
67-
```sh
68-
docker compose up -d
69-
```
70-
8. Once your database is ready, push your prisma schema to the database.
71-
```sh
72-
npx prisma db push
73-
```
74-
9. Finally start your dev server.
75-
```sh
76-
npm run dev
77-
```
78-
79-
Open your browser and visit http://localhost:3000 to see the application running.
80-
81-
## How to Contribute
82-
83-
### Working on New Features
84-
85-
If you want to work on a new feature, follow these steps.
86-
87-
1. Fork the repo
88-
2. Clone your fork
89-
3. Checkout a new branch
90-
4. Do your work
91-
5. Commit
92-
6. Push your branch to your fork
93-
7. Go into github UI and create a PR from your fork & branch, and merge it into upstream MAIN
94-
95-
### Pulling in changes from upstream
96-
97-
You should pull in the changes that we add in daily, preferably before you checkout a new branch to do new work.
98-
99-
1. git checkout main
100-
2. git pull upstream main
101-
10232
## License
10333

10434
The Code Racer project is licensed under the MIT License. Feel free to use, modify, and distribute the code as per the terms of the license.

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: "3.9"
22
services:
3-
bg-db:
3+
code-racer-db:
44
image: postgres
55
restart: always
66
container_name: code-racer-postgres

next.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
/** @type {import('next').NextConfig} */
2-
const nextConfig = {}
2+
const nextConfig = {
3+
images: {
4+
domains: ["avatars.githubusercontent.com"],
5+
},
6+
};
37

4-
module.exports = nextConfig
8+
module.exports = nextConfig;

0 commit comments

Comments
 (0)