Skip to content

Check Daily Activity is a productivity and task management application designed to help users organize their daily activities efficiently.

License

Notifications You must be signed in to change notification settings

shivanandyadav11/Check-Daily-Activity

Repository files navigation

This is a Kotlin Multiplatform project targeting Android, iOS, Web, Desktop, Server.

  • /composeApp is for code that will be shared across your Compose Multiplatform applications. It contains several subfolders:

    • commonMain is for code that’s common for all targets.
    • Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name. For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app, iosMain would be the right folder for such calls.
  • /iosApp contains iOS applications. Even if you’re sharing your UI with Compose Multiplatform, you need this entry point for your iOS app. This is also where you should add SwiftUI code for your project.

  • /server is for the Ktor server application.

  • /shared is for the code that will be shared between all targets in the project. The most important subfolder is commonMain. If preferred, you can add code to the platform-specific folders here too.

Learn more about Kotlin Multiplatform, Compose Multiplatform, Kotlin/Wasm…

Note: Compose/Web is Experimental and may be changed at any time. Use it only for evaluation purposes. We would appreciate your feedback on Compose/Web and Kotlin/Wasm in the public Slack channel #compose-web. If you face any issues, please report them on GitHub.

You can open the web application by running the :composeApp:wasmJsBrowserDevelopmentRun Gradle task.

Design

Check the design on Figma

Check Daily Activity App (Android, iOS, and Desktop)

Features

  • UI: Common Jetpack Compose
  • Navigation: Compose Navigation
  • Dependency Injection: Koin
  • Database: Room Database
  • Date Handling: Platform-specific library
  • Shared ViewModel: SharedViewModel across all platforms
  • Background Work: Coroutines
  • ** Work in Progress

Flow Recording

Check Daily Update
Screen.Recording.2024-07-16.at.10.59.07.AM.mp4

Android Screenshots

Landing Sign In Sign Up Error on Sign In
android_landing_page signIN signUP error
Loading Home Add Task
loading home add_task

iOS

Landing Sign In Sign Up Error on Sign In
ios_landing_page signIN signUP error
Loading Home Add Task
loading home add_task

Desktop

Landing Sign In Sign Up Error on Sign In
ios_landing_page signIN signUP error
Loading Home Add Task
loading home add_task

Ktor Application

This project is a Ktor-based web application that provides user authentication and protected routes. The application allows users to sign up, sign in, and access a protected endpoint.

Table of Contents

Getting Started

These instructions will help you set up and run the application on your local machine for development and testing purposes.

Prerequisites

Installing

  1. Clone the repository:
git clone https://github.com/your-username/ktor-application.git
cd ktor-application
  1. Configure your environment variables:

Create a .env file in the root directory and add the following environment variables:

JWT_ISSUER=https://your-domain.com/
JWT_AUDIENCE=your-audience
JWT_REALM=your-realm
JWT_SECRET=your-secret
MONGO_PW=your-mongodb-password
  1. Build the project:
./gradlew build

Running the Application

To run the application, use the following command:

./gradlew run

The server will start on http://localhost:5500.

API Endpoints

1. Sign Up

URL: http://localhost:5500/signup Method: POST Body:

{
"name": "shiv",
"email": "[email protected]",
"password": "test1234"
}

Response:

  • 200 OK: User successfully registered and returns a JWT token.
  • 400 Bad Request: Invalid request data.

2. Sign In

URL: http://localhost:5500/signin Method: POST Body:

{
"name": "",
"email": "[email protected]",
"password": "test1234"
}

Response:

  • 200 OK: Returns a JWT token for authentication.
  • 401 Unauthorized: Invalid credentials.

3. Protected Route

URL: http://localhost:5500/secret Method: GET Headers:

Authorization: Bearer <JWT Token>

Response:

  • 200 OK: Access to the protected resource.
  • 401 Unauthorized: Invalid or missing JWT token.

Configuration

The application is configured using the application.conf file located in the resources directory. Ensure that the following properties are correctly set:

ktor {
  deployment {
    port = 5500
  }
  application {
    modules = [ online.nsandroid.ApplicationKt.module ]
  }
  security {
    jwt {
        issuer = ${?JWT_ISSUER}
        audience = ${?JWT_AUDIENCE}
        realm = ${?JWT_REALM}
        secret = ${?JWT_SECRET}
    }
  }
}

TODO Items from the Code

The Application.kt file includes TODO items to enhance the functionality and security of the application. Ensure to address the following:

  • TODO: Add proper error handling for all routes.
  • TODO: Implement user password hashing before storing in the database.
  • TODO: Add logging to monitor application behavior and errors.
  • TODO: Secure the /secret route to ensure only authenticated users can access it.
  • TODO: Validate user input to prevent SQL injection and other attacks.
  • TODO: Configure CORS to allow requests from trusted origins.
  • TODO: Pass database name val dbName = ""
  • TODO: Configure before testing it: connectionString = "mongodb+srv://<username>:<password>@<cluster-url>/<dbname>?retryWrites=true&w=majority"
  • TODO: Before running pass JWT secret here: const val JWT_SECRET = ""
  • TODO: Add MongoDB password here: const val MONGO_PW = ""

Built With

  • Ktor - Framework for building asynchronous servers and clients in connected systems.
  • KMongo - Kotlin toolkit for MongoDB.
  • Gradle - Build tool.

License

This project is licensed under the MIT License - see the LICENSE file for details.


About

Check Daily Activity is a productivity and task management application designed to help users organize their daily activities efficiently.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published