Skip to content

Commit 0244708

Browse files
committed
feat: added ci and docs
1 parent 6be6745 commit 0244708

29 files changed

+1125
-759
lines changed

.github/workflows/lint.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Lint check
2+
on:
3+
pull_request:
4+
branches:
5+
- '**'
6+
7+
jobs:
8+
lint-check:
9+
name: Lint check
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout the Repository
14+
uses: actions/checkout@v4
15+
16+
- name: Cache dependencies
17+
uses: actions/cache@v2
18+
19+
with:
20+
path: ~/.cache/yarn
21+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
22+
restore-keys: |
23+
${{ runner.os }}-yarn
24+
25+
- name: Install dependencies
26+
run: yarn install --frozen-lockfile
27+
28+
- name: Lint check
29+
run: yarn lint

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Contributing
2+
3+
Thank you for your interest in contributing to this repository. To ensure a smooth and collaborative environment, please follow these guidelines. Before contributing, set up the project locally using the steps outlined in [README.md](./README.md).
4+
5+
## Why these guidelines ?
6+
7+
Our goal is to create a healthy and inclusive space for contributions. Remember that open-source contribution is a collaborative effort, not a competition.
8+
9+
## General guidelines
10+
11+
- Work only on one issue at a time since it will provide an opportunity for others to contribute as well.
12+
13+
- Note that each open-source repository generally has its own guidelines, similar to these. Always read them before starting your contributions.
14+
15+
## How to get an issue assigned
16+
17+
- To get an issue assigned, provide a small description as to how you are planning to tackle this issue.
18+
19+
> Ex - If the issue is about UI changes, you should create a design showing how you want it to look on the UI (make it using figma, paint, etc)
20+
21+
- This will allow multiple contributors to discuss their approach to tackle the issue. The maintainer will then assign the issue.
22+
23+
## After getting the issue assigned
24+
25+
- Create your own branch instead of working directly on the main branch.
26+
27+
- Provide feedback every 24-48 hours if an issue is assigned to you. Otherwise, it may be reassigned.
28+
29+
- When submitting a pull request, please provide a screenshot or a screen-recording showcasing your work.
30+
31+
## Don't while contributing
32+
33+
- Avoid comments like "Please assign this issue to me" or "can i work on this issue ?"
34+
35+
- Refrain from tagging the maintainer to assign issues or review pull requests.
36+
37+
- Don't make any pull request for issues you are not assigned to. It will be closed without merging.
38+
39+
Happy Contributing!

README.md

Lines changed: 60 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,64 @@ Let's keep it simple
1919

2020
## Setting it up locally
2121

22-
- Clone the repo
23-
- Copy over .env.example over to .env everywhere
24-
- Update .env
25-
- Postgres DB Credentials
26-
- Github/Google Auth credentials
27-
- npm install
28-
- Start ws server
29-
- cd apps/ws
30-
- npm run dev
31-
- Start Backend
32-
- cd apps/backend
33-
- npm run dev
34-
- Start frontend
35-
- cd apps/frontend
36-
- npm run dev
22+
1. Fork and clone the repo
3723

24+
```bash
25+
git clone https://github.com/your-username/chess.git
26+
```
27+
28+
2. Copy over .env.example over to .env everywhere
29+
30+
```bash
31+
cp apps/backend/.env.example apps/backend/.env && cp apps/frontend/.env.example apps/frontend/.env
32+
```
33+
34+
3. Update .env
35+
36+
- Postgres DB Credentials
37+
- Github/Google Auth credentials
38+
39+
4. Install dependencies
40+
41+
```bash
42+
npm install
43+
```
44+
45+
5. Start ws server
46+
47+
```bash
48+
cd apps/ws
49+
npm run dev
50+
```
51+
52+
6. Start Backend
53+
54+
```bash
55+
cd apps/backend
56+
npm run dev
57+
```
58+
59+
7. Start frontend
60+
61+
```bash
62+
cd apps/frontend
63+
npm run dev
64+
```
65+
66+
## Contributing
67+
68+
We welcome contributions from the community! To contribute to chess, follow these steps:
69+
70+
1. Fork the repository.
71+
2. Create a new branch (`git checkout -b feature/fooBar`).
72+
3. Make your changes and commit them (`git commit -am 'Add some fooBar'`).
73+
> Make sure to lint and format your code before commiting
74+
>
75+
> - `npm run lint` to check for lint errors
76+
> - `npm run format` to fix lint errors
77+
4. Push to the branch (`git push origin feature/fooBar`).
78+
5. Create a new Pull Request.
79+
80+
For major changes, please open an issue first to discuss what you would like to change.
81+
82+
Read our [contribution guidelines](./CONTRIBUTING.md) for more details.

apps/frontend/src/App.tsx

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import "./App.css";
2-
import "./themes.css";
1+
import './App.css';
2+
import './themes.css';
33
import { BrowserRouter, Route, Routes } from 'react-router-dom';
44
import { Landing } from './screens/Landing';
55
import { Game } from './screens/Game';
@@ -9,8 +9,8 @@ import { RecoilRoot } from 'recoil';
99
import { Loader } from './components/Loader';
1010
import { Layout } from './layout';
1111
import { Settings } from './screens/Settings';
12-
import { Themes } from "./components/themes";
13-
import { ThemesProvider } from "./context/themeContext";
12+
import { Themes } from './components/themes';
13+
import { ThemesProvider } from './context/themeContext';
1414

1515
function App() {
1616
return (
@@ -30,21 +30,30 @@ function AuthApp() {
3030
return (
3131
<BrowserRouter>
3232
<Routes>
33-
<Route
34-
path="/"
35-
element={<Layout><Landing /></Layout>}
36-
/>
3733
<Route
38-
path="/login"
39-
element={<Login />}
34+
path="/"
35+
element={
36+
<Layout>
37+
<Landing />
38+
</Layout>
39+
}
4040
/>
41+
<Route path="/login" element={<Login />} />
4142
<Route
4243
path="/game/:gameId"
43-
element={<Layout><Game /></Layout>}
44+
element={
45+
<Layout>
46+
<Game />
47+
</Layout>
48+
}
4449
/>
45-
<Route
46-
path='/settings'
47-
element={<Layout><Settings /></Layout>}
50+
<Route
51+
path="/settings"
52+
element={
53+
<Layout>
54+
<Settings />
55+
</Layout>
56+
}
4857
>
4958
<Route path="themes" element={<Themes />} />
5059
</Route>

apps/frontend/src/components/Card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export function PlayCard() {
8686
<Card className="bg-transparent border-none">
8787
<CardHeader className="pb-3 text-center">
8888
<CardTitle className="font-semibold tracking-wide flex flex-col items-center justify-center">
89-
<p className='text-white'>
89+
<p className="text-white">
9090
Play <span className="text-green-600 font-bold pt-1">Chess</span>
9191
</p>
9292
<img className="pl-1 w-1/2 mt-4" src={chessIcon} alt="chess" />

0 commit comments

Comments
 (0)