Skip to content

Commit d07c675

Browse files
authored
Merge branch 'main' into updated-getting-started
2 parents 1063f96 + 0ad8a42 commit d07c675

File tree

9 files changed

+124
-112
lines changed

9 files changed

+124
-112
lines changed

.env.example

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
DATABASE_HOST = "localhost"
2-
DATABASE_NAME = "mydatabase"
3-
DATABASE_PORT = "5432"
4-
DATABASE_USERNAME = "myuser"
5-
DATABASE_PASSWORD = "mypassword"
6-
DATABASE_URL = "postgresql://USERNAME:PASSWORD@HOST:PORT/NAME?schema=public"
1+
DATABASE_URL="postgresql://postgres:example@localhost:5432/postgres"

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ yarn-error.log*
2626

2727
# local env files
2828
.env*.local
29+
.env
2930

3031
# vercel
3132
.vercel

README.md

+66-56
Original file line numberDiff line numberDiff line change
@@ -16,78 +16,88 @@ Code Racer is a multiplayer coding game where developers can compete against eac
1616
- Tailwind CSS: A utility-first CSS framework for rapid UI development.
1717
- TypeScript: A typed superset of JavaScript that provides enhanced tooling and developer productivity.
1818

19-
## Getting Started
20-
21-
To get started with Code Racer locally, follow these steps:
22-
23-
Clone the repository:
24-
25-
```bash
26-
git clone https://github.com/webdevcody/code-racer.git
27-
```
19+
## Contribution
2820

29-
Navigate to the project directory:
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:
3022

31-
```bash
32-
cd code-racer
33-
```
23+
- Fork the repository.
24+
- Create a new branch for your feature or bug fix.
25+
- Make your changes and test thoroughly.
26+
- Commit your changes with clear commit messages.
27+
- Push your branch to your forked repository.
28+
Submit a pull request detailing your changes.
3429

35-
Install dependencies:
30+
Please ensure that your code adheres to the project's coding standards and conventions.
3631

37-
```bash
38-
npm install
39-
```
40-
Create a .env file inside the project's root directory.
32+
## Getting Started
4133

42-
Copy and paste the content of .env.example into your .env file
34+
### Prerequisites
4335

44-
Update DATABASE_URL inside your .env from "postgresql://USERNAME:PASSWORD@HOST:PORT/NAME?schema=public" to "postgresql://myuser:mypassword@localhost:5432/mydatabase?schema=public" for example or with whichever username, password, host, port, and name you chose.
36+
You will need to [install docker](https://www.docker.com/get-started/) on your local machine.
4537

4638
If you do not have docker, go here to download and install: https://www.docker.com/get-started/
4739

48-
If you are getting WSL error when you launch your desktop docker application, go here and follow these steps: https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package.
49-
50-
Open Docker Desktop Application and go back to your VSCode terminal and run this command:
51-
52-
```bash
53-
docker compose up -d
54-
```
55-
56-
Generate prisma DB:
57-
58-
```bash
59-
npx prisma generate
60-
```
61-
62-
Updates schema to database
63-
```bash
64-
npx prisma db push
65-
```
66-
67-
Start the development server:
68-
69-
```bash
70-
npm run dev
71-
```
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+
```
7278

7379
Open your browser and visit http://localhost:3000 to see the application running.
7480

75-
## Configuration
81+
## How to Contribute
7682

77-
Code Racer requires some configuration variables to run properly. Create a .env.local file in the root directory of the project and add the following variables:
83+
### Working on New Features
7884

79-
## Contribution
85+
If you want to work on a new feature, follow these steps.
8086

81-
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:
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
8294

83-
- Fork the repository.
84-
- Create a new branch for your feature or bug fix.
85-
- Make your changes and test thoroughly.
86-
- Commit your changes with clear commit messages.
87-
- Push your branch to your forked repository.
88-
Submit a pull request detailing your changes.
95+
### Pulling in changes from upstream
8996

90-
Please ensure that your code adheres to the project's coding standards and conventions.
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
91101

92102
## License
93103

@@ -100,6 +110,6 @@ A big thank you to all the developers who have helped shape Code Racer into what
100110
101111
## Contact
102112
103-
If you have any questions, suggestions, or feedback regarding Code Racer, please feel free to reach out to us at in the WebDevCody discord server
113+
If you have any questions, suggestions, or feedback regarding Code Racer, please feel free to reach out to us at in the WebDevCody [discord](https://discord.gg/4kGbBaa) server
104114
105115
Happy coding and enjoy the race!

docker-compose.yaml

-19
This file was deleted.

docker-compose.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: "3.9"
2+
services:
3+
bg-db:
4+
image: postgres
5+
restart: always
6+
container_name: code-racer-postgres
7+
ports:
8+
- 5432:5432
9+
environment:
10+
POSTGRES_PASSWORD: example
11+
PGDATA: /data/postgres
12+
volumes:
13+
- postgres:/data/postgres
14+
15+
volumes:
16+
postgres:

package-lock.json

+11-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/dashboard/page.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from "react";
2+
3+
export default function DashboardPage() {
4+
return (
5+
<div>
6+
<div>Coming soon...</div>
7+
</div>
8+
);
9+
}

src/app/layout.tsx

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import './globals.css'
2-
import type { Metadata } from 'next'
3-
import { Inter } from 'next/font/google'
1+
import "./globals.css";
2+
import type { Metadata } from "next";
3+
import { Inter } from "next/font/google";
44

5-
const inter = Inter({ subsets: ['latin'] })
5+
const inter = Inter({ subsets: ["latin"] });
66

77
export const metadata: Metadata = {
8-
title: 'Create Next App',
9-
description: 'Generated by create next app',
10-
}
8+
title: "Code Racer",
9+
description: "Accelerating coding skills, competitive thrills!",
10+
};
1111

1212
export default function RootLayout({
1313
children,
1414
}: {
15-
children: React.ReactNode
15+
children: React.ReactNode;
1616
}) {
1717
return (
1818
<html lang="en">
1919
<body className={inter.className}>{children}</body>
2020
</html>
21-
)
21+
);
2222
}

src/components/ui/button.tsx

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import * as React from "react"
2-
import { Slot } from "@radix-ui/react-slot"
3-
import { cva, type VariantProps } from "class-variance-authority"
1+
import * as React from "react";
2+
import { Slot } from "@radix-ui/react-slot";
3+
import { cva, type VariantProps } from "class-variance-authority";
44

5-
import { cn } from "@/lib/utils"
5+
import { cn } from "@/lib/utils";
66

77
const buttonVariants = cva(
88
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
@@ -31,26 +31,26 @@ const buttonVariants = cva(
3131
size: "default",
3232
},
3333
}
34-
)
34+
);
3535

3636
export interface ButtonProps
3737
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
3838
VariantProps<typeof buttonVariants> {
39-
asChild?: boolean
39+
asChild?: boolean;
4040
}
4141

4242
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
4343
({ className, variant, size, asChild = false, ...props }, ref) => {
44-
const Comp = asChild ? Slot : "button"
44+
const Comp = asChild ? Slot : "button";
4545
return (
4646
<Comp
4747
className={cn(buttonVariants({ variant, size, className }))}
4848
ref={ref}
4949
{...props}
5050
/>
51-
)
51+
);
5252
}
53-
)
54-
Button.displayName = "Button"
53+
);
54+
Button.displayName = "Button";
5555

56-
export { Button, buttonVariants }
56+
export { Button, buttonVariants };

0 commit comments

Comments
 (0)