Skip to content

j0flintking02/ah-backend-stark

 
 

Repository files navigation

Authors Haven - A Social platform for the creative at heart.

Build Status Coverage Status Maintainability

Vision

Create a community of like minded authors to foster inspiration and innovation by leveraging the modern web.

Getting started

Prerequisites

Technologies used

Setting up the application

Clone the project repo to your prefered location

$ git clone https://github.com/andela/ah-backend-stark.git

Install a virtual environment via pip or prefered package manager

$ pip install virtualenv

Create a virtual environment. "env" can be any name

$ virtualenv env

Activate environment

  • On Windows $ env\scripts\activate

  • On Mac OS $ source env/bin/activate

Install dependencies

$ pip install -r requirements.txt

Database Setup

Rename the .env.example file to .env and change the dummy fields to your respective database connection credencials

Make migrations

$ python manage.py makemigrations

$ python manage.py migrate

Running Tests

$ python manage.py tests

Tests with coverage

$ coverage run --source=authors/ manage.py test

$ coverage report -m

Test the application

Run server

$ python manage.py runserver

Endpoints that can be tested on Postman

Documentation on how to test the endpoints

Method Endpoint Functionality
POST /api/users/ Register user
POST /api/users/activate_account/:token/ Verify user account
POST /api/users/login/ Login a user
GET /api/user Get current user
GET /api/profiles/:username/ Get user profile
PUT /api/profiles/:username/ Update profile
POST /api/profiles/:username/follow/ Follow user
DELETE /api/profiles/:username/unfollow/ Unfollow user
POST /api/articles/ Create article
GET /api/articles/ List articles
GET /api/articles/:slug/ Get article
PUT /api/articles/:slug/ Update article
DELETE /api/articles/:slug/ Delete article
POST /api/articles/:slug/comments/ Add comments to an article
GET /api/articles/:slug/comments/ Get comments from an article
DELETE /api/articles/:slug/comments/:id/ Delete comment
POST /api/articles/:slug/favorite/ Favourite articles
DELETE /api/articles/:slug/favorite/ Unfavourite articles
GET /api/articles/favourites/ List favourated articles
POST /api/articles/:slug/like/ Like articles
PUT /api/articles/:slug/like/ Unlike articles
PUT /api/articles/:slug/rate_article/ Rate aricle

Deployment site

Heroku

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.6%
  • Shell 0.4%