The backend API for Codehub, a freelance portfolio platform with courses, articles, comments, and messaging.
Codehub Backend powers Codehub, a freelance portfolio website. It manages the site's content (services, technologies, works, vision, courses, and articles) and its community features (users, comments, and messages), with local and social authentication.
- Authentication: sign-up, sign-in, and forgot and reset password by email, plus social login with Google, GitHub, and Facebook.
- Portfolio content: services, technologies, works (projects), and vision statements.
- Learning content: courses and articles, with filtering.
- Community: comments and contact messages.
- User management: filtering, counts, and role-based guards.
- File uploads served as static files.
| Area | Technology |
|---|---|
| Framework | NestJS |
| Language | TypeScript |
| Database | PostgreSQL, TypeORM |
| Authentication | Passport (JWT, Google, GitHub, Facebook), bcrypt |
| Nodemailer | |
| Uploads | Multer, @nestjs/serve-static |
- Node.js and npm
- A PostgreSQL database
git clone https://github.com/RithyBondeth/Codehub-Backend.git
cd Codehub-Backend
npm install
npm run start:devThe API is served under /api.
| Variable | Purpose |
|---|---|
DATABASE_URL, DATABASE_PORT, SYNCHRONIZE |
PostgreSQL connection |
JWT_SECRET, JWT_EXPIRE_IN |
Token signing |
EMAIL_USER, EMAIL_PASSWORD |
Password-reset email |
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_CALLBACK_URL |
Google login |
GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, GITHUB_CALLBACK_URL |
GitHub login |
FACEBOOK_CLIENT_ID, FACEBOOK_CLIENT_SECRET, FACEBOOK_CALLBACK_URL |
Facebook login |
PORT |
Server port |
Codehub-Backend/
└── src/
├── auth/ # Local and social auth, guards, strategies
├── user/
├── service/ technology/ work/ vision/
├── course/ article/ comment/ message/
├── uploadfile/ # File uploads
├── entities/ # TypeORM entities
└── config/ # Database and JWT configuration
- Codehub-Frontend: the React portfolio website
Rithy Bondeth — Full Stack Developer & AI Engineer
Distributed under the MIT License. See LICENSE for details.