Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jaay7/placementsbackend

Managing the placements information through this application
https://github.com/jaay7/placementsbackend

aws-ec2 django docker-compose graphene-django graphql jwt mongodb python

Last synced: about 19 hours ago
JSON representation

Managing the placements information through this application

Awesome Lists containing this project

README

        

[![CI/CD Docker - Django](https://github.com/Jaay7/placementsbackend/actions/workflows/main.yml/badge.svg)](https://github.com/Jaay7/placementsbackend/actions/workflows/main.yml)

# Placements Backend

Created using Django, GraphQL, and using MongoDB as database.

## Accessing the application

#### 1. Clone the application.

#### 2. In the root directory create a virtual environment.

```sh
pip install virtualenv
```
```sh
python -m venv venv
```

#### 3. Now install the packages required for our project which are available in requirements.txt

```sh
pip install -r requirements.txt
```

#### 4. Create a .env file
Naviagte to the placementsbackend folder where settings.py is available

Create a .env file
```
MONGODB_URI=
```

#### 5. To run the application

```sh
python manage.py makemigrations
```

```sh
python manage.py migrate
```

```sh
python manage.py runserver
```

#### 6. Testing the application

Open postman application to test our endpoint

http://127.0.0.1:8080/graphql/

Make sure your request is set to POST method.

- Register new user

```
mutation {
registerUser(
email: "",
username: "",
password: "",
fullName: "
) {
user {
id
email
username
fullName
}
token
}
}
```

- Login user

```
mutation {
login(
username: "",
password: ""
) {
token
payload
}
}
```

- Getting the loggedIn user based on token.

In the headers tab give:

KEY as Authorization

VALUES as JWT

Make sure there is space between JWT and token
```
query me {
me {
id
email
username
fullName
}
}
```