A comprehensive backend system powering the PictoCreds mobile app for managing meetings, tasks, attendance, teams, and user authentication with real-time notifications.
-
Authentication & Authorization
- JWT-based authentication
- Google OAuth integration
- Role-based access control (Admin/User)
- Password reset with OTP verification
- FCM token management for push notifications
-
Meeting Management
- Create, update, and delete meetings
- Meeting scheduling and notifications
- Automated meeting reminders (via cron jobs)
-
Task Management
- Task creation and assignment
- Task tracking and status updates
-
Attendance Tracking
- Attendance logging and management
- Attendance reports
-
Team Collaboration
- Team creation and management
- Team member management
-
Tag System
- Categorization with tags
- Tag-based filtering
- Node.js (v14 or higher)
- MongoDB
- Firebase account (for push notifications)
- Google OAuth credentials (optional, for Google login)
- Clone the repository
git clone https://github.com/Pictoreal-Organization/CCA-backend
cd cca-backend- Install dependencies
npm install-
Environment Setup
Create a
.envfile in the root directory:
PORT=5001
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
JWT_REFRESH_SECRET=your_refresh_token_secret
# Email Configuration (for OTP)
EMAIL_USER=your_email@example.com
EMAIL_PASSWORD=your_email_password
# Google OAuth
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
# Firebase Admin SDK
FIREBASE_PROJECT_ID=your_project_id
FIREBASE_PRIVATE_KEY=your_private_key
FIREBASE_CLIENT_EMAIL=your_client_email
# Keep-Alive URL (for Render.com or similar)
BACKEND_URL=https://your-backend-url.com/dummy-
Firebase Service Account Setup
Create a
firebase-service-account.jsonfile in the root directory with your Firebase Admin SDK credentials:
{
"type": "service_account",
"project_id": "your-project-id",
"private_key_id": "your-private-key-id",
"private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
"client_email": "firebase-adminsdk-xxxxx@your-project.iam.gserviceaccount.com",
"client_id": "your-client-id",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "your-cert-url"
}π Note: This file is gitignored for security. Download it from your Firebase Console β Project Settings β Service Accounts
-
Seed the database (optional)
Populate the database with Pictoreal team members from CSV files. See Database Seeding section below for detailed instructions.
npm run seed- Generate Swagger documentation
npm run swaggernpm run devnpm startThe server will start on http://localhost:5001
To populate the database with Pictoreal team members from CSV files:
-
Ensure CSV files are present in the
All_csvs/folder:core_team.csv- Contains core team/heads informationmembers.csv- Contains member information
-
Run the seed command:
npm run seedThis will automatically:
- Import all core team members and heads from
core_team.csv - Import all regular members from
members.csv - Create necessary teams and assign members
- Set initial passwords (username from email)
β οΈ Note: Verify CSV data before running seed command. The script will create/update users and teams based on CSV content.
cca-backend/
βββ controllers/ # Business logic for each route
βββ models/ # MongoDB schemas
βββ routes/ # API route definitions
βββ middlewares/ # Custom middleware (auth, validation, etc.)
βββ cron/ # Scheduled jobs (meeting reminders, etc.)
βββ config/ # Configuration files
βββ All_csvs/ # CSV files containing Pictoreal team member data
β βββ *.csv # Team member information (check before seeding)
βββ importCoreTeam.js # Script to import core team/heads into database
βββ importMembers.js # Script to import members into database
βββ db.js # Database connection
βββ index.js # Application entry point
βββ swagger-init.js # Swagger documentation generator
βββ seed.js # Database seeding script
βββ firebase-service-account.json # Firebase Admin SDK credentials (gitignored)
βββ .env # Environment variables (gitignored)
Before running the application, ensure these files are properly set up:
All_csvs/folder - Contains CSV files with Pictoreal team member data. Verify the data is up-to-date before importing.importCoreTeam.js- Run this to add team heads/core members to the databaseimportMembers.js- Run this to add regular members to the databasefirebase-service-account.json- Required for Firebase push notifications (download from Firebase Console)
Once the server is running, access the interactive API documentation at:
http://localhost:5001/docs
The Swagger UI provides complete details for all endpoints including:
- Request/response schemas
- Authentication requirements
- Example requests
- Try-it-out functionality
The API is organized into the following modules:
- Authentication (
/api/auth) - User authentication, registration, login, password management, and OAuth - Meetings (
/api/meetings) - Meeting creation, scheduling, updates, and automated reminders - Tasks (
/api/tasks) - Task management, assignment, and status tracking - Users (
/api/user) - User profile management and user-related operations - Admin (
/api/admin) - Administrative operations (requires admin privileges) - Attendance (
/api/attendance) - Attendance logging, tracking, and reporting - Teams (
/api/teams) - Team creation, management, and collaboration features - Tags (
/api/tags) - Tag-based categorization and filtering system
π‘ Tip: Visit
/docsendpoint after starting the server to explore all available routes with detailed documentation.
The API uses JWT (JSON Web Tokens) for authentication. Include the token in the Authorization header:
Authorization: Bearer <your_jwt_token>
- Admin: Full access to all endpoints
- User: Limited access based on permissions
- express - Web framework
- mongoose - MongoDB ODM
- jsonwebtoken - JWT authentication
- bcrypt - Password hashing
- cors - Cross-origin resource sharing
- dotenv - Environment variable management
- google-auth-library - Google OAuth
- firebase-admin - Firebase push notifications
- node-cron - Scheduled tasks
- nodemailer - Email sending
- morgan - HTTP request logger
- axios - HTTP client
- csv-parser - Parse CSV files for member imports
- swagger-autogen - Auto-generate Swagger docs
- swagger-ui-express - Swagger UI interface
The application runs automated tasks using node-cron:
- Meeting Reminders: Sends notifications for upcoming meetings
- Keep-Alive Ping: Prevents server sleep on free hosting (runs every 10 minutes)
npm testThe application is configured for deployment on platforms like Render.com, Heroku, or similar.
- The keep-alive mechanism pings the server every 10 minutes to prevent cold starts
- Update
BACKEND_URLin.envwith your production URL - Ensure all environment variables are set in your hosting platform
- Upload
firebase-service-account.jsonsecurely to your hosting platform
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
npm run dev- Start development server with nodemonnpm run swagger- Generate Swagger documentationnpm run seed- Seed database with initial datanpm test- Run tests
- Ensure MongoDB is running
- Check
MONGODB_URIin.env - Whitelist your IP in MongoDB Atlas (if using cloud)
- Run
npm run swaggerto regenerate documentation - Restart the server
- Verify Firebase credentials in
.env - Ensure
firebase-service-account.jsonis properly configured - Check that FCM tokens are properly saved
- Verify CSV files in
All_csvs/folder are properly formatted - Check that CSV headers match expected format
- Run
importCoreTeam.jsandimportMembers.jsin the correct order
ISC
![]() Riddhi Lahare |
![]() Manas Gawali |
![]() Madhura Deshmukh |
For issues or questions, please contact pictorealcca@gmail.com
Made with β€οΈ by the Pictoreal Team


