Shamiri Health Journaling App
The Shamiri Health Journaling App is a mobile application and backend service designed for users to write, categorize, and manage their journal entries. The application includes features such as user authentication, journal entry management, categorization, summary views, and user settings. The mobile app is built using React Native and Expo with TypeScript, and the backend service is implemented using Node.js with Express and SQLite.
- User Authentication: Sign up and log in functionality.
- Journal Entry Management: Create, edit, and delete journal entries with title, content, category, and date.
- Journal View: View a list of all journal entries.
- Categorization: Categorize entries (e.g., Personal, Work, Travel).
- Summary View: Display a summary of entries over a selected period (daily, weekly, monthly).
- Settings: Update username and password.
- Design: Simple and intuitive UI focusing on usability and clarity.
- User Management: User registration and authentication (JWT-based).
- Profile Management: Update user profile details.
- Journal Entry Management: CRUD operations for journal entries.
- Categorization: Categorize journal entries.
- Data Summary: Fetch summary data for given periods.
- Security: Secure endpoints accessible only by authenticated users.
<project-directory>/
├── backend/
│ ├── index.js
│ ├── setup_database.js
│ ├── populate_database.js
│ ├── clear_database.js
│ ├── package.json
│ └── ... (other backend files)
├── mobile/
│ ├── App.tsx
│ ├── src/
│ │ ├── api/
│ │ │ └── api.ts
│ │ ├── components/
│ │ │ ├── EntryItem.tsx
│ │ │ └── ... (other components)
│ │ ├── context/
│ │ │ └── AuthContext.tsx
│ │ ├── screens/
│ │ │ ├── HomeScreen.tsx
│ │ │ ├── LoginScreen.tsx
│ │ │ ├── RegisterScreen.tsx
│ │ │ ├── SettingsScreen.tsx
│ │ │ └── ... (other screens)
│ │ └── ... (other folders and files)
│ ├── package.json
│ ├── tsconfig.json
│ └── ... (other configuration files)
└── ... (other project files)
- Node.js: Download and install Node.js
- SQLite3: Download and install SQLite
- Clone the Repository:
git clone https://github.com/johnmahugu/shamiri.git
- Navigate to the Backend Directory:
cd <project-directory>/backend
- Install Dependencies:
npm install
- Set Up the Database:
node setup_database.js
- Populate the Database (Optional):
node populate_database.js
- Start the Server:
node index.js
- Access the API: The backend service should now be running on
https://localhost:8000
.
- Node.js: Download and install Node.js
- Expo CLI: Install globally by running:
npm install -g expo-cli
- Git: Download and install Git
- Android/iOS Emulator or Physical Device:
- For Android: Install Android Studio and set up an Android emulator.
- For iOS: Use Xcode and set up an iOS simulator.
- Alternatively, use a physical device with the Expo Go app installed.
- Clone the Repository:
git clone https://github.com/johnmahugu/shamiri.git
- Navigate to the Mobile Directory:
cd <project-directory>/mobile
- Install Dependencies:
npm install
- Start the Expo Server:
expo start
- Open the App:
- Using an Emulator:
- For Android, press
a
in the terminal. - For iOS, press
i
in the terminal.
- For Android, press
- Using a Physical Device:
- Open the Expo Go app and scan the QR code.
- Using an Emulator:
- Register:
POST /auth/register
- Body:
{ "username": "testuser", "email": "[email protected]", "password": "password123" }
- Body:
- Login:
POST /auth/token
- Body:
{ "username": "testuser", "password": "password123" }
- Body:
- Create Entry:
POST /journal
- Headers:
Authorization: Bearer <token>
- Body:
{ "title": "My First Entry", "content": "This is the content of my first entry.", "category": "Personal", "date": "2024-07-07" }
- Headers:
- Get Entries:
GET /journal
- Headers:
Authorization: Bearer <token>
- Headers:
- Update Entry:
PUT /journal/<entry_id>
- Headers:
Authorization: Bearer <token>
- Body:
{ "title": "Updated Entry", "content": "This is the updated content.", "category": "Work" }
- Headers:
- Delete Entry:
DELETE /journal/<entry_id>
- Headers:
Authorization: Bearer <token>
- Headers:
- Get Summary:
GET /summary/<period>
- Headers:
Authorization: Bearer <token>
- Headers:
The project implementation aims to cover various essential features and to demonstrate proficiency in both frontend and backend development. It provides a comprehensive demonstration of understanding of integrating a mobile application with a backend service, focusing on usability, security, and performance. The setup instructions, documentation, and code structure were crafted to ensure ease of understanding and use.
If you have any questions or feedback, feel free to reach out. Thank you! [email protected]