A full-stack web application for sharing and downloading code files. Built with React frontend and Node.js/Express backend with MongoDB.
Code Galaxy is a platform where developers can:
- Browse code files with previews
- Search for specific files or categories
- Download free and paid code resources
- Rate and review files
- View file details and previews
- Responsive design with dark mode support
- Home page with file placeholders (14 per page, 2 per row)
- Search functionality with dedicated results page
- Category filtering (Free: Python/HTML&CSS, Paid)
- File details, preview, and download pages
- Rating system with popup interface
- Auto-moving banners
- Multiple ad placements
- Logo integration throughout
- RESTful API with MongoDB
- File management with pagination
- Full-text search capabilities
- Rating system with average calculations
- Download endpoints
- Health check monitoring
- Environment-based configuration
- React 18
- React Router DOM
- Axios
- CSS3
- Node.js
- Express.js
- MongoDB with Mongoose
- dotenv
- CORS
- Morgan
- Node.js (v14 or higher)
- MongoDB Atlas account (or local MongoDB)
- npm or yarn
-
Navigate to server directory:
cd server
-
Install dependencies:
npm install
-
Create
.env
file with:PORT=8000 MONGO_URI=your_mongodb_connection_string APP_NAME=CodeGalaxy
-
Start the server:
npm start
Server runs on http://localhost:8000/developers
-
Navigate to client directory:
cd client
-
Install dependencies:
npm install
-
Create
.env
file with:REACT_APP_API_URL=http://localhost:8000/developers REACT_APP_WEBSITE_NAME=Code Galaxy REACT_APP_DEFAULT_THEME=light
-
Start the development server:
npm start
App runs on http://localhost:3000
All endpoints prefixed with /developers
:
GET /files?page={page}&limit=14
- Paginated filesGET /search?query={query}
- Search filesGET /details/{id}
- File detailsPOST /rate/{id}
- Rate fileGET /download/{id}
- Download fileGET /health
- Health check
Files collection:
{
imgUrl: String,
fileName: String,
type: String,
shortDescription: String,
pageDescription: String,
createdDate: Date,
category: "free" | "paid",
price: Number,
rating: Number,
ratingsCount: Number
}
CodeGalaxy/
├── client/ # React frontend
│ ├── public/
│ ├── src/
│ │ ├── components/
│ │ ├── Pages/
│ │ └── utils/
│ └── README.md
├── server/ # Node.js backend
│ ├── config/
│ ├── controllers/
│ ├── models/
│ ├── routes/
│ └── README.md
├── logo.fav # Website logo
├── promts.txt # Requirements document
└── README.md # This file
- Pagination: 14 files per page on home
- Ads System: Side, popup, and row ads
- Search: Case-insensitive search across multiple fields
- Rating: Cumulative average rating system
- File Types: Special handling for HTML&CSS with separate previews
- Banners: Auto-moving carousel with manual controls
- Responsive: Works on desktop and mobile
- Fork the repository
- Create feature branches
- Make changes with proper comments
- Test both frontend and backend
- Submit pull requests
MIT License
- Frontend: http://localhost:3000
- Backend: http://localhost:8000/developers
- Health Check: http://localhost:8000/developers/health
- Home Page: http://localhost:3000/
- Preview Page: http://localhost:3000/preview/{id}
- Download Page: http://localhost:3000/download/{id}
- Search Page: http://localhost:3000/search