Express Article is a Backend for Blog app with various endpoints including user management, Blog and User Dashboard powered by Mongodb as the database
The API is deployed on Render and can be accessed at https://expressarticle.onrender.com.
- Set Up a Virtual Environment
- For Windows:
python -m venv my_venv .\my_venv\Scripts\activate
- For Unix or MacOS:
python3 -m venv venv source venv/bin/activate
- For Windows:
- Install the necessary dependencies
pip install -r requirements.txt
- Create an .env file
MONGO_USER=sidsolanki920
MONGO_PASS=8493
- Run the server
cd ./app
uvicorn src:main:app --reload
- If everything went fine, Success message will be logged and server will listen on port 8000
- Path:
/login
- Methods:
POST
(Login) - Authorization: None
- Description: User login
- Path:
/register
- Method:
POST
- Authorization: None
- Description: Register a new user
- Path:
/user/update
- Method:
PUT
- Authorization: Requires a valid JWT token.
- Description:
- Path:
/user/profile
- Method:
GET
- Authorization: Requires a valid JWT token.
- Path:
blog/dashboard
- Method:
GET
- Authorization: Requires a valid JWT token.
- Path:
/blogs?page=..&limit=..
Page and limit are intergers for pagination - Methods:
GET
- Authorization: None
- Path:
/blogs/retrieve/{blog_id}
blog_id corresponds to unique id of the blog - Method:
GET
- Authorization: None
- Path:
/blogs/create
- Method:
POST
- Authorization: Requires a valid JWT token.
- Path:
/blogs/update/{blog_id}
blog_id corresponds to unique id of the blog - Method:
PUT
- Authorization: Requires a valid JWT token and should be the author
- Path:
/blogs/remove/{blog_id}
blog_id corresponds to unique id of the blog - Method:
DELETE
- Authorization: Requires a valid JWT token and should be the author
Authorization and Access Permissions are done with FastApi Dependencies
To run it as a container, Simply Run
docker-compose up
If current user is in docker group, Following is enough
docker-compose up