A scalable Node.js + Express.js backend powering the DevFoundry frontend — where developers forge their builds.
This API handles curated project data, GitHub OAuth login, JWT-based authentication, role-based access control, and contributor-friendly submission workflows.
Built for modular clarity and production-grade deployment across environments.
🔗 Live API: devfoundry-backend.vercel.app
📦 Frontend Repo: DevFoundry App
- Node.js – Runtime environment
- Express.js – Web framework for RESTful APIs
- MongoDB – NoSQL database
- Mongoose – ODM for MongoDB
- JWT – Authentication via JSON Web Tokens
- GitHub OAuth – Secure login via GitHub
- Vercel – Serverless deployment
- GitHub OAuth login
- JWT token generation and verification
- Protected routes via middleware
- Role-based access support (admin/contributor)
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/builds/get |
Fetch all core/community builds |
| POST | /api/builds/add |
Add a new core/community builds (auth required) |
| PUT | /api/builds/update/:id |
Update core/community builds by ID (auth required) |
| DELETE | /api/builds/delete/:id |
Delete core/community builds by ID (auth required) |
| PUT | /api/builds/review/:id |
Review and update status of a core/community build (admin only) |
| PUT | /api/builds/restore/:id |
Restore a previously deleted core/community build (admin only) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/auth/github |
Initiate GitHub login |
| GET | /api/auth/callback |
GitHub OAuth callback |
| GET | /api/auth/me |
Fetch authenticated user profile (auth required) |
| POST | /api/auth/logout |
Log out the current user |
/DevFoundry-Backend
├── api/ # Entry point for API routing
│ └── index.js
├── controllers/ # Handles HTTP requests and responses for auth and build routes
│ ├── authController.js
│ └── buildController.js
├── services/ # Core business logic and data operations for builds
│ └── buildService.js
├── middleware/ # Auth middleware for route protection
│ └── auth.js
├── models/ # Mongoose schemas for MongoDB
│ ├── authUserModel.js
│ └── buildModel.js
├── routes/ # Route definitions and grouping
│ ├── authRoutes.js
│ ├── index.js
│ └── buildRoutes.js
├── utils/ # Shared utilities (JWT, error handling)
│ ├── buildType.js
│ ├── constants.js
│ ├── error.js
│ └── jwt.js
├── .env # Environment variables (fill actual values)
├── index.js # App entry point
└── README.md # Project documentation
You need to write the following commands on the terminal screen (in vscode) so that you can run this project locally.
git clone "https://github.com/chetannada/DevFoundry-Backend.git"Go to the project directory
cd DevFoundry-BackendInstall dependencies
npm installSet up environment variables:
- .env - environment variables for this project to run in development environment (fill with actual values for environment variables)
Run the server:
npm run startThis server should now be running on http://localhost:5000.
If you want to Fork repository and want to run locally, follow this guidelines Fork and Clone Github Repository
Pull requests are welcome! If you’d like to add features, improve error handling, or optimize performance, feel free to fork and submit a PR.
This project is open-source and available under the MIT License.