A full-stack Knowledge Base Management System built with React, Express, TypeScript, and PostgreSQL. The application allows users to organize, search, and manage documentation across multiple knowledge bases with a modern, professional interface.
- Knowledge Base Management - Create and organize multiple knowledge bases
- Document Management - Upload, organize, and manage documents
- Advanced Search - Search across all content with highlighting
- User Authentication - Secure login and session management
- Modern UI - Professional interface built with shadcn/ui and TailwindCSS
- Responsive Design - Works seamlessly on desktop and mobile devices
- React 18 with TypeScript
- Vite - Fast build tool and development server
- Wouter - Lightweight client-side routing
- TanStack Query - Server state management and caching
- shadcn/ui - Component library built on Radix UI
- TailwindCSS - Utility-first CSS framework
- Lucide React - Icon library
- Express.js - Web application framework
- TypeScript - Type-safe server code
- PostgreSQL - Database (via Neon serverless)
- Drizzle ORM - Type-safe database queries
- Session Management - Express-session with PostgreSQL store
- tsx - TypeScript execution for development
- esbuild - Fast bundler for production
- Drizzle Kit - Database migrations
├── client/ # Frontend React application
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── contexts/ # React contexts (Auth, etc.)
│ │ ├── hooks/ # Custom React hooks
│ │ └── lib/ # Utilities and helpers
│ └── index.html # HTML entry point
├── server/ # Backend Express application
│ ├── index.ts # Server entry point
│ ├── routes.ts # API routes
│ ├── storage.ts # Storage interface
│ └── vite.ts # Vite integration
├── shared/ # Shared code between client and server
│ └── schema.ts # Database schema and types
└── dist/ # Production build output
- Node.js 20+ (recommended)
- npm or yarn
- PostgreSQL database (or Neon account for serverless PostgreSQL)
-
Clone the repository
git clone <repository-url> cd InfoBaseManager
-
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory:DATABASE_URL=postgresql://user:password@localhost:5432/dbname PORT=5000 NODE_ENV=development
-
Set up the database
Run database migrations:
npm run db:push
Start the development server with hot module replacement:
npm run devThe application will be available at http://localhost:5000
- Hot Module Replacement (HMR) for instant updates
- TypeScript type checking
- Automatic server restart on file changes
- Vite-powered fast refresh
-
Build the application
npm run build
This will:
- Build the React frontend with Vite
- Bundle the Express backend with esbuild
- Output everything to the
dist/directory
-
Start the production server
npm start
npm run dev- Start development server with HMRnpm run build- Build for productionnpm start- Start production servernpm run check- Run TypeScript type checkingnpm run db:push- Push database schema changes
| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | Required |
PORT |
Server port | 5000 |
NODE_ENV |
Environment mode | development |
This project uses PostgreSQL with Drizzle ORM. The schema is defined in shared/schema.ts.
- Install PostgreSQL on your system
- Create a database:
CREATE DATABASE knowledge_base;
- Update
DATABASE_URLin your.envfile - Run migrations:
npm run db:push
- Create a free account at neon.tech
- Create a new project and database
- Copy the connection string to your
.envfile asDATABASE_URL - Run migrations:
npm run db:push
- The application currently uses an in-memory storage implementation (
MemStorageclass inserver/storage.ts) - This is a placeholder for development and testing
- The database schema and ORM configuration are prepared but not yet connected to the routes
- To switch to PostgreSQL-backed storage, update the routes in
server/routes.tsto use a Drizzle-based storage implementation - The schema is already defined and ready in
shared/schema.ts - Session management is configured to use PostgreSQL via
connect-pg-simple
- Currently implements a basic authentication flow
- User passwords should be hashed using bcrypt or argon2 before production use
- Session persistence is handled via localStorage on the client and PostgreSQL on the server
The application follows a professional design system with:
- Consistent spacing and typography
- Clear information hierarchy
- Accessible components from Radix UI
- Custom design guidelines in
design_guidelines.md
This application can be deployed to any Node.js hosting platform:
-
Create a
Dockerfilein the root:FROM node:20-alpine WORKDIR /app COPY package*.json ./ RUN npm ci --only=production COPY . . RUN npm run build EXPOSE 5000 CMD ["npm", "start"]
-
Build and run:
docker build -t knowledge-base . docker run -p 5000:5000 --env-file .env knowledge-base
- Heroku: Supports Node.js apps with PostgreSQL add-on
- Railway: Easy deployment with PostgreSQL
- Render: Supports Node.js with managed PostgreSQL
- AWS: Deploy with Elastic Beanstalk or ECS
- Google Cloud: Deploy with Cloud Run or App Engine
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
For issues and questions, please open an issue on the GitHub repository.