Skip to content

Commit

Permalink
feat: added ci and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ezhil56x committed Jun 30, 2024
1 parent 6be6745 commit 0244708
Show file tree
Hide file tree
Showing 29 changed files with 1,125 additions and 759 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint check
on:
pull_request:
branches:
- '**'

jobs:
lint-check:
name: Lint check
runs-on: ubuntu-latest

steps:
- name: Checkout the Repository
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2

with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Lint check
run: yarn lint
39 changes: 39 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Contributing

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).

## Why these guidelines ?

Our goal is to create a healthy and inclusive space for contributions. Remember that open-source contribution is a collaborative effort, not a competition.

## General guidelines

- Work only on one issue at a time since it will provide an opportunity for others to contribute as well.

- Note that each open-source repository generally has its own guidelines, similar to these. Always read them before starting your contributions.

## How to get an issue assigned

- To get an issue assigned, provide a small description as to how you are planning to tackle this issue.

> 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)
- This will allow multiple contributors to discuss their approach to tackle the issue. The maintainer will then assign the issue.

## After getting the issue assigned

- Create your own branch instead of working directly on the main branch.

- Provide feedback every 24-48 hours if an issue is assigned to you. Otherwise, it may be reassigned.

- When submitting a pull request, please provide a screenshot or a screen-recording showcasing your work.

## Don't while contributing

- Avoid comments like "Please assign this issue to me" or "can i work on this issue ?"

- Refrain from tagging the maintainer to assign issues or review pull requests.

- Don't make any pull request for issues you are not assigned to. It will be closed without merging.

Happy Contributing!
75 changes: 60 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,64 @@ Let's keep it simple

## Setting it up locally

- Clone the repo
- Copy over .env.example over to .env everywhere
- Update .env
- Postgres DB Credentials
- Github/Google Auth credentials
- npm install
- Start ws server
- cd apps/ws
- npm run dev
- Start Backend
- cd apps/backend
- npm run dev
- Start frontend
- cd apps/frontend
- npm run dev
1. Fork and clone the repo

```bash
git clone https://github.com/your-username/chess.git
```

2. Copy over .env.example over to .env everywhere

```bash
cp apps/backend/.env.example apps/backend/.env && cp apps/frontend/.env.example apps/frontend/.env
```

3. Update .env

- Postgres DB Credentials
- Github/Google Auth credentials

4. Install dependencies

```bash
npm install
```

5. Start ws server

```bash
cd apps/ws
npm run dev
```

6. Start Backend

```bash
cd apps/backend
npm run dev
```

7. Start frontend

```bash
cd apps/frontend
npm run dev
```

## Contributing

We welcome contributions from the community! To contribute to chess, follow these steps:

1. Fork the repository.
2. Create a new branch (`git checkout -b feature/fooBar`).
3. Make your changes and commit them (`git commit -am 'Add some fooBar'`).
> Make sure to lint and format your code before commiting
>
> - `npm run lint` to check for lint errors
> - `npm run format` to fix lint errors
4. Push to the branch (`git push origin feature/fooBar`).
5. Create a new Pull Request.

For major changes, please open an issue first to discuss what you would like to change.

Read our [contribution guidelines](./CONTRIBUTING.md) for more details.
37 changes: 23 additions & 14 deletions apps/frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "./App.css";
import "./themes.css";
import './App.css';
import './themes.css';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import { Landing } from './screens/Landing';
import { Game } from './screens/Game';
Expand All @@ -9,8 +9,8 @@ import { RecoilRoot } from 'recoil';
import { Loader } from './components/Loader';
import { Layout } from './layout';
import { Settings } from './screens/Settings';
import { Themes } from "./components/themes";
import { ThemesProvider } from "./context/themeContext";
import { Themes } from './components/themes';
import { ThemesProvider } from './context/themeContext';

function App() {
return (
Expand All @@ -30,21 +30,30 @@ function AuthApp() {
return (
<BrowserRouter>
<Routes>
<Route
path="/"
element={<Layout><Landing /></Layout>}
/>
<Route
path="/login"
element={<Login />}
path="/"
element={
<Layout>
<Landing />
</Layout>
}
/>
<Route path="/login" element={<Login />} />
<Route
path="/game/:gameId"
element={<Layout><Game /></Layout>}
element={
<Layout>
<Game />
</Layout>
}
/>
<Route
path='/settings'
element={<Layout><Settings /></Layout>}
<Route
path="/settings"
element={
<Layout>
<Settings />
</Layout>
}
>
<Route path="themes" element={<Themes />} />
</Route>
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/src/components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function PlayCard() {
<Card className="bg-transparent border-none">
<CardHeader className="pb-3 text-center">
<CardTitle className="font-semibold tracking-wide flex flex-col items-center justify-center">
<p className='text-white'>
<p className="text-white">
Play <span className="text-green-600 font-bold pt-1">Chess</span>
</p>
<img className="pl-1 w-1/2 mt-4" src={chessIcon} alt="chess" />
Expand Down
Loading

0 comments on commit 0244708

Please sign in to comment.