Skip to content

dsc-x/omg-frames-api

Repository files navigation

iWasAt

This is the backend of the iWasAt having the register/login routes, and other related ones.

Link to the front-end repo: omg-frames

Backend is running at: https://api.iwasat.events/api/v1

All the API endpoints are prefixed by /api/v1 e.g https://api.iwasat.events/api/v1/login

Technologies used

Framework : Flask Reason being it is very lightweight and easy to set-up. Since it's a micro-framwork it has better performance and is very scalable.

Database : Firebase realtime database Easy to set-up and use.

Documentation : Flasgger Flask extension that comes with Swagger UI embedded. Link to the repo here

API Endpoints

For API documentation go to https://api.iwasat.events/apidocs/.

Development

Dockerfile

  • Run the build command
make build

It will pull the docker image and install all the packages and modules.

  • Run the docker instance
make run

By default it will map to port 5000.

  • If you want to kill the docker instance
make kill

Then you can visit http://0.0.0.0/apidocs for the documentation

Building from source

  • Clone the repo.
$ git clone https://github.com/dsc-x/omg-frames-api
$ cd omg-frames-api
  • Setup a python virtual environment (optional).
$ python3 -m venv venv/
$ source ./venv/bin/activate # activate the virtual environment
  • Install the modules and libraries that will be used.
$ pip3 install -r requirements.txt
  • Create a .env file in root of the project. You can refer to sample.env.

  • Finally run the command

$ flask run

This will start the local server in port 5000.

Project structure

omg-frames-api
├── app
│   ├── db.py
│   ├── __init__.py
│   └── routes.py
├── config.py
├── docs
│   ├── deleteframes.yml
│   ├── getframes.yml
│   ├── login.yml
│   ├── postframes.yml
│   ├── register.yml
│   └── updateframes.yml
├── README.md
├── requirements.txt
├── sample.env
└── server.py