Skip to content

Latest commit

Β 

History

75 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PlanGen - Smart Planning & Task Management

Node.js Express.js MongoDB Vite License: MIT


πŸ“Œ Introduction

PlanGen is a fullstack microservices project designed for project, task, and schedule management. It provides clean APIs, scalable architecture, and an intuitive frontend to help users plan and organize effectively.

The application uses a microservices architecture:

  • API Gateway (TypeScript + Express) - Routes requests to services
  • Auth Service (TypeScript + Express + PostgreSQL) - User authentication and authorization
  • Plan Service (Python + FastAPI + MongoDB) - Plan management
  • Template Service (Python + FastAPI + MongoDB) - Template management
  • Frontend (React + TypeScript + Vite) - User interface

✨ Features

  • πŸ“… Project & Task Management
  • πŸ‘₯ Multi-user Support
  • πŸ”” Notifications & Scheduling
  • πŸ“Š Dashboard & Analytics (planned)
  • πŸ›‘οΈ Secure Authentication & Authorization
  • ⚑ Fast frontend powered by Vite
  • 🌐 REST API backend powered by Express.js

πŸ—οΈ Tech Stack

Frontend

  • Framework: React 19 + TypeScript
  • Build Tool: Vite
  • Styling: TailwindCSS
  • State Management: Redux Toolkit
  • Validation: Zod

Backend

  • API Gateway: Express.js + TypeScript
  • Auth Service: Express.js + TypeScript + PostgreSQL (Prisma)
  • Plan Service: FastAPI + Python + MongoDB
  • Template Service: FastAPI + Python + MongoDB
  • Caching: Redis (optional for MVP)
  • Security: Helmet, CORS, JWT

Databases

  • PostgreSQL: User data and authentication
  • MongoDB: Plans and templates data

πŸ“‚ Project Structure

PlanGen/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ api-gateway/          # API Gateway (TypeScript + Express)
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ core/         # Environment, logger, shutdown
β”‚   β”‚   β”‚   β”œβ”€β”€ middlewares/  # CORS, error handling, rate limiting
β”‚   β”‚   β”‚   β”œβ”€β”€ proxy/        # Service proxy configuration
β”‚   β”‚   β”‚   └── types/        # Type definitions
β”‚   β”‚   └── package.json
β”‚   β”‚
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ auth-service/     # Auth Service (TypeScript + Express + PostgreSQL)
β”‚   β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ repos/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚   β”‚   └── infrastructure/database/  # Prisma schema
β”‚   β”‚   β”‚   └── package.json
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ plan-service/    # Plan Service (Python + FastAPI + MongoDB)
β”‚   β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ domain/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ infra/
β”‚   β”‚   β”‚   β”‚   └── types/
β”‚   β”‚   β”‚   └── requirements.txt
β”‚   β”‚   β”‚
β”‚   β”‚   └── template-service/ # Template Service (Python + FastAPI + MongoDB)
β”‚   β”‚       └── src/
β”‚   β”‚
β”‚   └── infra/
β”‚       └── docker/
β”‚           └── docker-compose.yml
β”‚
β”œβ”€β”€ frontend/                 # Frontend (React + TypeScript + Vite)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ store/
β”‚   β”‚   └── config/
β”‚   └── package.json
β”‚
β”œβ”€β”€ refs/                     # Planning and documentation
β”œβ”€β”€ .gitignore
└── README.md

πŸš€ Getting Started

πŸ”§ Prerequisites

Make sure you have installed:

βš™οΈ Environment Setup

  1. Copy environment example files:

    # API Gateway
    cp backend/api-gateway/.env.example backend/api-gateway/.env
    
    # Auth Service
    cp backend/services/auth-service/.env.example backend/services/auth-service/.env
    
    # Plan Service
    cp backend/services/plan-service/.env.example backend/services/plan-service/.env
    
    # Template Service
    cp backend/services/template-service/.env.example backend/services/template-service/.env
    
    # Frontend
    cp frontend/.env.example frontend/.env
  2. Update .env files with your configuration:

    • Set database connection strings
    • Generate strong JWT secrets (use openssl rand -hex 32)
    • Configure service URLs and ports

πŸš€ Running Services

Terminal 1 - API Gateway:

cd backend/api-gateway
npm install
npm run dev
# Runs on http://localhost:3000

Terminal 2 - Auth Service:

cd backend/services/auth-service
npm install
npm run prisma:generate
npm run prisma:push
npm run dev
# Runs on http://localhost:3001

Terminal 3 - Plan Service:

cd backend/services/plan-service
pip install -r requirements.txt
uvicorn src.main:app --reload --port 3003
# Runs on http://localhost:3003

Terminal 4 - Template Service:

cd backend/services/template-service
pip install -r requirements.txt
uvicorn src.main:app --reload --port 3002
# Runs on http://localhost:3002

Terminal 5 - Frontend:

cd frontend
npm install
npm run dev
# Runs on http://localhost:5173

🐳 Docker Setup (Alternative)

cd backend/infra/docker
docker-compose up -d

Visit the app at: http://localhost:5173


⚑ Deployment

  • Frontend can be deployed on Vercel, Netlify, or Render (Static Site).
  • Backend can be deployed on Render, Railway, or Heroku.

Example: For Render

  • Backend β†’ Web Service (Node.js)
  • Frontend β†’ Static Site (build with npm run build, output = dist)

πŸ§ͺ Scripts

Backend

npm run dev   # Run with nodemon (dev mode)
npm start     # Run production

Frontend

npm run dev   # Local development
npm run build # Production build
npm run preview # Preview production build

πŸ“– API Documentation

Base URL

All API requests go through the API Gateway: http://localhost:3000/api/v1

Authentication Endpoints

  • POST /auth/register - User registration
  • POST /auth/login - User login
  • POST /auth/logout - User logout
  • POST /auth/refresh - Refresh access token

Plan Endpoints

  • GET /plans - Get all plans
  • GET /plans/:id - Get plan by ID
  • POST /plans - Create plan
  • PUT /plans/:id - Update plan
  • DELETE /plans/:id - Delete plan

Template Endpoints

  • GET /templates - Get all templates
  • GET /templates/:id - Get template by ID
  • POST /templates - Create template
  • PUT /templates/:id - Update template
  • DELETE /templates/:id - Delete template

Health Check Endpoints

  • GET /health - API Gateway health
  • GET /api/health - Auth Service health
  • GET /api/health - Plan Service health
  • GET /health - Template Service health

(Full OpenAPI documentation coming soon)


🀝 Contributing

Contributions are welcome!

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/YourFeature)
  3. Commit changes (git commit -m 'Add new feature')
  4. Push to branch (git push origin feature/YourFeature)
  5. Open a Pull Request

πŸ“œ License

This project is licensed under the MIT License.


πŸ‘¨β€πŸ’» Author

Developed with ❀️ by Harsh

About

PlanGen is a fullstack project designed for project, task, and schedule management. It provides clean APIs, scalable architecture, and an intuitive frontend to help users plan and organize effectively.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages