-
Notifications
You must be signed in to change notification settings - Fork 63
docs: add Quick Start for Contributors and clarify setup steps #198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b9e6ef3
72ec866
3613b39
aae0906
d64e3a7
ebf9bd5
26f2df0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 18.20.3 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,43 @@ | ||
| # 🌟 **GitHub Tracker** 🌟 | ||
| <!-- top --> | ||
|
|
||
| ## 🚩 Quick Start for Contributors | ||
|
|
||
| Want to contribute? Here’s how to get started: | ||
|
|
||
| 1. **Fork** this repository on GitHub. | ||
| 2. **Clone** your fork: | ||
| ```bash | ||
| git clone https://github.com/<your-username>/github_tracker.git | ||
| cd github_tracker | ||
| ``` | ||
| 3. **Add the upstream remote and sync** (original repository): | ||
| ```bash | ||
| git remote add upstream https://github.com/GitMetricsLab/github_tracker.git | ||
| git fetch upstream | ||
| # create your branch from the latest upstream main | ||
| git checkout -b my-first-contribution upstream/main | ||
| ``` | ||
| Later, to refresh your branch: | ||
| ```bash | ||
| git fetch upstream && git rebase upstream/main | ||
| ``` | ||
| If you already pushed before the rebase: | ||
| ```bash | ||
| git push --force-with-lease | ||
| ``` | ||
| 4. **Make your changes** (e.g., edit `README.md` to improve instructions). | ||
| 5. **Commit and push**: | ||
| ```bash | ||
| git add . | ||
| git commit -m "docs(readme): improve setup instructions" | ||
| git push -u origin my-first-contribution | ||
| ``` | ||
| 6. **Open a Pull Request** from your branch to the main repository. | ||
|
|
||
| See [`CONTRIBUTING.md`](CONTRIBUTING.md) for more details! | ||
|
|
||
|
|
||
| **Track Activity of Users on GitHub** | ||
|
|
||
| Welcome to **GitHub Tracker**, a web app designed to help you monitor and analyze the activity of GitHub users. Whether you’re a developer, a project manager, or just curious, this tool simplifies tracking contributions and activity across repositories! 🚀👩💻 | ||
|
|
@@ -20,11 +57,11 @@ Welcome to **GitHub Tracker**, a web app designed to help you monitor and analyz | |
| </thead> | ||
| <tbody> | ||
| <tr> | ||
| <td><img alt="Stars" src="https://img.shields.io/github/stars/mehul-m-prajapati/github_tracker?style=flat&logo=github"/></td> | ||
| <td><img alt="Forks" src="https://img.shields.io/github/forks/mehul-m-prajapati/github_tracker?style=flat&logo=github"/></td> | ||
| <td><img alt="Issues" src="https://img.shields.io/github/issues/mehul-m-prajapati/github_tracker?style=flat&logo=github"/></td> | ||
| <td><img alt="Open Pull Requests" src="https://img.shields.io/github/issues-pr/mehul-m-prajapati/github_tracker?style=flat&logo=github"/></td> | ||
| <td><img alt="Closed Pull Requests" src="https://img.shields.io/github/issues-pr-closed/mehul-m-prajapati/github_tracker?style=flat&color=critical&logo=github"/></td> | ||
| <td><img alt="Stars" src="https://img.shields.io/github/stars/GitMetricsLab/github_tracker?style=flat&logo=github"/></td> | ||
| <td><img alt="Forks" src="https://img.shields.io/github/forks/GitMetricsLab/github_tracker?style=flat&logo=github"/></td> | ||
| <td><img alt="Issues" src="https://img.shields.io/github/issues/GitMetricsLab/github_tracker?style=flat&logo=github"/></td> | ||
| <td><img alt="Open Pull Requests" src="https://img.shields.io/github/issues-pr/GitMetricsLab/github_tracker?style=flat&logo=github"/></td> | ||
| <td><img alt="Closed Pull Requests" src="https://img.shields.io/github/issues-pr-closed/GitMetricsLab/github_tracker?style=flat&color=critical&logo=github"/></td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
|
|
@@ -41,59 +78,129 @@ Welcome to **GitHub Tracker**, a web app designed to help you monitor and analyz | |
| --- | ||
|
|
||
| ## 🚀 Setup Guide | ||
| 1. Clone the repository to your local machine: | ||
|
|
||
| ### 1. Install dependencies for both frontend and backend | ||
|
|
||
| First, switch to the project’s Node.js version (from `.nvmrc`) if you use nvm: | ||
| ```bash | ||
| nvm use | ||
| ``` | ||
|
|
||
| Preferred (one command): | ||
| ```bash | ||
| npm run setup | ||
| ``` | ||
|
|
||
| Fallback (manual): | ||
| ```bash | ||
| $ git clone https://github.com/yourusername/github-tracker.git | ||
| npm install | ||
| cd backend && npm install | ||
| ``` | ||
|
|
||
| 2. Navigate to the project directory: | ||
| ### 2. Configure environment variables (backend) | ||
| Copy the sample env file and set required variables: | ||
| ```bash | ||
| $ cd github-tracker | ||
| cp backend/.env.sample backend/.env | ||
| ``` | ||
| PowerShell (Windows): | ||
| ```powershell | ||
| Copy-Item backend/.env.sample backend/.env | ||
| ``` | ||
| Then edit `backend/.env` and set at least: | ||
| - `MONGO_URI` (e.g., `mongodb://127.0.0.1:27017/githubTracker`) | ||
| - `SESSION_SECRET` (e.g., a long random string) | ||
| - `PORT` (e.g., `5000`) | ||
|
|
||
| 3. Run the frontend | ||
| ### 3. Start the backend server | ||
| In the `backend` folder: | ||
| ```bash | ||
| $ npm i | ||
| $ npm run dev | ||
| npm start | ||
| ``` | ||
|
|
||
| 4. Run the backend | ||
| ### 4. Start the frontend development server | ||
| Open a new terminal in the project root: | ||
| ```bash | ||
| $ npm i | ||
| $ npm start | ||
| npm run dev | ||
| ``` | ||
|
|
||
| ### 5. Open the app in your browser | ||
| Visit the URL shown in the terminal (usually <http://localhost:5173>). | ||
| If the backend runs locally, it typically listens on <http://localhost:5000> (or the value of `PORT` in your `.env`). | ||
|
|
||
| > **Note:** Make sure MongoDB is running locally (default: `mongodb://127.0.0.1:27017`). | ||
| > | ||
| > Optional: Run MongoDB with Docker | ||
| > ```bash | ||
| > docker volume create github-tracker-mongo | ||
| > docker run --name github-tracker-mongo \ | ||
| > -p 27017:27017 \ | ||
| > -v github-tracker-mongo:/data/db \ | ||
| > -d mongo:6 | ||
| > | ||
| > # Then, point your app at this database, for example: | ||
| > export MONGO_URI="mongodb://127.0.0.1:27017/githubTracker" | ||
| > ``` | ||
|
|
||
| Alternatively, to start the full stack with Compose: | ||
|
|
||
| > Requires Docker Compose v2 (Docker Desktop or standalone Compose v2 CLI). | ||
| > See https://docs.docker.com/compose/ for installation and upgrade instructions. | ||
|
|
||
| ```bash | ||
| # Dev profile (hot reload etc.) | ||
| npm run docker:dev | ||
|
|
||
| # Production-like profile | ||
| npm run docker:prod | ||
| ``` | ||
|
|
||
| ## 🧪 Backend Unit & Integration Testing with Jasmine | ||
|
|
||
| This project uses the Jasmine framework for backend unit and integration tests. The tests cover: | ||
| - User model (password hashing, schema, password comparison) | ||
| - Authentication routes (signup, login, logout) | ||
| - [User model (password hashing, schema, password comparison)](spec/user.model.spec.cjs) | ||
| - [Authentication routes (signup, login, logout)](spec/auth.routes.spec.cjs) | ||
| - Passport authentication logic (via integration tests) | ||
|
|
||
| ### Prerequisites | ||
| - **Node.js** and **npm** installed | ||
| - **MongoDB** running locally (default: `mongodb://127.0.0.1:27017`) | ||
|
|
||
| ### Installation | ||
| Install all required dependencies: | ||
| ```sh | ||
| npm install | ||
| npm install --save-dev jasmine @types/jasmine supertest express-session passport passport-local bcryptjs | ||
| Install dependencies (root and backend) if you haven’t already: | ||
| ```bash | ||
| npm run setup | ||
| ``` | ||
| Jasmine is already configured in the repo; run it via `npx` or an npm script to avoid global installs: | ||
| ```bash | ||
| npx jasmine --config=spec/support/jasmine.mjs | ||
| # or add to package.json: | ||
| # "scripts": { "test": "jasmine --config=spec/support/jasmine.mjs" } | ||
| ``` | ||
|
|
||
| ### Running the Tests | ||
| 1. **Start MongoDB** (if not already running): | ||
| ```sh | ||
| mongod | ||
| ``` | ||
| 2. **Run Jasmine tests:** | ||
| ```sh | ||
| npx jasmine | ||
| ``` | ||
| 2. **Run Jasmine tests (from the repository root) with the MJS config:** | ||
|
|
||
| macOS/Linux (Bash): | ||
| ```bash | ||
| # Use a test database (e.g., github_tracker_test) to avoid clobbering dev data | ||
| MONGO_URI="mongodb://127.0.0.1:27017/github_tracker_test" npx jasmine --config=spec/support/jasmine.mjs | ||
| # Or cross-platform with one command: | ||
| npx cross-env MONGO_URI="mongodb://127.0.0.1:27017/github_tracker_test" jasmine --config=spec/support/jasmine.mjs | ||
| ``` | ||
|
|
||
| Windows (PowerShell): | ||
| ```powershell | ||
| # Use a test database (e.g., github_tracker_test) to avoid clobbering dev data | ||
| $env:MONGO_URI="mongodb://127.0.0.1:27017/github_tracker_test"; npx jasmine --config=spec/support/jasmine.mjs | ||
| ``` | ||
|
Comment on lines
+187
to
+199
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainEnsure cross-env is available or provide install hint The cross-platform example uses cross-env; verify it’s a devDependency or add a one-line install hint. Verification script: Optional README tweak if missing: - npx cross-env MONGO_URI="mongodb://127.0.0.1:27017/github_tracker_test" jasmine --config=spec/support/jasmine.mjs
+ # Requires cross-env (install once: npm i -D cross-env)
+ npx cross-env MONGO_URI="mongodb://127.0.0.1:27017/github_tracker_test" jasmine --config=spec/support/jasmine.mjs🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Checking for cross-env in root or backend package.json..."
rg -n '"cross-env"\s*:' -g 'package.json' -g 'backend/package.json' -n -C1 || {
echo "cross-env not found in devDependencies. Consider adding:";
echo 'npm install -D cross-env';
exit 1;
}Length of output: 408 Add The verification script confirmed that • Package manifest
• README.md (Lines 186–198)
🤖 Prompt for AI Agents |
||
|
|
||
| ### Test Files | ||
| - `spec/user.model.spec.cjs` — Unit tests for the User model | ||
| - `spec/auth.routes.spec.cjs` — Integration tests for authentication routes | ||
| - [`spec/user.model.spec.cjs`](spec/user.model.spec.cjs) — Unit tests for the User model | ||
| - [`spec/auth.routes.spec.cjs`](spec/auth.routes.spec.cjs) — Integration tests for authentication routes | ||
|
|
||
| ### Jasmine Configuration | ||
| The Jasmine config (`spec/support/jasmine.mjs`) is set to recognize `.cjs`, `.js`, and `.mjs` test files: | ||
|
|
@@ -122,7 +229,7 @@ spec_files: [ | |
| - Make sure you show some love by giving ⭐ to our repository. | ||
|
|
||
| <div align="center"> | ||
| <a href="https://github.com/mehul-m-prajapati/github_tracker"> | ||
| <a href="https://github.com/GitMetricsLab/github_tracker"> | ||
| <img src="https://contrib.rocks/image?repo=GitMetricsLab/github_tracker&&max=1000" /> | ||
| </a> | ||
| </div> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.