Skip to content

Commit 13b4569

Browse files
committed
chore: Add contribution guidelines and GitHub Actions CI workflow for backend and frontend checks.
1 parent bc96673 commit 13b4569

2 files changed

Lines changed: 171 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI Pipeline
2+
3+
on:
4+
push:
5+
branches: [ "main", "master" ]
6+
pull_request:
7+
branches: [ "main", "master" ]
8+
9+
jobs:
10+
backend-check:
11+
name: Backend Check
12+
runs-on: ubuntu-latest
13+
defaults:
14+
run:
15+
working-directory: ./backend
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '18.x'
24+
cache: 'npm'
25+
cache-dependency-path: backend/package-lock.json
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Generate Prisma Client
31+
run: npx prisma generate
32+
33+
frontend-check:
34+
name: Frontend Check
35+
runs-on: ubuntu-latest
36+
defaults:
37+
run:
38+
working-directory: ./frontend
39+
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Set up Node.js
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version: '18.x'
47+
cache: 'npm'
48+
cache-dependency-path: frontend/package-lock.json
49+
50+
- name: Install dependencies
51+
run: npm ci
52+
53+
- name: Lint
54+
run: npm run lint
55+
56+
- name: Build
57+
run: npm run build
58+
env:
59+
# Provide a dummy URL for build time if needed
60+
NEXT_PUBLIC_API_URL: "http://localhost:3001/api"
61+
CI: true

CONTRIBUTING.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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

Comments
 (0)