https://github.com/tomek-i/whispers-in-the-dark
https://github.com/tomek-i/whispers-in-the-dark
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tomek-i/whispers-in-the-dark
- Owner: tomek-i
- License: mit
- Created: 2024-01-25T12:16:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-15T16:33:00.000Z (over 1 year ago)
- Last Synced: 2025-01-12T07:46:42.222Z (5 months ago)
- Language: TypeScript
- Homepage: https://whispers-in-the-dark.vercel.app
- Size: 42.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Whispers in the Dark

Welcome to the _Whispers in the Dark_, an open-source game.
## Table of Contents
- [Whispers in the Dark](#whispers-in-the-dark)
- [Table of Contents](#table-of-contents)
- [๐ฏ Getting Started](#๐ฏ-getting-started)
- [Environment variables](#environment-variables)
- [๏ฟฝ Scripts Overview](#๐-scripts-overview)
- [๐ Coupling Graph](#๐-coupling-graph)
- [๐งช Testing](./wiki/testing.md#๐งช-testing)
- [Running Tests](./wiki/testing.md#running-tests)
- [Acceptance Tests](./wiki/testing.md#acceptance-tests)
- [Smoke Testing](./wiki/testing.md#smoke-testing)
- [๐จ Styling and Design System](./wiki/styling-and-design.md#๐จ-styling-and-design-system)
- [CVA - A New Approach to Variants](./wiki/styling-and-design.md#cva---a-new-approach-to-variants)
- [๐ค ChatGPT Code Review](#๐ค-chatgpt-code-review)
- [๐ป Environment Variables handling](#๐ป-environment-variables-handling)
- [๐ค Contribution](#๐ค-contribution)
- [Support](#support)
- [๐ License](#๐-license)
- [Contributors](#contributors)## ๐ฏ Getting Started
To get started with, follow these steps:
1. Fork & clone repository:
```bash
## Don't forget to โญ star and fork it first :)
git clone https://github.com/tomek-i/whispers-in-the-dark.git
```2. Install the dependencies:
```bash
yarn install --frozen-lockfile
```3. Run the development server:
```bash
yarn dev
```4. Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
5. This project uses a git hook to enforce [conventional commits](https://github.com/qoomon/git-conventional-commits). To install the git hook, run the following command in the root directory of the project:
```sh
brew install pre-commit
pre-commit install -t commit-msg
```## Environment variables
```js
NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_APP_ID=
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=
NEXT_PUBLIC_FIREBASE_DATABASE_URL=
```## ๐ Scripts Overview
The following scripts are available in the `package.json`:
- `dev`: Starts the development server with colorized output
- `build`: Builds the app for production
- `start`: Starts the production server
- `lint`: Lints the code using ESLint
- `lint:fix`: Automatically fixes linting errors
- `prettier`: Checks the code for proper formatting
- `prettier:fix`: Automatically fixes formatting issues
- `analyze`: Analyzes the bundle sizes for Client, Server and Edge environments
- `storybook`: Starts the Storybook server
- `build-storybook`: Builds the Storybook for deployment
- `test`: Runs unit and integration tests
- `e2e:headless`: Runs end-to-end tests in headless mode
- `e2e:ui`: Runs end-to-end tests with UI
- `format`: Formats the code with Prettier
- `plop`: Runs plop to assist generating new files
- `postinstall`: Applies patches to external dependencies
- `preinstall`: Ensures the project is installed with Yarn
- `coupling-graph`: **Generates a coupling and cohesion graph for the components**## ๐ Coupling Graph
The `coupling-graph` script is a useful tool that helps visualize the coupling and connections between your project's internal modules. It's built using the [Madge](https://github.com/pahen/madge) library. To generate the graph, simply run the following command:
```bash
yarn coupling-graph
```This will create a `graph.svg` file, which contains a graphical representation of the connections between your components. You can open the file with any SVG-compatible viewer.

## ๐ค ChatGPT Code Review
We've integrated the innovative [ChatGPT Code Review](https://github.com/anc95/ChatGPT-CodeReview) for AI-powered, automated code reviews. This feature provides real-time feedback on your code, helping improve code quality and catch potential issues.
To use ChatGPT Code Review, add an `OPENAI_API_KEY` environment variable with an appropriate key from the OpenAI platform. For setup details, refer to the [Using GitHub Actions](https://github.com/anc95/ChatGPT-CodeReview#using-github-actions) section in the documentation.
## ๐ป Environment Variables handling
[T3 Env](https://env.t3.gg/) is a library that provides environmental variables checking at build time, type validation and transforming. It ensures that your application is using the correct environment variables and their values are of the expected type. Youโll never again struggle with runtime errors caused by incorrect environment variable usage.
Config file is located at `env.mjs`. Simply set your client and server variables and import `env` from any file in your project.
```ts
export const env = createEnv({
server: {
// Server variables
SECRET_KEY: z.string(),
},
client: {
// Client variables
API_URL: z.string().url(),
},
runtimeEnv: {
// Assign runtime variables
SECRET_KEY: process.env.SECRET_KEY,
API_URL: process.env.NEXT_PUBLIC_API_URL,
},
})
```If the required environment variables are not set, you'll get an error message:
```sh
โ Invalid environment variables: { SECRET_KEY: [ 'Required' ] }
```## ๐ค Contribution
Contributions are always welcome! To contribute, please follow these steps:
1. Fork the repository.
2. Create a new branch with a descriptive name.
3. Make your changes, and commit them using the [Conventional Commits](https://www.conventionalcommits.org/) format.
4. Push your changes to the forked repository.
5. Create a pull request, and we'll review your changes.## Support
If you're looking for help or simply want to share your thoughts about the project, we encourage you to join.
## ๐ License
This project is licensed under the MIT License. For more information, see the [LICENSE](./LICENSE) file.
## Contributors