This project is a mobile application built with Expo and React Native that provides a user-friendly interface for PSG Tech students to access their academic information.
Link to Backend Repository :
https://github.com/aknsubbu/psg-connect-backend
- User authentication
- Fetch and display student profile, attendance, exam results, and CA marks
- Offline support and data persistence
- Secure credential storage
- Automatic data refresh
- Node.js 12+
- Expo CLI
- Yarn or npm
-
Clone the repository:
git clone https://github.com/yourusername/psg-connect-frontend.git cd psg-connect-frontend
-
Install dependencies:
yarn install # or npm install
-
Set up environment variables: Create a
.env
file in the root directory and add the following:API_URL=your_api_url_here
Replace
your_api_url_here
with the URL where your backend API is hosted.
Start the Expo development server:
expo start
Use the Expo Go app on your mobile device to scan the QR code, or press 'i' to open in iOS Simulator or 'a' for Android Emulator.
The project includes the following key files and components:
studentDataManager.ts
: Manages data fetching, storage, and cachinguseStudentData.ts
: Custom hook for managing student data statesecureCredStorage.ts
: Handles secure storage of user credentials
The studentDataManager
is a singleton class that handles data fetching, local storage, and caching. Key features include:
- Fetching data from the server
- Storing data locally using Expo's FileSystem
- Implementing a fetch interval to refresh data periodically
- Checking network connectivity before making requests
Make sure to update the API_URL
constant in studentDataManager.ts
to match the URL in your .env
file:
const API_URL = process.env.API_URL || "your_default_api_url_here";
The useStudentData
hook provides a convenient way to manage student data in your components. It offers the following functionality:
- Login and logout
- Data fetching and refreshing
- Loading and error state management
Usage example:
const { data, isLoading, error, isLoggedIn, login, refreshData, logout } =
useStudentData();
The project uses Expo's SecureStore to safely store user credentials. The secureCredStorage.ts
file provides functions for saving, retrieving, and clearing credentials.
Ensure that the API_URL
in your .env
file and studentDataManager.ts
is correctly set to your backend API URL.
The application supports offline usage by storing fetched data locally. The studentDataManager
handles data persistence and retrieval.
- Fork the repository
- Create your feature branch:
git checkout -b feature/my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin feature/my-new-feature
- Submit a pull request