Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,43 +43,26 @@ Welcome to **GitHub Tracker**, a web app designed to help you monitor and analyz
## 🚀 Setup Guide
1. Clone the repository to your local machine:
```bash
$ git clone https://github.com/GitMetricsLab/github_tracker.git
$ git clone https://github.com/yourusername/github-tracker.git
```

2. Navigate to the project directory:
```bash
$ cd github-tracker
```

3. Run the frontend
```bash
$ npm i
$ npm run dev
```

This project utilizes [Vitest](https://vitest.dev/) and React Testing Library to ensure UI reliability.

To run the frontend test suite, use the following command:
```bash
npm run test:client
```


4. Run the backend
```bash
$ npm i
$ npm start
```

### Backend Environment Variables

Create `backend/.env` for local backend runs:

| Variable | Required | Purpose |
| --- | --- | --- |
| `MONGO_URI` | Yes | MongoDB connection string used by Mongoose and the persistent session store |
| `SESSION_SECRET` | Yes | Secret used to sign Express session cookies |
| `NODE_ENV` | No | Set to `production` to send session cookies only over HTTPS |

## 🧪 Backend Unit & Integration Testing with Jasmine

This project uses the Jasmine framework for backend unit and integration tests. The tests cover:
Expand Down
10 changes: 3 additions & 7 deletions backend/config/passportConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ passport.use(
try {
const user = await User.findOne( {email} );
if (!user) {
return done(null, false, { message: 'Invalid email or password' });
return done(null, false, { message: 'Email is invalid '});
}

const isMatch = await user.comparePassword(password);
if (!isMatch) {
return done(null, false, { message: 'Invalid email or password' });
return done(null, false, { message: 'Invalid password' });
}

return done(null, {
Expand All @@ -35,13 +35,9 @@ passport.serializeUser((user, done) => {
});

// Deserialize user (retrieve user from session)
// .select('-password -__v') excludes the bcrypt hash from req.user so it
// cannot be accidentally serialized into an API response.
// .lean() returns a plain object instead of a Mongoose document, preventing
// model methods from being accessible on req.user.
passport.deserializeUser(async (id, done) => {
try {
const user = await User.findById(id).select('-password -__v').lean();
const user = await User.findById(id);
done(null, user);
} catch (err) {
done(err, null);
Expand Down
32 changes: 0 additions & 32 deletions backend/config/session.js

This file was deleted.

30 changes: 0 additions & 30 deletions backend/data/discussions.json

This file was deleted.

10 changes: 0 additions & 10 deletions backend/data/users.json

This file was deleted.

81 changes: 0 additions & 81 deletions backend/models/Discussion.js

This file was deleted.

1 change: 0 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"dependencies": {
"bcryptjs": "^2.4.3",
"body-parser": "^1.20.3",
"connect-mongo": "^5.1.0",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.21.1",
Expand Down
Loading
Loading