Architecture for RESTful API and a web admin

I am trying to build a RESTful API (using Flask) that will be later consumed by a mobile application. I also have a requirement to build a Web Admin. The Web Admin will have functionality that will not be available for the mobile client. The mobile client and Web Admin will also share the same database.

I have a limitation:

  • I do not know any front-end framework, I will be building the Web Admin using Flask (combining the backend/frontend).

My questions are:

  • For the functionalities that are similar for the mobile and web admin, how can avoid duplicating the code?
  • How can I maintain the database? I will be using an ORM, does this mean I have to write the DB models twice? One for the RESTful API and one for the Web Admin that will be directly talking to the database.