A full-stack offline-first note-taking application with real-time synchronization capabilities. This app allows users to create, edit, and delete notes that sync across devices in real-time when online and automatically sync when connectivity is restored.
This project consists of two main components:
- Mobile App: A React Native application built with Expo bare that provides a beautiful, responsive interface for note management
- Backend Server: A Node.js/Express.js server with Socket.IO for real-time communication and PostgreSQL for data persistence
- ✅ Offline-First Design: Create, edit, and delete notes without network connectivity
- 🔄 Real-Time Sync: Changes automatically synchronize across devices when online
- 🔔 Push Notifications: Receive notifications when notes are synced or updated
- 📝 Note Management: Full CRUD functionality for notes
- 🌐 Network Status Awareness: App adapts to changing network conditions
- 📱 Responsive UI: Beautiful interface designed for mobile devices
- 🔄 Conflict Resolution: Version tracking to prevent sync conflicts
- Framework: React Native with Expo Bare
- Navigation: React Navigation
- State Management: React Context API and custom hooks
- Storage: AsyncStorage for local persistence
- Networking: Socket.IO Client for real-time updates
- Utilities: NetInfo for network status detection
- Framework: Node.js with Express.js
- Real-Time Communication: Socket.IO
- Database: PostgreSQL with Sequelize ORM
- API: RESTful endpoints + WebSocket communication
- Node.js 16+
- npm or yarn
- PostgreSQL database
- Expo CLI (
npm install -g expo-cli)
-
Clone the repository:
git clone https://github.com/yourusername/nyota-project.git cd nyota-project/backend -
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile in the backend directory with:PORT=3000 DB_HOST=localhost DB_USER=postgres DB_PASS=your_password DB_NAME=nyota_notes CORS_ORIGIN=* -
Set up the database:
npm run migrate
-
Start the server:
npm run start:dev
-
Navigate to the mobile directory:
cd ../mobile -
Install dependencies:
npm install
-
Configure API endpoint: Edit
src/config/env.jsto point to your backend server address -
Start the development server:
npm start
-
Follow Expo instructions to run on a device or emulator
-
To connect with the Expo Go app on your mobile device:
- Make sure your mobile device is on the same network as your development machine
- For Android: Use
exp://<YOUR_LOCAL_IP>:3000in the Expo Go app - For iOS: Scan the QR code from the terminal or Expo Dev Tools
-
Screenshots
mobile/
├── assets/ # Static assets and images
├── src/
│ ├── components/ # Reusable UI components
│ ├── config/ # Configuration files
│ ├── contexts/ # React Context providers
│ ├── hooks/ # Custom React hooks
│ ├── notifications/ # Push notification handling
│ ├── screens/ # App screens
│ ├── storage/ # Local storage management
│ ├── utils/ # Utility functions
│ └── App.js # Main app component
├── app.json # Expo configuration
└── package.json # Dependencies and scripts
backend/
├── config/ # Configuration files
├── database/ # Database models and migrations
├── src/
│ ├── controllers/ # Request handlers
│ ├── middleware/ # Express middleware
│ ├── routes/ # API routes
│ ├── sockets/ # Socket.IO handlers
│ ├── app.js # Express app setup
│ └── server.js # Server entry point
└── package.json # Dependencies and scripts
The app implements a robust offline-first approach using:
- Local storage for note persistence
- Queue system for pending operations when offline
- Automatic synchronization when connection is restored
- Socket.IO establishes bidirectional communication
- Singleton pattern ensures consistent socket connections
- Event-based synchronization with proper acknowledgments
- Version tracking to resolve conflicts
- Responsive card design for notes
- Visual indicators for sync status
- Context menus for note actions (edit/delete)
- Pull-to-refresh functionality
- Optimistic UI updates for instant feedback
- Thanks to the React Native and Socket.IO communities
- Inspired by the need for reliable offline-first applications



