|
| 1 | +# Contributing to SoulSpace |
| 2 | + |
| 3 | +First off, thanks for taking the time to contribute! |
| 4 | + |
| 5 | +The following is a set of guidelines for contributing to SoulSpace. These are just guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. |
| 6 | + |
| 7 | +## Table of Contents |
| 8 | + |
| 9 | +- [Code of Conduct](#code-of-conduct) |
| 10 | +- [Getting Started](#getting-started) |
| 11 | + - [Prerequisites](#prerequisites) |
| 12 | + - [Installation](#installation) |
| 13 | +- [Development Workflow](#development-workflow) |
| 14 | + - [Backend Development](#backend-development) |
| 15 | + - [Frontend Development](#frontend-development) |
| 16 | +- [Pull Request Process](#pull-request-process) |
| 17 | +- [Coding Standards](#coding-standards) |
| 18 | + |
| 19 | +## Code of Conduct |
| 20 | + |
| 21 | +This project and everyone participating in it is governed by the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/1/4/code-of-conduct). By participating, you are expected to uphold this code. |
| 22 | + |
| 23 | +## Getting Started |
| 24 | + |
| 25 | +### Prerequisites |
| 26 | + |
| 27 | +You need to have the following installed on your machine: |
| 28 | + |
| 29 | +- [Node.js](https://nodejs.org/) (v18+) |
| 30 | +- [PostgreSQL](https://www.postgresql.org/) |
| 31 | + |
| 32 | +### Installation |
| 33 | + |
| 34 | +1. **Fork the repository** on GitHub. |
| 35 | +2. **Clone your fork** locally: |
| 36 | + |
| 37 | + ```bash |
| 38 | + git clone https://github.com/your-username/soulspace.git |
| 39 | + cd soulspace |
| 40 | + ``` |
| 41 | + |
| 42 | +3. **Setup the Database**: |
| 43 | + Ensure your PostgreSQL server is running and you have a database created. |
| 44 | + |
| 45 | +4. **Install Dependencies**: |
| 46 | + |
| 47 | + * **Backend**: |
| 48 | + ```bash |
| 49 | + cd backend |
| 50 | + npm install |
| 51 | + ``` |
| 52 | + * **Frontend**: |
| 53 | + ```bash |
| 54 | + cd frontend |
| 55 | + npm install |
| 56 | + ``` |
| 57 | + |
| 58 | +## Development Workflow |
| 59 | + |
| 60 | +This project is a monorepo containing both the frontend and backend. You usually need to run both simultaneously for full functionality. |
| 61 | + |
| 62 | +### Backend Development |
| 63 | + |
| 64 | +1. Navigate to the `backend` directory. |
| 65 | +2. Create a `.env` file based on the example in the README or ask a maintainer for the variables. |
| 66 | +3. Run migrations: |
| 67 | + ```bash |
| 68 | + npx prisma migrate dev |
| 69 | + ``` |
| 70 | +4. Start the development server: |
| 71 | + ```bash |
| 72 | + npm run dev |
| 73 | + ``` |
| 74 | + The server will start on `http://localhost:3001` (default). |
| 75 | + |
| 76 | +### Frontend Development |
| 77 | + |
| 78 | +1. Navigate to the `frontend` directory. |
| 79 | +2. Start the development server: |
| 80 | + ```bash |
| 81 | + npm run dev |
| 82 | + ``` |
| 83 | + The application will run on `http://localhost:3000`. |
| 84 | + |
| 85 | +## Pull Request Process |
| 86 | + |
| 87 | +1. Ensure any install or build dependencies are removed before the end of the layer when doing a build. |
| 88 | +2. Update the `README.md` with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters. |
| 89 | +3. Increase the version numbers in any examples files and the README.md to the new version that this Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). |
| 90 | +4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you. |
| 91 | + |
| 92 | +## Coding Standards |
| 93 | + |
| 94 | +### Style Guide |
| 95 | + |
| 96 | +- **JavaScript/React**: We follow the standard Next.js and React patterns. Use functional components and Hooks. |
| 97 | +- **Styling**: Use Tailwind CSS utility classes. Avoid inline styles where possible. |
| 98 | +- **Backend**: Use standard Express middleware patterns and async/await for asynchronous operations. |
| 99 | + |
| 100 | +### Linting |
| 101 | + |
| 102 | +Before submitting a PR, please run the linter to ensure code quality. |
| 103 | + |
| 104 | +* **Frontend**: |
| 105 | + ```bash |
| 106 | + cd frontend |
| 107 | + npm run lint |
| 108 | + ``` |
| 109 | + |
| 110 | +Thank you for contributing! |
0 commit comments