The API and postgres database are deployed on render ecommerce-api-pqjs.onrender.com
- User route:
For creating new users,searching and deleting users by their id - Post route:
This route is used for creating, updating, deleting and checking posts. - Auth route:
Login system - Vote route:
This route is used for liking and disliking a post
git clone https://github.com/quirrelHK/social-meida-app-api.git
cd social-meida-app-api
pip install -r requirements.txt
Uncomment this line in main.py for creating tables using sqlalchemy
models.Base.metadata.create_all(bind=engine)
Or you can use alembic for creating tables.
After this create a .env file in the current directory and add the following:
DATABASE_HOSTNAME=localhost
DATABASE_PORT=5432
DATABASE_PASSWORD=your_db_password
DATABASE_NAME=your_db_name
DATABASE_USERNAME=your_db_user_name
SECRET_KEY=your_secret_key
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=60
You can generate secret key using this command in terminal:
openssl rand -hex 20
uvicorn app.main:app --reload
You call pull the image from docker-hub:
docker pull ritesh778/apipython
Or build the and run the image:
docker-compose -f docker-compose-dev.yml up -d --build