Simple to do app with implementation of a backend and a frontend to make it more dynamic. A microservices-based backend built with the Django REST framework, connected to a frontend developed with React.
-
API endpoints
-
User Register endpoint
POST http://localhost:8000/api/register/ HTTP/1.1
content-type: application/json
{
"first_name": "",
"last_name": "",
"username": "",
"email": "",
"password": "",
"password2": ""
}
- User Login endpoint
POST http://localhost:8000/api/login/ HTTP/1.1
content-type: application/json
{
"username": "",
"password": ""
}
- User Logout endpoint
POST http://localhost:8000/api/logout/ HTTP/1.1
Authorization: Token --valid token--
content-type: application/json
- User GetUserInfo endpoint
POST http://localhost:8000/api/getuserinfo/ HTTP/1.1
Authorization: Token --valid token--
content-type: application/json
- User ProfileUpdate endpoint
POST http://localhost:8000/api/profileupdate/ HTTP/1.1
Authorization: Token --valid token--
content-type: application/json
{
"first_name": "",
"last_name": "",
"username": "",
"email": "",
"password": ""
}
- Next, navigate into the directory:
cd interlude-web-app
cd back-end
- Now install Pipenv using pip:
pip install pipenv
- And activate a new virtual environment:
pipenv shell
- Install Django using Pipenv:
pipenv install django djangorestframework django-cors-headers
- Run migrations:
python manage.py migrate
- And start up the server:
python manage.py runserver
Navigate to http://localhost:8000 in your web browser.