diff --git a/README.md b/README.md index a747b53a..d330bd24 100644 --- a/README.md +++ b/README.md @@ -41,28 +41,194 @@ Welcome to **GitHub Tracker**, a web app designed to help you monitor and analyz --- ## ๐Ÿš€ Setup Guide -1. Clone the repository to your local machine: + +### ๐Ÿ“‹ Prerequisites + +Before setting up the project locally, ensure the following tools are installed on your system: + +- Node.js (v18 or later recommended) +- npm +- Docker +- Docker Compose +- MongoDB (required for backend services and testing) + +--- + +## ๐Ÿ“ฅ Clone the Repository + +```bash +git clone https://github.com/GitMetricsLab/github_tracker.git +cd github-tracker +``` + +--- + +# ๐Ÿ’ป Local Development Setup + +This project contains both frontend and backend services. + +## โ–ถ๏ธ Frontend Setup + +Install frontend dependencies: + +```bash +npm install +``` + +Start the frontend development server: + +```bash +npm run dev +``` + +The frontend will run on: + +```txt +http://localhost:5173 +``` + +--- + +## โš™๏ธ Backend Setup + +Move into the backend directory: + ```bash -$ git clone https://github.com/yourusername/github-tracker.git +cd backend ``` -2. Navigate to the project directory: +Install backend dependencies: + ```bash -$ cd github-tracker +npm install ``` -3. Run the frontend +Start the backend server: + ```bash -$ npm i -$ npm run dev +npm run dev +``` + +The backend server will run on: + +```txt +http://localhost:5000 ``` -4. Run the backend +--- + +# ๐Ÿณ Docker Development Workflow + +The project includes Docker configurations for both development and production environments. + +## ๐Ÿ“ฆ Development Environment + +Run the complete development environment using Docker: + ```bash -$ npm i -$ npm start +npm run docker:dev ``` +This command: + +- Builds frontend and backend containers +- Starts development services +- Enables live file changes using Docker volumes +- Runs frontend and backend simultaneously + +### Development Services + +| Service | Port | +|----------|------| +| Frontend | 5173 | +| Backend | 5000 | + +--- + +## ๐Ÿš€ Production Environment + +Run the production Docker setup: + +```bash +npm run docker:prod +``` + +This command: + +- Creates optimized production builds +- Runs frontend using Nginx +- Starts backend production services + +### Production Services + +| Service | Port | +|----------|------| +| Frontend | 3000 | +| Backend | 5000 | + +--- + +# ๐Ÿ“‚ Docker Configuration Overview + +| File | Purpose | +|------|----------| +| `Dockerfile.dev` | Development container setup | +| `Dockerfile.prod` | Production container setup | +| `docker-compose.yml` | Multi-service container orchestration | + +--- + +# ๐Ÿ”„ Local Development Workflow + +Recommended contributor workflow: + +1. Fork the repository +2. Clone your fork locally +3. Create a new branch +4. Install dependencies +5. Run frontend/backend locally or using Docker +6. Make changes +7. Test your implementation +8. Commit and push changes +9. Open a Pull Request + +--- + +# ๐ŸŒฑ Environment Configuration + +The project uses environment variables for configuration. + +Frontend environment variables: + +```env +VITE_BACKEND_URL=http://localhost:5000 +``` + +Backend environment variables: + +```env +PORT=5000 +MONGO_URI=your_mongodb_connection +SESSION_SECRET=your_secret +``` + +Create corresponding `.env` files before running the application. + +--- + +# ๐Ÿ› ๏ธ Useful Commands + +| Command | Description | +|----------|-------------| +| `npm run dev` | Start frontend locally | +| `npm run build` | Create production build | +| `npm run docker:dev` | Run Docker development environment | +| `npm run docker:prod` | Run Docker production environment | +| `npm run test` | Run frontend tests | +| `npm run test:backend` | Run backend tests | + +--- + ## ๐Ÿงช Backend Unit & Integration Testing with Jasmine This project uses the Jasmine framework for backend unit and integration tests. The tests cover: @@ -140,3 +306,6 @@ spec_files: [ โฌ†๏ธ Back to Top

+ + +