A full-stack content publishing platform built with Node.js, MongoDB, Google Cloud Functions, and Next.js. Demonstrates microservices architecture, RESTful API design, and modern web development practices.
Backend:
- Node.js + Express
- MongoDB (Mongoose)
- JWT Authentication
- REST APIs
Serverless:
- Google Cloud Functions
- Analytics microservice
Frontend:
- Next.js 14 (App Router)
- TypeScript
- Tailwind CSS
- Server-Side Rendering (SSR)
the-gigmen/
βββ backend/ # Express API
β βββ src/
β β βββ models/ # MongoDB schemas
β β βββ routes/ # API endpoints
β β βββ middleware/ # Auth middleware
β β βββ config/ # Database config
β β βββ index.js # Server entry
β βββ .env
βββ cloud-functions/ # GCP Functions
β βββ article-analytics/
β βββ index.js
βββ frontend/ # Next.js app
βββ app/ # App router pages
βββ lib/ # API client
βββ .env.local
- Go to MongoDB Atlas
- Create free cluster
- Get connection string
- Whitelist your IP (0.0.0.0/0 for development)
cd backend
# Install dependencies
npm install
# Create .env file
cat > .env << EOL
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/gigmen
JWT_SECRET=your_super_secret_key_change_this_in_production
PORT=5000
NODE_ENV=development
EOL
# Start development server
npm run devTest the API:
# Health check
curl http://localhost:5000/health
# Register user
curl -X POST http://localhost:5000/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"username": "testuser",
"email": "test@example.com",
"password": "password123",
"bio": "Test user bio"
}'
# Create article (use token from register)
curl -X POST http://localhost:5000/api/articles \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{
"title": "My First Article",
"content": "This is my first article content...",
"tags": ["nodejs", "mongodb"],
"published": true
}'cd cloud-functions/article-analytics
# Install dependencies
npm install
# Install Google Cloud CLI
# https://cloud.google.com/sdk/docs/install
# Login to GCP
gcloud auth login
# Set project
gcloud config set project YOUR_PROJECT_ID
# Deploy function
gcloud functions deploy getArticleAnalytics \
--runtime nodejs18 \
--trigger-http \
--allow-unauthenticated \
--set-env-vars MONGODB_URI="your_mongodb_connection_string"
# Get function URL
gcloud functions describe getArticleAnalyticscd frontend
# Install dependencies
npm install
# Create .env.local
cat > .env.local << EOL
NEXT_PUBLIC_API_URL=http://localhost:5000/api
NEXT_PUBLIC_GCP_ANALYTICS_URL=https://YOUR_GCP_FUNCTION_URL
EOL
# Start development server
npm run devβ User authentication with JWT β CRUD operations for articles β MongoDB schemas with indexing β Pagination and search β Role-based access control β Clean middleware architecture β Comprehensive error handling
β Serverless analytics microservice β MongoDB aggregation pipelines β Connection pooling for performance β CORS-enabled endpoints
β Server-Side Rendering (SSR) β Static Site Generation (SSG) β TypeScript for type safety β Responsive design with Tailwind β API client with auth interceptors
POST /api/auth/register- Create accountPOST /api/auth/login- LoginGET /api/auth/me- Get current user
GET /api/articles- List articles (with pagination)GET /api/articles/:slug- Get single articlePOST /api/articles- Create article (auth required)PUT /api/articles/:id- Update article (auth required)DELETE /api/articles/:id- Delete article (auth required)GET /api/articles/user/:username- User's articles
GET /getArticleAnalytics- Platform analytics
Users Collection:
{
username: String,
email: String,
password: String (hashed),
bio: String,
role: String,
articlesPublished: Number,
createdAt: Date,
updatedAt: Date
}Articles Collection:
{
title: String,
slug: String (auto-generated),
content: String,
excerpt: String,
author: ObjectId (ref: User),
tags: [String],
published: Boolean,
views: Number,
likes: Number,
createdAt: Date,
updatedAt: Date
}- Push code to GitHub
- Connect repository to Render/Railway
- Add environment variables
- Deploy
- Push code to GitHub
- Import repository to Vercel
- Add environment variables
- Deploy
# Backend
cd backend
npm test
# Frontend
cd frontend
npm testThis project demonstrates:
- β RESTful API design principles
- β MongoDB schema modeling and optimization
- β JWT authentication implementation
- β Serverless architecture with Google Cloud
- β Next.js SSR and SSG patterns
- β TypeScript in full-stack development
- β Clean code architecture
- β Modern DevOps practices
Building this project gave me hands-on experience with:
- MongoDB: Schema design, aggregation pipelines, indexing strategies
- Google Cloud Functions: Serverless deployment, cold start optimization
- Next.js: Server-side rendering, static generation, API routes
- Authentication: JWT implementation, secure password hashing
- API Design: REST best practices, middleware patterns, error handling
- Live Demo: [Your Vercel URL]
- API Documentation: [Your Backend URL]/api
- GitHub: [Your GitHub Repo]
Eric Kojo Abbey
- Location: Accra, Ghana
- LinkedIn: [Your LinkedIn]
- Email: kojoaeric@gmail.com
Built as a portfolio project to demonstrate full-stack development skills with modern technologies relevant to publishing platforms and content management systems.