A modern, responsive web application for managing class routines at Chapainawabganj Polytechnic Institute. Built with Next.js 15, TypeScript, and featuring a beautiful animated UI. The frontend connects to a high-performance Fastify backend API for data management.
Frontend:
- Netlify: https://routine-cnpi.netlify.app
- Vercel: https://routine-cnpi.vercel.app
Backend API:
- Repository: https://github.com/xcfio/api
- Production API: https://api-xcfio.onrender.com/
This application follows a modern microservices architecture:
- Frontend: Next.js 15 application handling UI, routing, and user interactions
- Backend: Fastify API server managing data processing, database operations, and business logic
- Communication: RESTful API calls between frontend and backend services
- π¨ Modern UI/UX: Beautiful gradient backgrounds with floating animations
- π Dark/Light Theme: Automatic theme detection with manual toggle
- π± Fully Responsive: Optimized for all screen sizes
- β‘ Fast Performance: Built with Next.js 15 and TypeScript frontend + Fastify backend
- π Export Options: Download routines as JSON or PDF
- β¨οΈ Keyboard Shortcuts: Quick actions with keyboard shortcuts
- π Form Validation: Real-time form validation with visual feedback
- π High-Performance API: Powered by Fastify for fast data processing
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: CSS Modules with CSS Variables
- PDF Generation: jsPDF
- Fonts: Inter & JetBrains Mono
- API Framework: Fastify
- Repository: xcfio/api
- Deployment: Render.com
- Node.js 22+
- npm or pnpm
-
Clone the repository
git clone https://github.com/xcfio/cnpi-routine.git cd cnpi-routine -
Install dependencies
pnpm install
-
Set up environment variables
cp env.example .env # Edit .env with your API endpoint configurationAdd your backend API URL:
NEXT_PUBLIC_API_URL=https://api-xcfio.onrender.com # For local development: http://localhost:7200
-
Start development server
node --run dev # Runs on port 7700
If you want to run the backend locally as well:
-
Clone and setup the backend
git clone https://github.com/xcfio/api.git cd api npm install npm run dev # Runs on port 7200
-
Update your frontend .env
NEXT_PUBLIC_API_ENDPOINT=http://localhost:7200/
The frontend communicates with the Fastify backend through RESTful API calls. Here's the request/response format:
{
"year": "2025",
"department": "68",
"semester": "7",
"shift": "2",
"group": "A"
}{
"code": "68-7A2",
"load": "27",
"class": {
"Sunday": {
"1": {
"time": "01:30-02:15",
"subject": "Business Communication (25831)",
"teacher": "Md. Azizur Rahman (AR)",
"classroom": "S-419"
}
}
},
"teacher": [
{
"name": "Md. Azizur Rahman (AR)",
"designation": "Instructor (Non-Tech-Accounting)",
"mobile": "01724441634",
"subject": "Business Communication (25831)"
}
]
}Ctrl/Cmd + Enter: Submit formCtrl/Cmd + D: Download PDF (when routine is displayed)Ctrl/Cmd + J: Download JSON (when routine is displayed)Ctrl/Cmd + T: Toggle theme
The application uses CSS variables for theming. You can customize colors in app/globals.css:
:root {
--primary-gradient: linear-gradient(145deg, #0f4c81 0%, #1f8ecb 40%, #0f2027 100%);
--bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
/* ... other variables */
}Modify floating shapes and gradient orbs in components/AnimatedBackground.tsx and corresponding CSS animations.
To use a different backend or switch between production and local development:
- Update
NEXT_PUBLIC_API_ENDPOINTin your.envfile - Ensure the backend follows the same API contract shown above
- Update any API-specific configurations in your fetch calls
Local Development Ports:
- Frontend: http://localhost:7700
- Backend: http://localhost:7200
node --run build
node --run startThe application is optimized for performance with:
- Static Generation: Pre-rendered pages where possible
- Client-side Caching: Efficient data fetching and caching strategies
- Fast Backend: Fastify API provides sub-millisecond response times
- CDN Deployment: Frontend deployed on global CDN (Netlify/Vercel)
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit changes:
git commit -am 'Add feature' - Push to branch:
git push origin feature-name - Submit a pull request
For backend contributions, please visit the API repository.
- Backend API: xcfio/api - Fastify backend service
- Frontend: xcfio/cnpi-routine - This Next.js application
This project is licensed under the MIT License - see the LICENSE file for details.
For support or questions:
- Frontend issues: Open an issue in this repository
- Backend/API issues: Open an issue in the API repository
- General discussion: Join our Discord community