
Welcome to the LearnFlow backend repository! This Node.js/Express.js API (with TypeScript, Prisma, and MySQL) powers a dynamic learning platform. It handles user authentication, AI-driven resource recommendations, and progress tracking for self-learners.
Explore the project »
·
Report Bug
·
Request Feature
Table of Contents
LearnFlow is a smart, adaptive platform that helps users set and track their personal learning goals, such as “Learn Python” or “Master React.” By leveraging basic AI/NLP techniques, it recommends relevant free online resources (articles, videos, courses) to support each user’s unique learning path. Users can log their progress, maintain streaks, and receive weekly learning recommendations to stay motivated.
-
Goal Setting and Management
Users can create learning goals and break them down into smaller, manageable tasks. -
AI-Driven Resource Recommendations
The system uses libraries likecompromise
andnatural
to analyze goals and suggest relevant resources from public APIs (Wikipedia, MDN). -
Progress Tracking
Users can Track their progress, update streaks, and visualize learning progress. -
User Authentication & Authorization
Secure login and API access control via JSON Web Tokens (JWT). -
RESTful Endpoints
Organized routes for goals, resources, analytics, and user management.
This backend is powered by a modern, scalable stack ensuring robust performance and maintainability:
This section will guide you through setting up the LearnFlow BACKEND on your local machine.
- Node.js (v22+ recommended)
Download & Install Node.js - MySQL (or a compatible SQL database)
Download & Install MySQL - npm or yarn (npm comes bundled with Node.js)
Install Yarn if you prefer Yarn - Postman (optional for API testing)
Download Postman
-
Clone the repository
git clone https://github.com/gayanukabulegoda/LearnFlow-BACKEND.git
Navigate into the project directory:
cd LearnFlow-BACKEND
-
Install dependencies
npm install
or
yarn install
-
Configure Environment Variables
Create a.env
file in the root directory and set the following variables (example):DATABASE_URL="mysql://<username>:<password>@localhost:3306/learnflow_db" JWT_SECRET="your_jwt_secret_key" JWT_EXPIRES_IN="in_days, hours, minutes or seconds (e.g., 7d)" PORT=5000 NODE_ENV=development CLIENT_URL=http://localhost:3000 CURRENT_API_VERSION=v1
Adjust the values according to your local or production environment.
-
Database Setup with Prisma
Initialize or migrate your database schema:npx prisma migrate dev
This command will create or update your database schema according to the Prisma schema definition in
prisma/schema.prisma
.
-
Start the development server
npm run dev
or
yarn dev
The server should now be running at http://localhost:5000.
-
Production build and run
npm run build npm start
or
yarn build yarn start
This will compile TypeScript to JavaScript and run the production build.
-
Testing (optional)
If you have unit or integration tests, you can run:npm run test
or
yarn test
Comprehensive API documentation (including endpoints, request/response examples, and environment setups) can be found in the Postman Collection.
- Make sure the server is running locally (or remotely) before sending requests to the provided endpoints.
- The Postman documentation also includes sample payloads and environment variables for quicker testing.
The frontend for this project is built with React. Visit the LearnFlow FRONTEND repository for more details:
Distributed under the MIT License. See LICENSE
for more information.
© 2025 Gayanuka Bulegoda