This is a flask multi-user REST API endpoint backend application where a user can sign up,log in get a a token and consume backend service using the provided endpoints.
For detailed API Endpoints Overview click API Documentation.
Test driven development is an iterative development process.
In TDD, developers write a test before they write just enough production code to fulfill that test and the subsequent refactoring. Developers use the specifications and first write test describing how the code should behave. It is a rapid cycle of testing, coding, and refactoring.
Here are the summary:
- A landing page showing Sign Up and Log In form
- user is authenticated and able to consume the API after authentication.
- This program requires python3.+ (and pip) installed, a guide on how to install python on various platforms can be found here
Here is a run through of how to set up the application:
-
Clone the repository
$ git clone https://github.com/HASSAN1A/my_users_api.git
-
Go to the project root directory and create a virtual environment. Run the following commands respectively:
$ cd /my_users_api
-
Installing virtualenv
$ python3 -m pip install --user virtualenv
command -
Create the project virtual environment with
$ python3 -m venv venv
command -
Activate the virtual environment
$ source venv/bin/activate
- Note that you can exit the virtual environment by running the command
deactivate
- Note that you can exit the virtual environment by running the command
-
Install all required dependencies with
$ pip install -r requirements.txt
-
Create the Database
-
- psql
-
- CREATE DATABASE yourdb;
-
-
Export the required environment variables
$ export FLASK_ENV=development $ export DATABASE_URL=postgres://name:password@localhost:port/yourdb $ export JWT_SECRET_KEY=your secret key ```Or you can create a .env file and export the variables in it.
-
Run the application
$ flask run
or$ python3 run.py
- Open your preferred browser and view the app by opening the link http://127.0.0.1:5000/.
- You will see a landing page with a sign up and log in form.
Want to contribute? Great!
To fix a bug or enhance an existing module, follow these steps:
- Fork the repo
- Create a new branch (
git checkout -b improve-feature
) - Make the appropriate changes in the files
- Add changes to reflect the changes made
- Commit your changes (
git commit -am 'Improve feature'
) - Push to the branch (
git push origin improve-feature
) - Create a Pull Request
If you find a bug (the website couldn't handle the query and / or gave undesired results), kindly open an issue here by including your search query and the expected result. If you'd like to request a new function, feel free to do so by opening an issue here. Please include sample queries and their corresponding results.
To fix a bug or enhance an existing module, follow these steps:
- Fork the repo
- Create a new branch (
git checkout -b improve-feature
) - Make the appropriate changes in the files
- Add changes to reflect the changes made
- Commit your changes (
git commit -am 'Improve feature'
) - Push to the branch (
git push origin improve-feature
) - Create a Pull Request
- Python 3.8 : Programming language.
- Flask: Framework used.
- HTML : Layout.
- CSS : Styling.
- Bootstrap : For responsive websites.
- posgreSQL : Database language.
- psycopg2 : Database driver.
- JWT : Authentication.
- Docker : For running the application.
- Heroku : For deploying the application.
- Git : Version control.
- GitHub : For hosting the repository.
- Postman : For testing the API.
- Figma - Blueprint for designing the web app.
- To work on any issue that may arise,maintain the site and allow others to pair programme with me by raising their comments/issues that so that we work on them to achieve a common goal .