Skip to content

Commit 5176f46

Browse files
authored
Add files via upload
1 parent a4b2308 commit 5176f46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+16108
-1
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Jhun Ray Omiping
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,94 @@
1-
# LeaveManagementMobileApp
1+
# Streamlined Leave Management System
2+
23
The Streamlined Leave Management System is a mobile application developed using React Native with Expo. It is designed to simplify and optimize the employee leave management process for the Local Government Unit (LGU) of Maasin City.
4+
5+
## Table of Contents
6+
7+
- [Screenshots](#screenshots)
8+
- [Key Features](#key-features)
9+
- [Technologies Used](#technologies-used)
10+
- [Installation](#installation)
11+
- [Usage](#usage)
12+
- [Known Issues](#known-issues)
13+
- [Contributing](#contributing)
14+
- [License](#license)
15+
- [Contact](#contact)
16+
17+
## Screenshots
18+
19+
![Screenshot 1](./assets/images/img1.png)
20+
![Screenshot 2](./assets/images/img2.png)
21+
![Screenshot 3](./assets/images/img3.png)
22+
23+
## Key Features
24+
25+
- Mobile-friendly leave request submission
26+
- Real-time leave balance tracking
27+
28+
## Technologies Used
29+
30+
- React Native
31+
- Expo
32+
- JavaScript
33+
34+
## Installation
35+
36+
1. Clone the repository:
37+
```sh
38+
git clone https://github.com/qw87rt/LeaveManagementMobileApp
39+
```
40+
41+
2. Navigate to the project directory:
42+
```sh
43+
cd LeaveManagementMobileApp
44+
```
45+
46+
3. Install the required dependencies:
47+
```sh
48+
npm install
49+
```
50+
51+
4. Launch the development server:
52+
```sh
53+
npm start
54+
```
55+
56+
5. Use the Expo Go app on your mobile device to scan the QR code displayed in the terminal or Expo Dev Tools.
57+
58+
> Note: The file responsible for sending and fetching data is located at `components/servercon/api.js`. The actual base URL configuration has been omitted for privacy reasons.
59+
60+
## Usage
61+
62+
1. Install & Launch the Streamlined Leave Management System app on your mobile device.
63+
64+
Download link: [https://mega.nz/file/vfI1yIqK#l1qijx3TcpcQRepQV6r2-90YBC5CX7hEkyQts-s2j0g](https://mega.nz/file/vfI1yIqK#l1qijx3TcpcQRepQV6r2-90YBC5CX7hEkyQts-s2j0g)
65+
66+
2. Log in using the provided credentials below:
67+
68+
```
69+
UserID: 100182
70+
Password: nw2pak
71+
```
72+
73+
3. Navigate through the app to perform various tasks:
74+
- Submit leave requests
75+
- View your current leave balance
76+
- Monitor the status of your leave requests
77+
78+
## Known Issues
79+
80+
The Streamlined Leave Management System needs to be rewritten for optimization.
81+
82+
## Contributing
83+
84+
Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.
85+
86+
## License
87+
88+
This project is licensed under the [MIT License](LICENSE).
89+
90+
## Contact
91+
92+
For any inquiries or questions, please reach out at [[email protected]](mailto:[email protected]).
93+
94+
---

app.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"expo": {
3+
"scheme": "acme",
4+
"web": {
5+
"bundler": "metro"
6+
},
7+
"name": "Mobile Leave App",
8+
"slug": "MobileLeaveManagement",
9+
"icon": "./assets/launcher/icon.png",
10+
"extra": {
11+
"eas": {
12+
"projectId": "c9875f86-79e7-43c1-937d-9fabb03d6093"
13+
}
14+
},
15+
"android": {
16+
"package": "com.jhunray889.MobileLeaveManagement",
17+
"adaptiveIcon": {
18+
"foregroundImage": "./assets/launcher/adaptive-icon.png",
19+
"backgroundColor": "#FFFFFF"
20+
}
21+
}
22+
}
23+
}

app/_layout.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Stack } from 'expo-router';
2+
// import { useCallback } from 'react';
3+
// import { useFonts } from 'expo-font';
4+
// import * as SplashScreen from 'expo -splash-screen';
5+
6+
// SplashScreen.preventAutoHideAsync();
7+
8+
const Layout = () => {
9+
10+
return <Stack />
11+
}
12+
13+
export default Layout;

app/index.js

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
import React, { useState, useEffect } from 'react';
2+
import { StyleSheet, SafeAreaView, Text, TouchableOpacity } from 'react-native';
3+
import { getProtectedData, checkToken, refreshAccessToken } from '../components';
4+
import { useRouter, Stack } from 'expo-router';
5+
6+
const styles = StyleSheet.create({
7+
container: {
8+
flex: 1,
9+
backgroundColor: '#FFE8E6',
10+
alignItems: 'center',
11+
justifyContent: 'center',
12+
},
13+
input: {
14+
height: 40,
15+
margin: 12,
16+
borderWidth: 1,
17+
padding: 10,
18+
borderColor: '#D46A7E',
19+
color: '#D46A7E'
20+
},
21+
button: {
22+
color: '#D46A7E',
23+
borderColor: '#D46A7E',
24+
borderWidth: 1
25+
}
26+
});
27+
28+
const LoginScreen = () => {
29+
const [data, setData] = useState(null);
30+
const [loading, setLoading] = useState(true);
31+
const [error, setError] = useState(false);
32+
const router = useRouter();
33+
34+
useEffect(() => {
35+
36+
37+
const checkAndFetchData = async () => {
38+
try {
39+
const isValid = await checkToken();
40+
41+
if (!isValid) {
42+
console.log('Access token is expired or invalid.');
43+
console.log('Fetching a new access token...');
44+
45+
// refresh the access token if it has expired
46+
await refreshAccessToken();
47+
48+
console.log('New access token fetched.');
49+
}
50+
51+
const response = await getProtectedData();
52+
if (response) {
53+
setData(response); // Update the state with the response data
54+
} else {
55+
setError(true);
56+
}
57+
router.replace('./screens/Home/HomeScreen');
58+
// router.push('./screens/Home/HomeScreen');
59+
60+
61+
} catch (error) {
62+
console.error('Error:', error);
63+
setError(true);
64+
router.replace('./screens/loginScreen');
65+
//router.push('./screens/loginScreen');
66+
}
67+
68+
setLoading(false);
69+
};
70+
71+
72+
// Function call
73+
checkAndFetchData();
74+
75+
}, []);
76+
77+
78+
79+
80+
return (
81+
<SafeAreaView style={styles.container}>
82+
<Stack.Screen
83+
options={{
84+
headerStyle: { backgroundColor: '#fc03a1'},
85+
headerShadowVisible: false,
86+
headerLeft: () => (
87+
<Text> </Text>
88+
),
89+
headerTitle: "Leave Management System",
90+
headerTitleStyle: { color: '#fff', fontSize: 24}
91+
92+
}}
93+
/>
94+
<Text style={{ color: '#fc03a1', fontWeight: 'bold', fontStyle: 'italic', fontSize: 17 }}>Retrieving Data, Please Wait...</Text>
95+
{/* <TouchableOpacity
96+
style={{backgroundColor: 'red', padding: 10, alignItems: 'center', justifyContent: 'center'}}
97+
onPress={() => {
98+
router.push('./screens/Home/HomeScreen');
99+
}}
100+
>
101+
<Text style={{color: 'white'}}>RELOAD</Text>
102+
</TouchableOpacity> */}
103+
104+
105+
</SafeAreaView>
106+
);
107+
};
108+
109+
export default LoginScreen;
110+
111+

0 commit comments

Comments
 (0)