A full-stack task management application with custom authentication, built with React, TypeScript, Express.js, and PostgreSQL.
- Frontend: React + TypeScript + Vite + Tailwind CSS + shadcn/ui
- Backend: Express.js + TypeScript + REST APIs
- Database: PostgreSQL
- Authentication: JWT + OAuth (Google, Facebook, GitHub)
- Node.js (v18 or higher)
- PostgreSQL (v14 or higher)
- npm or yarn
git clone <your-repo-url>
cd orbit-task-nexus-uinpm installcd server
npm install
cd ..Create a new PostgreSQL database:
# Connect to PostgreSQL
psql -U postgres
# Create database
CREATE DATABASE orbit_task_nexus;
# Exit psql
\qCreate a .env file in the root directory:
VITE_API_URL=http://localhost:5000/apiCreate a server/.env file:
# Server Configuration
PORT=5000
NODE_ENV=development
# Database Configuration
DATABASE_URL=postgresql://postgres:yourpassword@localhost:5432/orbit_task_nexus
DB_HOST=localhost
DB_PORT=5432
DB_NAME=orbit_task_nexus
DB_USER=postgres
DB_PASSWORD=yourpassword
# JWT Configuration
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
JWT_EXPIRES_IN=7d
# Session Configuration
SESSION_SECRET=your-super-secret-session-key-change-this-in-production
# OAuth Configuration - Google (Optional)
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_CALLBACK_URL=http://localhost:5000/api/auth/google/callback
# OAuth Configuration - Facebook (Optional)
FACEBOOK_APP_ID=your-facebook-app-id
FACEBOOK_APP_SECRET=your-facebook-app-secret
FACEBOOK_CALLBACK_URL=http://localhost:5000/api/auth/facebook/callback
# OAuth Configuration - GitHub (Optional)
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
GITHUB_CALLBACK_URL=http://localhost:5000/api/auth/github/callback
# Frontend URL
FRONTEND_URL=http://localhost:5173
# CORS Origins
CORS_ORIGINS=http://localhost:5173,http://localhost:3000cd server
npm run migrate
cd ..Terminal 1 - Backend:
cd server
npm run devTerminal 2 - Frontend:
npm run devAdd to root package.json:
{
"scripts": {
"dev": "concurrently \"npm run dev\" \"cd server && npm run dev\"",
"dev:frontend": "vite",
"dev:backend": "cd server && npm run dev"
},
"devDependencies": {
"concurrently": "^8.2.2"
}
}Then run:
npm install concurrently --save-dev
npm run dev- Frontend: http://localhost:5173
- Backend API: http://localhost:5000/api
- Health Check: http://localhost:5000/health
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URI:
http://localhost:5000/api/auth/google/callback - Copy Client ID and Client Secret to your
.envfile
- Go to Facebook Developers
- Create a new app
- Add Facebook Login product
- Add redirect URI:
http://localhost:5000/api/auth/facebook/callback - Copy App ID and App Secret to your
.envfile
- Go to GitHub Settings
- Create a new OAuth App
- Set callback URL:
http://localhost:5000/api/auth/github/callback - Copy Client ID and Client Secret to your
.envfile
POST /api/auth/register- Register new userPOST /api/auth/login- Login with email/usernameGET /api/auth/profile- Get user profilePUT /api/auth/profile- Update user profileGET /api/auth/google- Google OAuthGET /api/auth/facebook- Facebook OAuthGET /api/auth/github- GitHub OAuth
GET /api/tasks- Get all tasksGET /api/tasks/:id- Get task by IDPOST /api/tasks- Create new taskPUT /api/tasks/:id- Update taskDELETE /api/tasks/:id- Delete taskPOST /api/tasks/:taskId/subtasks- Add subtaskPUT /api/tasks/:taskId/subtasks/:subtaskId- Update subtaskDELETE /api/tasks/:taskId/subtasks/:subtaskId- Delete subtask
GET /api/categories- Get all categoriesPOST /api/categories- Create categoryPUT /api/categories/:id- Update categoryDELETE /api/categories/:id- Delete category
# Frontend
npm run test
# Backend
cd server
npm run test# Build frontend
npm run build
# Build backend
cd server
npm run build- Ensure PostgreSQL is running
- Check database credentials in
.env - Verify database exists:
psql -U postgres -l
- Change
PORTinserver/.env - Change
VITE_API_URLin frontend.env
- Verify callback URLs match exactly
- Check OAuth credentials are correct
- Ensure OAuth apps are in development/production mode