A powerful Trello-like project management API built with Node.js, TypeScript, Express, and TypeORM.
- Authentication & Authorization: JWT-based auth with Google OAuth2 support
- Role-Based Access Control (RBAC): Comprehensive permission system with 6 different roles
- Workspace Management: Create and manage multiple workspaces
- Board & List Management: Organize work with boards and lists
- Card Management: Full CRUD operations with attachments, comments, checklists
- Real-time Notifications: Activity tracking and notifications
- File Upload: Cloudinary integration for attachments
- Caching: Redis for improved performance
- Database: MySQL with TypeORM migrations
- Runtime: Node.js with TypeScript
- Framework: Express.js
- Database: MySQL 8.0
- ORM: TypeORM
- Cache: Redis
- Authentication: JWT + Passport.js (Google OAuth2)
- File Storage: Cloudinary
- Logging: Pino
- Validation: Joi
- Users: User accounts with profile information
- Roles & Permissions: 6 roles with 83+ granular permissions
- Workspaces: Team collaboration spaces
- Boards: Project boards within workspaces
- Lists: Task organization within boards
- Cards: Individual tasks with rich features
- Comments: Card discussions
- Attachments: File attachments on cards
- Checklists: Task checklists on cards
- Notifications: System notifications
- Activity Logs: Audit trail of all actions
- Admin - System administrator with full access
- User - Regular user with basic permissions
- Admin Workspace - Workspace administrator
- Member Workspace - Workspace member
- Admin Board - Board administrator
- Member Board - Board member
- User Management (Create, Read, Update, Delete, Assign Roles)
- Workspace Management (Full CRUD + Member Management)
- Board Management (Full CRUD + Member Management)
- Content Management (Lists, Cards, Comments, Attachments, Checklists)
- Notification & Activity Management
- Node.js (v16+)
- Docker & Docker Compose
- MySQL 8.0
- Redis
-
Clone the repository
git clone <repository-url> cd be-advanced
-
Install dependencies
npm install
-
Environment Configuration Create a
.envfile in the root directory:# Database Configuration DB_HOST=localhost DB_USER=root DB_PASSWORD=password DB_DATABASE=trello DB_PORT=3307 # Redis Configuration REDIS_HOST=localhost REDIS_PORT=6379 # JWT Configuration JWT_SECRET=your-secret-key-here JWT_EXPIRES_IN=7d # Server Configuration PORT=3000 NODE_ENV=development # Cloudinary Configuration CLOUDINARY_CLOUD_NAME=your-cloud-name CLOUDINARY_API_KEY=your-api-key CLOUDINARY_API_SECRET=your-api-secret # Google OAuth GOOGLE_CLIENT_ID=your-google-client-id GOOGLE_CLIENT_SECRET=your-google-client-secret GOOGLE_REDIRECT_URI=http://localhost:3000/auth/google/callback
-
Start Database Services
docker-compose up -d db redis
-
Run Database Migrations
npm run typeorm:run
-
Seed Initial Data
npm run seed
This creates:
- Admin account (admin@gmail.com / admin)
- All roles and permissions
- Role-permission mappings
-
Start the Application
npm start
npm start- Start development server with nodemonnpm run seed- Seed database with initial datanpm run typeorm:generate -- --name=MigrationName- Generate new migrationnpm run typeorm:run- Run pending migrationsnpm run typeorm:revert-migration- Revert last migrationnpm run typeorm:create-migration -- --name=MigrationName- Create empty migration
After running the seed script, you can login with:
- Email: admin@gmail.com
- Password: admin
- Username: admin
POST /auth/login- User loginPOST /auth/register- User registrationGET /auth/google- Google OAuth loginPOST /auth/logout- User logout
GET /users- Get all usersGET /users/:id- Get user by IDPUT /users/:id- Update userDELETE /users/:id- Delete user
GET /workspaces- Get user workspacesPOST /workspaces- Create workspacePUT /workspaces/:id- Update workspaceDELETE /workspaces/:id- Delete workspacePOST /workspaces/:id/members- Add member to workspace
GET /boards- Get user boardsPOST /boards- Create boardPUT /boards/:id- Update boardDELETE /boards/:id- Delete boardPOST /boards/:id/members- Add member to board
GET /cards- Get cardsPOST /cards- Create cardPUT /cards/:id- Update cardDELETE /cards/:id- Delete cardPOST /cards/:id/comments- Add commentPOST /cards/:id/attachments- Add attachmentPOST /cards/:id/checklists- Add checklist
src/
βββ app.ts # Application entry point
βββ config/ # Configuration files
β βββ data-source.ts # TypeORM data source
β βββ redis.config.ts # Redis configuration
β βββ cloudinary.config.ts
βββ common/ # Shared utilities
β βββ base.entity.ts # Base entity class
β βββ enums/ # Enum definitions
β βββ utils/ # Utility functions
βββ middleware/ # Express middlewares
βββ modules/ # Feature modules
β βββ auth/ # Authentication
β βββ user/ # User management
β βββ workspace/ # Workspace management
β βββ board/ # Board management
β βββ card/ # Card management
β βββ ...
βββ routes/ # Route definitions
βββ seeds/ # Database seeders
βββ migration/ # TypeORM migrations
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
The project includes Docker configuration for easy deployment:
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose downCreate a new migration:
npm run typeorm:generate -- --name=AddNewFeatureRun migrations:
npm run typeorm:run- JWT token authentication
- Password hashing with bcrypt
- Role-based access control
- Input validation with Joi
- CORS protection
- Session management
- SQL injection prevention (TypeORM)
- Redis caching
- Database indexing
- Optimized queries with TypeORM
- Background task processing
- File upload optimization
- Centralized error handling middleware
- Structured error responses
- Logging with Pino
- Validation error formatting
For support and questions, please contact the development team or create an issue in the repository.
This project is licensed under the ISC License.