@@ -41,206 +41,28 @@ Welcome to **GitHub Tracker**, a web app designed to help you monitor and analyz
4141---
4242
4343## 🚀 Setup Guide
44-
45- ### 📋 Prerequisites
46-
47- Before setting up the project locally, ensure the following tools are installed on your system:
48-
49- - Node.js (v18 or later recommended)
50- - npm
51- - Docker
52- - Docker Compose
53- - MongoDB (required for backend services and testing)
54-
55- ---
56-
57- ## 📥 Clone the Repository
58-
59- ``` bash
60- git clone https://github.com/GitMetricsLab/github_tracker.git
61- cd github-tracker
62- ```
63-
64- ---
65-
66- # 💻 Local Development Setup
67-
68- This project contains both frontend and backend services.
69-
70- ## ▶️ Frontend Setup
71-
72- Install frontend dependencies:
73-
74- ``` bash
75- npm install
76- ```
77-
78- Start the frontend development server:
79-
80- ``` bash
81- npm run dev
82- ```
83-
84- The frontend will run on:
85-
86- ``` txt
87- http://localhost:5173
88- ```
89-
90- ---
91-
92- ## ⚙️ Backend Setup
93-
94- Move into the backend directory:
95-
44+ 1 . Clone the repository to your local machine:
9645``` bash
97- cd backend
46+ $ git clone https://github.com/yourusername/github-tracker.git
9847```
9948
100- Install backend dependencies:
101-
49+ 2 . Navigate to the project directory:
10250``` bash
103- npm install
51+ $ cd github-tracker
10452```
10553
106- 3 . Configure environment variables
107-
108- Copy the example files and fill in your values:
109- ``` bash
110- # Frontend (.env in the repo root)
111- cp .env.example .env
112-
113- # Backend (.env inside backend/)
114- cp backend/.env.example backend/.env
115- ```
116-
117- Key variables to set:
118-
119- | Variable | Where | Description |
120- | ---| ---| ---|
121- | ` VITE_BACKEND_URL ` | root ` .env ` | URL of the backend (default: ` http://localhost:5000 ` ) |
122- | ` MONGO_URI ` | ` backend/.env ` | MongoDB connection string |
123- | ` SESSION_SECRET ` | ` backend/.env ` | Long random string used to sign session cookies |
124- | ` FRONTEND_ORIGIN ` | ` backend/.env ` | URL of the frontend — restricts CORS. ** Required in production.** Defaults to ` http://localhost:5173 ` in development. |
125-
126- 4 . Run the frontend
54+ 3 . Run the frontend
12755``` bash
128- npm run dev
129- ```
130-
131- The backend server will run on:
132-
133- ``` txt
134- http://localhost:5000
56+ $ npm i
57+ $ npm run dev
13558```
13659
137- 5 . Run the backend
60+ 4 . Run the backend
13861``` bash
139- $ cd backend
14062$ npm i
14163$ npm start
14264```
14365
144- This command:
145-
146- - Builds frontend and backend containers
147- - Starts development services
148- - Enables live file changes using Docker volumes
149- - Runs frontend and backend simultaneously
150-
151- ### Development Services
152-
153- | Service | Port |
154- | ----------| ------|
155- | Frontend | 5173 |
156- | Backend | 5000 |
157-
158- ---
159-
160- ## 🚀 Production Environment
161-
162- Run the production Docker setup:
163-
164- ``` bash
165- npm run docker:prod
166- ```
167-
168- This command:
169-
170- - Creates optimized production builds
171- - Runs frontend using Nginx
172- - Starts backend production services
173-
174- ### Production Services
175-
176- | Service | Port |
177- | ----------| ------|
178- | Frontend | 3000 |
179- | Backend | 5000 |
180-
181- ---
182-
183- # 📂 Docker Configuration Overview
184-
185- | File | Purpose |
186- | ------| ----------|
187- | ` Dockerfile.dev ` | Development container setup |
188- | ` Dockerfile.prod ` | Production container setup |
189- | ` docker-compose.yml ` | Multi-service container orchestration |
190-
191- ---
192-
193- # 🔄 Local Development Workflow
194-
195- Recommended contributor workflow:
196-
197- 1 . Fork the repository
198- 2 . Clone your fork locally
199- 3 . Create a new branch
200- 4 . Install dependencies
201- 5 . Run frontend/backend locally or using Docker
202- 6 . Make changes
203- 7 . Test your implementation
204- 8 . Commit and push changes
205- 9 . Open a Pull Request
206-
207- ---
208-
209- # 🌱 Environment Configuration
210-
211- The project uses environment variables for configuration.
212-
213- Frontend environment variables:
214-
215- ``` env
216- VITE_BACKEND_URL=http://localhost:5000
217- ```
218-
219- Backend environment variables:
220-
221- ``` env
222- PORT=5000
223- MONGO_URI=your_mongodb_connection
224- SESSION_SECRET=your_secret
225- ```
226-
227- Create corresponding ` .env ` files before running the application.
228-
229- ---
230-
231- # 🛠️ Useful Commands
232-
233- | Command | Description |
234- | ----------| -------------|
235- | ` npm run dev ` | Start frontend locally |
236- | ` npm run build ` | Create production build |
237- | ` npm run docker:dev ` | Run Docker development environment |
238- | ` npm run docker:prod ` | Run Docker production environment |
239- | ` npm run test ` | Run frontend tests |
240- | ` npm run test:backend ` | Run backend tests |
241-
242- ---
243-
24466## 🧪 Backend Unit & Integration Testing with Jasmine
24567
24668This project uses the Jasmine framework for backend unit and integration tests. The tests cover:
@@ -318,6 +140,3 @@ spec_files: [
318140 ⬆️ Back to Top
319141 </a >
320142</p >
321-
322-
323-
0 commit comments