It is an API to manage the customer's relationship which purchases any service from a company. The sales team can create a contract for the customer and assign the required service/s to the contract. And support team can contact the customer to provide support related to that service. Meanwhile, management can control the functioning of all employees.
- Download postgreSQL from https://www.postgresql.org/download/ .
- Setup postgres Database by using psql command line.
- Get the Database Credentials.
- Create a
.envfile in the project folder.
DEBUG=True
DB_NAME=crm
DB_USER=postgres
DB_PASSWORD=password
DB_HOST=localhost
DB_PORT=5432
SECRET=<Your Secret>
Note : If no Database credentials are supplied db.sqlite3 will be used.
DEBUG=True
SECRET=<Your Secret>
- Use
pip install -r requirements.txtto install all the dependency for the project. - Migrate the database by
python manage.py migrate - Create Super User for the project using
python manage.py createsuperuser
- Use
python manage.py collectstaticto collect all the static files. - Change the ALLOWED_HOSTS in
settings.py. - Set DEBUG=FALSE in
.env. - Set CORS_ORIGIN_WHITELIST in
settings.py.
Note : For now CORS_ORIGIN_ALLOW_ALL is set to True.
-
/api/v1/auth/register- Allowed Methods :
POST Authorisation:Bearer <token>- Only superuser or management can create new users.
- Only this API can be used to register new user no other endpoint will work or management and superuser can create new user using Admin Panel.
Note : Only user having is_management or is_superuser True will be allowed to use this to register user
- Allowed Methods :
-
/api/v1/auth/login- Allowed Methods :
POST - To login each kind of user same login endpoint can be used.
- fields:
username, password
- Allowed Methods :
-
/api/v1/auth/user- Allowed Methods :
GET Authorisation:Bearer <token>- To get the user info.
- Allowed Methods :
-
/api/v1/manage/user/- Allowed Methods :
GET, PUT, PATCH, DELETE Authorisation:Bearer <token>- To manage User details by management.
- Allowed Methods :
-
/api/v1/auth/user/changepassword- Allowed Methods :
POST Authorisation:Bearer <token>- To change user password if logged in (have token).
- Allowed Methods :
-
/api/v1/manage/client/- Allowed Methods :
GET Authorisation:Bearer <token>- Permissions :
Management Team Member - To get all the client details by management.
- Allowed Methods :
-
/api/v1/manage/client/{id}/- Allowed Methods :
GET, PUT, PATCH, DELETE Authorisation:Bearer <token>- Permissions :
Management Team Member - To manage the client details by management.
- Allowed Methods :
-
/api/v1/client/- Allowed Methods :
GET, POST Authorisation:Bearer <token>- Permissions :
Sales Team Member - To create client by sales team member.
- To get details of all the clients
- Allowed Methods :
-
/api/v1/client/{id}- Allowed Methods :
GET, POST, PUT, PATCH, DELETE Authorisation:Bearer <token>- Permissions :
Sales Team Member - To edit client details.
- To get details of a particular client.
- To delete client details.
- Allowed Methods :
-
/api/v1/manage/contract/- Allowed Methods :
GET Authorisation:Bearer <token>- Permissions :
Management Team Member - To get all the contract details by management.
- Allowed Methods :
-
/api/v1/manage/contract/{id}/- Allowed Methods :
GET, PUT, PATCH, DELETE Authorisation:Bearer <token>- Permissions :
Management Team Member - To manage the contract details by management.
- Allowed Methods :
-
/api/v1/contract/- Allowed Methods :
GET, POST Authorisation:Bearer <token>- Permissions :
Sales Team Member - To create contract by sales team member.
- To get details of all the contracts.
- Allowed Methods :
-
/api/v1/contract/{id}- Allowed Methods :
GET, POST, PUT, PATCH, DELETE Authorisation:Bearer <token>- Permissions :
Sales Team Member - To edit contract details.
- To get details of a particular contract.
- To delete contract details.
- Allowed Methods :
-
/api/v1/manage/service/- Allowed Methods :
GET Authorisation:Bearer <token>- Permissions :
Management Team Member - To get all the services details by management.
- Allowed Methods :
-
/api/v1/manage/service/{id}/- Allowed Methods :
GET, PUT, PATCH, DELETE Authorisation:Bearer <token>- Permissions :
Management Team Member - To manage the service details by management.
- Allowed Methods :
-
/api/v1/service/- Allowed Methods :
GET, POST Authorisation:Bearer <token>- Permissions :
Sales Team Member - To create contract by sales team member.
- To get details of all the services.
- Allowed Methods :
-
/api/v1/service/{id}- Allowed Methods :
GET, POST, PUT, PATCH, DELETE Authorisation:Bearer <token>- Permissions :
Sales Team Member - To edit service details.
- To get details of a particular service.
- To delete service details.
- Allowed Methods :
-
/api/v1/support/service/- Allowed Methods :
GET Authorisation:Bearer <token>- Permissions :
Support Team Member - To get details of all service assigned to them.
- Allowed Methods :
-
/api/v1/support/service/{id}/- Allowed Methods :
GET, PUT, PATCH, DELETE Authorisation:Bearer <token>- Permissions :
Support Team Member - To edit service details assigned to them.
- To get details of a particular service assigned to them.
- To delete service details assigned to them.
- Allowed Methods :