Coder Social home page Coder Social logo

linibensonjr / schoolify-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 77 KB

A student management API using either Flask- RESTX framework in Python. The purpose of this project is a final project from ALt School Africa to texta and help develop my skills in creating RESTful APIs using these frameworks

Home Page: https://schoolify.pythonanywhere.com

Python 98.27% Mako 1.73%

schoolify-api's Introduction

SchoolifyAPI

A student management API using either Flask- RESTX or Flask-Smorest framework in Python. The purpose of this project is to help you develop your skills in creating RESTful APIs using these frameworks

Starting and Using the Project

Requirements

You must have the following tools ready to run this project

  • Python3
  • Virtual Environment

Backend

Before you get started, set up your virtual environment

python -m virtualenv myenv
myenv/Scripts/activate

Once your virtual environment is setup and running, install the required dependencies by running:

pip install -r requirements.txt
Run the Server

From within the schoolify-api directory first ensure you are working using your created virtual environment.

To run the server, execute:

set FLASK_APP=api/
flask run --reload

The --reload flag will detect file changes and restart the server automatically.

This will the start the server at http://localhost:5000

API Reference

Getting Started

  • Base URL: At present this app can only be run locally and is not hosted as a base URL. The backend app is hosted at the default, http://127.0.0.1:5000/

Error Handling

Errors are returned as JSON objects in the following format:

{
    "success": False, 
    "error": 400,
    "message": "bad request"
}

The API will return three error types when requests fail:

  • 400: Bad Request
  • 404: Resource Not Found
  • 422: Not Processable
  • 405: Method Not Allowed
  • 500: Internal Server Error

Endpoints

POST /auth/signup

  • General:

    • Signs up an Admin User
  • curl http://127.0.0.1:5000/auth/signup

    "Sign Up": 
        {
            "name": "string",
            "email": "string",
            "username": "string",
            "password": "string"
        },
    "success": true,
}

POST /login

  • General:

    • Logs in Admin User

-curl http://127.0.0.1:5000/auth/login

    "Login":
        {
            "email": "string",
            "password": "string"
        },

        {
            "access_token": "string",
            "refresh_token":string"
        }
}

POST /refresh

  • General:

    • Refreshes the active session

-curl http://127.0.0.1:5000/auth/refresh

schoolify-api's People

Contributors

linibensonjr avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.