Skip to content

A shopping mobile application made for Android - back-end (ktor-server) and front-end.

Notifications You must be signed in to change notification settings

wszlosek/Fashion-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fashion store - mobile app

Quality Gate Status Bugs Code Smells Security Rating Lines of Code

Mobile application of a fashion store with a local database (client-side). Apart from it, the server-side with the database along with the REST API.

Table of contents

General info

This project is a mobile application for the Android platform that supports the fashion store.


The following models are implemented on the server-side: Cart, Category, Color, LoginData, Product, ShopLocalization, User. For each of these models, CRUD (get, put, post, delete) methods are implemented. The server-side data are stored on the SQLite Database. The server was created with the Ktor framework (with gson serialization).


The front-end was based on Android fragments with a navigation component (graph). The data is collected from the server API via Retrofit services (which download data from REST API endpoints). The local data are stored on the Realm Database. You can log in to the application in a traditional way (registration, login with a login and password) and via an account on Github. Payment in our fashion store is made by VISA card with Stripe service.

In addition, there is real-time synchronization between the server database (SQLite) and the client-side database (Realm).

Scenarios and possibilities of the application

Graph of transitions of application views:

app_graph

Examples of application usage paths:

  • (happy path...) registration/logging in or logging in using a Github account --> getting to know the product list --> getting to know our company - optional --> product selection --> product purchase --> payment.
  • logging in --> getting to know our company.
  • incorrect login or password.
  • logging in --> getting to know the product list --> product selection --> product purchase --> payment failed (lack of account funds, incorrect credit card data, etc).

Use of HTTP methods for API (endpoints):

For each model, you can use following HTTP commands. Tip: for generate https address, you can use ngrok - write in terminal:

./ngrok http <your_port_number> 
  • GET: <https_address>/model_name, <https_address>/model_name/id
  • POST: <https_address>/model_name
  • PUT: <https_address>/model_name, <https_address>/model_name/id
  • DELETE: <https_address>/model_name, <https_address>/model_name/id

Technologies

Back-end:

  • Kotlin - main programming language
  • Ktor framework - server, routing
  • SQLite with JetBrains Exposed framework - database and operations on it

Front-end:

  • Kotlin - main programming language
  • Retrofit - HTTP Client, executing commands from endpoints
  • Realm - database and operations on it
  • OAuth, Stripe, Google Maps - services that enable certain app functions to work

Other (including the tools used while working on the application):

  • Postman, ngrok, MongoDB Realm Studio, SonarCloud, Docker

Run (instructions)

You should prepare API keys for proper operation:

  • on the server-side, you will need the secret API key of Stripe. You should put it in your program, creating file Secrets.kt with the following Object in Kotlin (and make import with this file in OrderAndStripeRoutes.kt):
object Secrets {
    const val secretServerKey = <your_stripe_api_key_string>
}

Stripe key put in file Secrets.kt:

object Secrets {
    const val secretKeyClient = <your_client_stripe_api_key_string>
} 


Github secret-key and client ID put in GithubConstants.kt:

object GithubConstants {
    const val CLIENT_ID = <your_client_id_string>
    const val CLIENT_SECRET = <your_client_secret_key_string>
    const val REDIRECT_URI = "https://github.com/wszlosek"
    const val SCOPE = "read:user,user:email"
    const val AUTHURL = "https://github.com/login/oauth/authorize"
    const val TOKENURL = "https://github.com/login/oauth/access_token"
} 

Google Maps: in local.properties add the following code:

MAPS_API_KEY=<YOUR_GOOGLE_MAPS_API_KEY>



You can build (and run) a server side with Docker, with the port portNumber:

   docker build -t serverside .  
   docker run -p <portNumber>:<portNumber> serverside

Status

The project has been completed. The only corrections required are the appearance of the UI layer.