I've developed this REST API for a mini social network named "SocioLink", using Python and Django Rest Framework. It supports user registration, login, post creation, and post likes/unlikes, along with daily like analytics and user activity tracking. PostgreSQL is employed for effective and reliable database. Additionally, an automated bot is included to simulate user activities. Feel free to explore!
- Django Rest Framework
- Django ORM
- PostgreSQL
- Docker
- JWT authentication 🔒
- Detailed Documentation of all endpoints on "http://127.0.0.1:8000/api/doc/swagger/"
- Totally Dockerized
- Different permissions for different actions (allows user sign-ups, logins, post creations, and liking/unliking of posts. It also provides daily analytics on likes and user activity insights, such as the last login and request made.)
git clone https://github.com/bohdan-yatsyna/SocioLink
cd SocioLink
🖥 Windows:
python -m venv venv
venv\Scripts\activate
💻 Linux/MacOS:
python -m venv venv
source venv/bin/activate
- Create an empty .env file in the root folder of the project.
- Copy the entire content of the .env.sample to your .env file.
- Modify the placeholders in the .env file with your preferable environment variables.
- DOCKER should be installed and opened.
docker-compose up --build
- And open in your browser "http://127.0.0.1:8000/"
email: admin@admin.com
password: TestOne1.
- Check actual container id of the application with
docker ps
- Enter it to the next command and run
docker exec -it <container_id> python manage.py createsuperuser
- User creating - send a POST request to /api/users/signup/
- Obtain token - send a POST request to /api/users/login/
- Install ModHeader extension and create Request header "Authorize" with value: Bearer <Your access token>
- Change bot/config.json with appreciable parameters