app-expo-cli 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/bin/index.js +3 -0
  2. package/bun.lock +82 -0
  3. package/package.json +26 -0
  4. package/src/copy-template.js +156 -0
  5. package/src/create-expo.js +10 -0
  6. package/src/index.js +39 -0
  7. package/src/install-deps.js +22 -0
  8. package/src/utils/logger.js +29 -0
  9. package/tailwind.config.js +69 -0
  10. package/template/src/app/_layout.tsx +61 -0
  11. package/template/src/app/auth/_layout.tsx +41 -0
  12. package/template/src/app/auth/change_pass.tsx +138 -0
  13. package/template/src/app/auth/change_pass_modal.tsx +74 -0
  14. package/template/src/app/auth/forgot.tsx +124 -0
  15. package/template/src/app/auth/index.tsx +274 -0
  16. package/template/src/app/auth/opt_verify.tsx +145 -0
  17. package/template/src/app/auth/register.tsx +334 -0
  18. package/template/src/app/auth/reset_pass.tsx +152 -0
  19. package/template/src/app/common/image.tsx +202 -0
  20. package/template/src/app/common/openurl.tsx +42 -0
  21. package/template/src/app/home/_layout.tsx +29 -0
  22. package/template/src/app/home/drawer/_layout.tsx +27 -0
  23. package/template/src/app/home/tabs/_layout.tsx +75 -0
  24. package/template/src/app/home/tabs/index.tsx +11 -0
  25. package/template/src/app/index.tsx +11 -0
  26. package/template/src/app/modals/confirmation_logout_modal.tsx +78 -0
  27. package/template/src/app/modals/payment_modal.tsx +105 -0
  28. package/template/src/app/modals/success_modal.tsx +72 -0
  29. package/template/src/app/modals/toaster.tsx +31 -0
  30. package/template/src/app/settings/_layout.tsx +19 -0
  31. package/template/src/app/settings/about_us.tsx +61 -0
  32. package/template/src/app/settings/privacy_policy.tsx +61 -0
  33. package/template/src/app/settings/terms_and_conditions.tsx +60 -0
  34. package/template/src/hooks/useCheckLocation.ts +36 -0
  35. package/template/src/hooks/useDocPicker.ts +83 -0
  36. package/template/src/hooks/useImgePicker.ts +70 -0
  37. package/template/src/hooks/useSuggestionLocation.ts +36 -0
  38. package/template/src/hooks/useUploadProgress.ts +127 -0
  39. package/template/src/redux/api-config/baseApi.ts +89 -0
  40. package/template/src/redux/api-slices/authSlices.ts +175 -0
  41. package/template/src/redux/interface/common.ts +19 -0
  42. package/template/src/redux/interface/interface.ts +196 -0
  43. package/template/src/redux/interface/tag-types.ts +13 -0
  44. package/template/src/redux/service/demo.ts +27 -0
  45. package/template/src/redux/store.ts +17 -0
  46. package/template/src/utils/utils.ts +27 -0
@@ -0,0 +1,175 @@
1
+ import { api } from "../api-config/baseApi";
2
+ import { IUserFetch } from "../interface/interface";
3
+ import { tagTypes } from "../interface/tag-types";
4
+
5
+ const authSlice = api.injectEndpoints({
6
+ endpoints: (builder) => ({
7
+ getProfile: builder.query<IUserFetch, unknown>({
8
+ query: () => ({
9
+ url: `/auth/get-profile`,
10
+ }),
11
+ providesTags: [tagTypes.users],
12
+ }),
13
+ getOthersProfile: builder.query<IUserFetch, any>({
14
+ query: (id) => ({
15
+ url: `/auth/get-other-profile?id=${id}`,
16
+ }),
17
+ providesTags: [tagTypes.users],
18
+ }),
19
+
20
+ updateUser: builder.mutation<any, any>({
21
+ query: (data) => ({
22
+ url: `/auth`,
23
+ headers: {
24
+ "Content-Type": "multipart/form-data",
25
+ },
26
+ method: "PATCH",
27
+ body: data,
28
+ }),
29
+ invalidatesTags: [tagTypes.users],
30
+ }),
31
+
32
+ updateLocation: builder.mutation<any, any>({
33
+ query: (data) => ({
34
+ url: `/auth/location`,
35
+ method: "PATCH",
36
+ body: data,
37
+ }),
38
+ invalidatesTags: [tagTypes.users, tagTypes.post, tagTypes.activities],
39
+ }),
40
+ tokenCheck: builder.mutation<any, any>({
41
+ query: () => ({
42
+ url: `/auth/check-token`,
43
+ method: "POST",
44
+ }),
45
+ invalidatesTags: [tagTypes.users],
46
+ }),
47
+ login: builder.mutation<any, any>({
48
+ query: (data) => ({
49
+ url: `/auth/login`,
50
+ method: "POST",
51
+ body: data,
52
+ }),
53
+ invalidatesTags: [tagTypes.users],
54
+ }),
55
+ signUp: builder.mutation<any, any>({
56
+ query: (data) => ({
57
+ url: `/auth/signup`,
58
+ method: "POST",
59
+ body: data,
60
+ }),
61
+ invalidatesTags: [tagTypes.users],
62
+ }),
63
+ emailVerify: builder.mutation<any, any>({
64
+ query: (data) => ({
65
+ url: `/auth/verify-email`,
66
+ method: "POST",
67
+ body: data,
68
+ }),
69
+ invalidatesTags: [tagTypes.users],
70
+ }),
71
+ deleteUser: builder.mutation({
72
+ query: (id) => ({
73
+ url: `/auth/delete`,
74
+ method: "DELETE",
75
+ }),
76
+ invalidatesTags: [tagTypes.users],
77
+ }),
78
+
79
+ forgot: builder.mutation<any, any>({
80
+ query: (data) => ({
81
+ url: `/auth/forgot`,
82
+ method: "POST",
83
+ body: data,
84
+ }),
85
+ invalidatesTags: [tagTypes.users],
86
+ }),
87
+ resetPassword: builder.mutation<any, any>({
88
+ query: (data) => ({
89
+ url: `/auth/reset-password`,
90
+ method: "POST",
91
+ body: data,
92
+ }),
93
+ invalidatesTags: [tagTypes.users],
94
+ }),
95
+ changePassword: builder.mutation<any, any>({
96
+ query: (data) => ({
97
+ url: `/auth/change-password`,
98
+ method: "POST",
99
+ body: data,
100
+ }),
101
+ invalidatesTags: [tagTypes.users],
102
+ }),
103
+ // changeProfileImage: builder.mutation<any, any>({
104
+ // query: (photo) => ({
105
+ // url: `/auth/change-profile-photo`,
106
+ // method: "POST",
107
+ // body: photo,
108
+ // headers: {
109
+ // "Content-Type": "multipart/form-data",
110
+ // },
111
+ // }),
112
+ // invalidatesTags: [tagTypes.users],
113
+ // }),
114
+
115
+ switchGhost: builder.mutation<any, any>({
116
+ query: () => ({
117
+ url: `/auth/switch-ghost`,
118
+ method: "POST",
119
+ }),
120
+ invalidatesTags: [tagTypes.users],
121
+ }),
122
+ googleLogin: builder.mutation<any, any>({
123
+ query: (data) => ({
124
+ url: `/auth/login/google`,
125
+ method: "POST",
126
+ params: data,
127
+ }),
128
+ invalidatesTags: [tagTypes.users],
129
+ }),
130
+ googleLoginCode: builder.mutation<any, any>({
131
+ query: (data) => ({
132
+ url: `/auth/login/google/code?code=${data}`,
133
+ method: "POST",
134
+ }),
135
+ invalidatesTags: [tagTypes.users],
136
+ }),
137
+ appleLogin: builder.mutation<any, any>({
138
+ query: (data) => ({
139
+ url: `/auth/login/apple`,
140
+ method: "POST",
141
+ params: data,
142
+ }),
143
+ invalidatesTags: [tagTypes.users],
144
+ }),
145
+
146
+ deleteUserAccount: builder.mutation<any, any>({
147
+ query: (password) => ({
148
+ url: `/auth/profile-delete`,
149
+ method: "POST",
150
+ body: password,
151
+ }),
152
+ invalidatesTags: [tagTypes.users],
153
+ }),
154
+ }),
155
+ });
156
+
157
+ export const {
158
+ useGetProfileQuery,
159
+ useDeleteUserMutation,
160
+ useAppleLoginMutation,
161
+ useEmailVerifyMutation,
162
+ useForgotMutation,
163
+ useSignUpMutation,
164
+ useLoginMutation,
165
+ useUpdateUserMutation,
166
+ useTokenCheckMutation,
167
+ useResetPasswordMutation,
168
+ useGoogleLoginMutation,
169
+ useDeleteUserAccountMutation,
170
+ useGoogleLoginCodeMutation,
171
+ useSwitchGhostMutation,
172
+ useChangePasswordMutation,
173
+ useGetOthersProfileQuery,
174
+ useUpdateLocationMutation,
175
+ } = authSlice;
@@ -0,0 +1,19 @@
1
+ export interface IFetch {
2
+ status: number;
3
+ success: boolean;
4
+ message: string;
5
+ }
6
+
7
+ export interface IFetchData<T> extends IFetch {
8
+ data: T;
9
+ }
10
+
11
+ export interface Paginate<T> extends IFetch {
12
+ data: {
13
+ data: T[];
14
+ current_page: number;
15
+ total_pages: number;
16
+ total_items: number;
17
+ limit: number;
18
+ };
19
+ }
@@ -0,0 +1,196 @@
1
+ import { IFetchData, Paginate } from "./common";
2
+
3
+ export interface IUser {
4
+ _id: string;
5
+ name: string;
6
+ display_name: string;
7
+ avatar: string;
8
+ role: string;
9
+ ghost: boolean;
10
+ bio: string;
11
+ verified: boolean;
12
+ email: string;
13
+ status: "active" | "inactive" | "deleted";
14
+ vibes: number;
15
+ audio: number;
16
+ podcast: number;
17
+ following: number;
18
+ followers: number;
19
+ views: number;
20
+ clicks: number;
21
+ is_friend?: boolean;
22
+ subscription?: Subscriptions;
23
+ plan?: IPlans;
24
+ last_post_mode: {
25
+ _id: string;
26
+ icon: string;
27
+ name: string;
28
+ };
29
+ }
30
+
31
+ export interface Subscriptions {
32
+ _id: string;
33
+ user: string;
34
+ plan: string;
35
+ stripe_customer_id: string;
36
+ stripe_subscription_id: string;
37
+ current_period_start: string;
38
+ current_period_end: string;
39
+ subscription_status: string;
40
+ createdAt: string;
41
+ updatedAt: string;
42
+ }
43
+
44
+ export interface IMedia {
45
+ _id: string;
46
+ file_type: string;
47
+ url: string;
48
+ is_favorite: boolean;
49
+ duration?: number;
50
+ }
51
+
52
+ export type IUserFetch = IFetchData<IUser>;
53
+
54
+ export interface IPost {
55
+ _id: string;
56
+ user: {
57
+ _id: string;
58
+ name: string;
59
+ avatar: string;
60
+ display_name: string;
61
+ ghost: string;
62
+ verified: string;
63
+ };
64
+ is_followed: boolean;
65
+ post_type: "audio" | "vibes" | "podcast";
66
+ privacy: "public" | "private_circle" | "solo";
67
+ private_circle: [];
68
+ captions: string;
69
+ location: {
70
+ address: string;
71
+ type: "Point";
72
+ coordinates: [number, number];
73
+ };
74
+ createdAt: string;
75
+ updatedAt: string;
76
+ id: string;
77
+ mood: {
78
+ _id: string;
79
+ name: string;
80
+ color: string;
81
+ icon: string;
82
+ };
83
+ music_station: boolean;
84
+ is_verified: boolean;
85
+ image: IMedia[];
86
+ audio: IMedia[];
87
+ podcast: IMedia[];
88
+ likes: number;
89
+ is_liked: false;
90
+ is_favorite: false;
91
+ }
92
+
93
+ export interface IMoods {
94
+ _id: string;
95
+ createdAt: string;
96
+ icon: string;
97
+ user: string;
98
+ name: string;
99
+ updatedAt: string;
100
+ }
101
+
102
+ export interface IFriends {
103
+ _id: string;
104
+ name: string;
105
+ display_name: string;
106
+ role: string;
107
+ ghost: boolean;
108
+ bio: string;
109
+ avatar: string;
110
+ verified: boolean;
111
+ email: string;
112
+ status: string;
113
+ }
114
+
115
+ export enum EPlanLevel {
116
+ ONE = "one",
117
+ TWO = "two",
118
+ THREE = "three",
119
+ FOUR = "four",
120
+ FIVE = "five",
121
+ }
122
+
123
+ export interface IPlans {
124
+ _id: string;
125
+ name: string;
126
+ slug: string;
127
+ price: string;
128
+ currency: string;
129
+ interval: string;
130
+ features: string[];
131
+ level: EPlanLevel;
132
+ color: string;
133
+ stripe_product_id: string;
134
+ stripe_price_id: string;
135
+ isActive: string;
136
+ createdAt: string;
137
+ updatedAt: string;
138
+ current_plan: boolean;
139
+ }
140
+
141
+ interface IStatistics {
142
+ price: string;
143
+ plan_level: string;
144
+ plan_name: string;
145
+ plan_interval: string;
146
+ plan_color: string;
147
+ is_active: boolean;
148
+ start_date: number;
149
+ end_date: number;
150
+ total_click: number;
151
+ total_views: number;
152
+ total_followers: number;
153
+ durations: number;
154
+ remaining_days: number;
155
+ days_progress: number;
156
+ }
157
+
158
+ export interface IComment {
159
+ _id: string;
160
+ user: {
161
+ _id: string;
162
+ name: string;
163
+ avatar: string;
164
+ };
165
+ edited: boolean;
166
+ post: string;
167
+ parent_comment: string;
168
+ comment: string;
169
+ createdAt: Date;
170
+ updatedAt: Date;
171
+ replies: IComment[];
172
+ }
173
+
174
+ export type ICommentFetch = Paginate<IComment>;
175
+
176
+ export type ISinglePost = IFetchData<IPost>;
177
+ export type IFriendsFetch = IFetchData<IFriends[]>;
178
+
179
+ export type IStatisticsFetch = IFetchData<IStatistics>;
180
+
181
+ export type IPostFetch = Paginate<IPost>;
182
+
183
+ export type IPlansFetch = IFetchData<IPlans[]>;
184
+
185
+ export type IMoodsFetch = IFetchData<IMoods[]>;
186
+
187
+ export interface IPrivateCircleUser {
188
+ _id: string;
189
+ name: string;
190
+ display_name: string;
191
+ avatar: string;
192
+ email: string;
193
+ already_added: boolean;
194
+ }
195
+
196
+ export type IPrivateCircleUserFetch = IFetchData<IPrivateCircleUser[]>;
@@ -0,0 +1,13 @@
1
+ export enum tagTypes {
2
+ profile = "profile",
3
+ users = "users",
4
+ about = "about",
5
+ notification = "notification",
6
+ }
7
+
8
+ export const tagTypesList = [
9
+ tagTypes.profile,
10
+ tagTypes.users,
11
+ tagTypes.about,
12
+ tagTypes.notification,
13
+ ];
@@ -0,0 +1,27 @@
1
+ import { createSlice } from "@reduxjs/toolkit";
2
+
3
+ export interface userState {
4
+ car_brand: string | null;
5
+ car_model: string | null;
6
+ }
7
+
8
+ const initialState: userState | any = {};
9
+
10
+ export const userSlice = createSlice({
11
+ name: "user",
12
+ initialState,
13
+ reducers: {
14
+ addUser: (state, action) => {
15
+ state.user = action?.payload;
16
+ },
17
+
18
+ removeUser: (state) => {
19
+ state.user = {};
20
+ },
21
+ },
22
+ });
23
+
24
+ // Action creators are generated for each case reducer function
25
+ export const { addUser, removeUser } = userSlice.actions;
26
+
27
+ export default userSlice.reducer;
@@ -0,0 +1,17 @@
1
+ import { configureStore } from "@reduxjs/toolkit";
2
+ import { api } from "./api/baseApi";
3
+ import userSlice from "./service/user";
4
+
5
+ const store = configureStore({
6
+ reducer: {
7
+ [api.reducerPath]: api.reducer,
8
+ user: userSlice,
9
+ },
10
+ middleware: (getDefaultMiddleware) =>
11
+ getDefaultMiddleware().concat(api.middleware),
12
+ });
13
+
14
+ export default store;
15
+
16
+ export type RootState = ReturnType<typeof store.getState>;
17
+ export type AppDispatch = typeof store.dispatch;
@@ -0,0 +1,27 @@
1
+ import { Dimensions, Linking } from "react-native";
2
+
3
+ import tw from "../lib/tailwind";
4
+
5
+ export const { height: _HIGHT, width: _WIDTH } = Dimensions.get("window");
6
+
7
+ // console.log(_WIDTH);
8
+
9
+ export const PrimaryColor = tw.color("primary") as string; // Example primary color, replace with your actual primary color
10
+
11
+ // If need show image then use it for temp
12
+ export const RandomImage = `https://picsum.photos/200/300?random=${Math.floor(
13
+ Math.random() * 1000,
14
+ )}`;
15
+ //If need show random color of the card
16
+ export const RandomColor = () =>
17
+ `#${Math.floor(Math.random() * 16777215)
18
+ .toString(16)
19
+ .padStart(6, "0")}`;
20
+
21
+ export const OpenLink = (link: string) => {
22
+ Linking.openURL(link);
23
+ };
24
+
25
+ // export const OpenSystemUi = ()=>{
26
+ // Linking.
27
+ // }