REST API for Sportowe Świry application.
- General Info
- Technologies Used
- Features
- Setup
- Tests
- Project Status
- Contributing
- Sources
- Contact
- License
The REST API application is a separate module of the Sportowe Świry application (available here) that allows to access the database using the HTTP protocol. The app use a copy of the original application database. This is a module designed to show the functionality of the API.
- Framework Python-Flask
- SQLAlchemy
- Pytest
- MySQL
- AWS
- Postman
- Git
The user, after logging in (JWT Token), has access to all his sports activities and events saved in the database. He can also view, add, delete and update his previous activities. The user can also update his personal data from this application. Users who are administrators can view all registered users and other data related to them (activities, events).
Data is transmitted and displayed using the JSON format. Displaying a list of activities, events or users can be configured according to your needs. The most important functionalities:
- Authentication between client and server using JWT token (JSON Web Token).
- HTTP methods used: GET, POST, PUT, DELETE.
- Functions for filtering and sorting specific database columns.
- Marshmallow library for serializing, deserializing, and validating data.
- Using pagination when displaying data.
Full documentation can be found here.
- Clone repository
- Rename
.env.example
to.env
and set your values:
SECRET_KEY=SomeRandomString
SQLALCHEMY_DATABASE_URI=mysql+pymysql://<db_user>:<db_password>@<db_host>/<db_name>
- Create a virtual environment
python -m venv venv
- Install packages from
requirements.txt
pip install -r requirements.txt
- Run command
flask run
In order to execute tests located in tests/
run the command:
python -m pytest tests/
The project is now complete. No additional work is planned. The application was deployed on the AWS cloud using the Elastic Beanstalk service. The application used an EC2 server and an S3 container in the Free Tier version. The implementation was made for educational purposes only.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
Fork the Project
- Create your Feature Branch (git checkout -b feature/AmazingFeature)
- Commit your Changes (git commit -m 'Add some AmazingFeature')
- Push to the Branch (git push origin feature/AmazingFeature)
- Open a Pull Request
This project was based on this tutorial.
Created by @LukBartsch - feel free to contact me!
This project is open source and available under the MIT License.