CodeHarbor is a GitHub-inspired full-stack developer platform for creating repositories, tracking issues, adding comments, viewing contribution activity, and connecting local projects through a custom CLI workflow.
Live Website: https://bhushan-codeharbor.netlify.app/
CodeHarbor was built to understand how developer platforms like GitHub work behind the scenes. It includes a web application, backend API, database, file storage system, and command-line interface.
The project supports repository creation, issue tracking, comments, contribution activity, and a CLI-based local workflow for initializing, staging, committing, pushing, pulling, and reverting files.
- User authentication
- Repository creation and management
- Repository detail pages
- Issue creation, editing, closing, reopening, and deletion
- Comment system for individual issues
- Profile page with contribution activity heatmap
- Dashboard with repository overview
- Documentation page for CLI usage
- Custom CodeHarbor CLI workflow
- AWS S3-based file storage for pushed commits
- Deployed frontend and backend
- React
- Vite
- React Router
- Axios
- CSS
- Node.js
- Express
- MongoDB
- Mongoose
- Native MongoDB Driver
- JWT
- bcryptjs
- Socket.IO
- AWS SDK
- Yargs CLI
- Frontend: Netlify
- Backend: Railway
- Database: MongoDB Atlas
- File Storage: AWS S3
CodeHarbor/
├── backend/
│ ├── config/
│ ├── controllers/
│ ├── models/
│ ├── routes/
│ ├── cli.js
│ ├── index.js
│ └── package.json
│
├── frontend/
│ ├── public/
│ │ └── _redirects
│ ├── src/
│ │ ├── assets/
│ │ ├── components/
│ │ ├── api.js
│ │ ├── Routes.jsx
│ │ └── main.jsx
│ └── package.json
│
└── README.md
React frontend
↓
Express backend
↓
MongoDB Atlas + AWS S3
The frontend sends requests to the backend for users, repositories, issues, comments, and profile activity.
MongoDB stores application data such as users, repositories, issues, comments, and activity-related data.
AWS S3 stores repository files pushed through the CodeHarbor CLI workflow.
git clone https://github.com/BhushanSah/CodeHarbor.git
cd CodeHarborGo to the backend folder:
cd backend
npm installCreate a .env file inside the backend folder:
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET_KEY=your_jwt_secret
AWS_REGION=us-east-2
S3_BUCKET=your_s3_bucket_name
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_keyRun the backend:
npm startThe backend should run on:
http://localhost:3000
For deployment platforms like Railway, the app uses:
process.env.PORT || 3000Open a new terminal:
cd frontend
npm installCreate a .env file inside the frontend folder:
VITE_API_BASE_URL=http://localhost:3000Run the frontend:
npm run devThe frontend should run on:
http://localhost:5173
The frontend uses frontend/src/api.js to decide which backend URL to call.
const API_BASE_URL =
import.meta.env.VITE_API_BASE_URL || "http://localhost:3000";
export default API_BASE_URL;For local development:
VITE_API_BASE_URL=http://localhost:3000For production:
VITE_API_BASE_URL=https://adventurous-passion-production-6861.up.railway.appCodeHarbor includes a custom CLI for local repository actions.
From the backend folder:
npm linkThen move to any local project folder and run:
codeharbor init
codeharbor add <file>
codeharbor commit -m "your commit message"To connect a local project to an online CodeHarbor repository:
codeharbor remote add origin <repository-id>To push committed files:
codeharbor pushTo pull files:
codeharbor pullTo revert to a specific commit:
codeharbor revert <commit-id>Local project folder
↓
codeharbor init
↓
.CodeHarbor folder is created
↓
codeharbor add <file>
↓
file goes into staging
↓
codeharbor commit -m "message"
↓
commit snapshot is saved locally
↓
codeharbor remote add origin <repoId>
↓
local project is linked to online repository
↓
codeharbor push
↓
files are uploaded to AWS S3
| Variable | Purpose |
|---|---|
MONGODB_URI |
MongoDB Atlas connection string |
JWT_SECRET_KEY |
Secret key for JWT authentication |
AWS_REGION |
AWS region for S3 |
S3_BUCKET |
S3 bucket name |
AWS_ACCESS_KEY_ID |
AWS access key |
AWS_SECRET_ACCESS_KEY |
AWS secret key |
FRONTEND_URL |
Deployed frontend URL for CORS |
PORT |
Provided automatically by Railway or other hosting platforms |
| Variable | Purpose |
|---|---|
VITE_API_BASE_URL |
Backend API URL used by the React frontend |
The deployed version uses:
Frontend → Netlify
Backend → Railway
Database → MongoDB Atlas
Storage → AWS S3
Netlify settings:
Base directory: frontend
Build command: npm run build
Publish directory: dist
Frontend environment variable:
VITE_API_BASE_URL=https://adventurous-passion-production-6861.up.railway.appThe frontend also includes a Netlify redirect file:
frontend/public/_redirects
Content:
/* /index.html 200
This allows React routes like /profile, /docs, and /repo/:id to work after page refresh.
Railway backend uses the backend folder.
The backend start script is:
"scripts": {
"start": "node index.js start"
}Railway environment variables include:
MONGODB_URI=your_mongodb_atlas_uri
JWT_SECRET_KEY=your_jwt_secret
AWS_REGION=us-east-2
S3_BUCKET=your_s3_bucket
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
FRONTEND_URL=https://bscodeharbor.netlify.appThe backend listens using:
const port = process.env.PORT || 3000;
httpServer.listen(port, "0.0.0.0", () => {
console.log(`Server is running on ${port}`);
});Frontend:
https://bhushan-codeharbor.netlify.app/
Backend:
https://adventurous-passion-production-6861.up.railway.app
- The CLI currently works through a source-based setup using
npm link. - Public CLI distribution through npm is not added yet.
- AWS SDK v2 is currently used and can be migrated to AWS SDK v3 later.
- More authentication checks can be added for repository ownership and comment permissions.
- Activity tracking can be improved by tying issue/comment activity directly to authenticated user IDs.
- The project is still being improved toward a more production-ready developer platform.
- Publish the CLI as an npm package
- Add stronger repository permissions
- Add branch support
- Add commit history UI
- Add file diff views
- Improve S3 file browsing
- Add user profile customization
- Add better activity tracking by author
- Add tests for backend routes
- Improve mobile responsiveness
- Migrate AWS SDK v2 to AWS SDK v3
- Add better error handling for deployment and API failures
Do not commit .env files or secret keys to GitHub.
Make sure .gitignore includes:
.env
node_modulesDeployment secrets should be stored in the hosting platform environment variables, not in the codebase.