-
Start the backend
cd lexcora-backend && npm install- Copy the provided
.env(contains database, AWS, JWT, OpenAI, etc.) and keep it out of source control in production. - Run
npm run devto expose the API onhttp://localhost:8080(it responds under/api). CORS_ORIGINScan be used when you need to whitelist extra front-ends, but the default local origins now include Expo Web on19006, and the server logs the resolved list in non-production environments to help you spot missing hosts.
-
Point the Expo app to the right base URL
cd lexcora-mobile && npm install.- Edit
lexcora-mobile/.envand setEXPO_PUBLIC_API_BASE_URLto the URL your app can reach.- Android emulator (10.0.2.2):
EXPO_PUBLIC_API_BASE_URL=http://10.0.2.2:8080/api - iOS simulator or desktop Node (
localhostor127.0.0.1):http://127.0.0.1:8080/api - Expo Web (
localhost:19006):http://localhost:8080/apior point to the machine’s LAN IP if you need to hit the server from another device; the backend now allows the Expo dev origin by default.
- Android emulator (10.0.2.2):
- Run
expo start(orexpo start --web) then use the login screen; the requests usenativeAxios, which picks the URL fromEXPO_PUBLIC_API_BASE_URLand gracefully falls back tohttps://api.lexcora.com/apiif nothing is configured.
-
Keep the connection safe
- For production, continue using
https://api.lexcora.com/apiso that every request goes over TLS. - If you change the host/port of the backend (
PORT,FRONTEND_URL,CORS_ORIGINS), restart the server so the middleware rehydrates the origin list. - The app already clears stored tokens when a 401 comes back, so any repeated failures after login mean the client cannot reach the backend; double-check the base URL, the emulator’s networking (e.g.,
10.0.2.2for Android), and the CORS log emitted by the backend at startup.
- For production, continue using
-
Notifications
You must be signed in to change notification settings - Fork 0
a mobile app using React Native (Android)
tamer2025ultimate/lexcora_backend_native_dev
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
a mobile app using React Native (Android)
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published