-
Notifications
You must be signed in to change notification settings - Fork 2
Building the project
The following steps will let you build the project locally:
First of all clone the repository using the following the command:
$ git clone git@github.com:QEDK/clarity.git
$ cd clarity
Once you have cloned the repository, ensure you have python3
and node
installed in your local machine:
$ python3 --version
$ Python 3.8.5 # or similar
$ node --version
$ v13.6.0 # or similar
$ npm --version
$ 6.13.4 # or similar
If you are not getting similar output, you can follow the official Python and Node documentation.
Now we will run the frontend and backend of the project as separate entitites.
First, move into the frontend directory then install all dependencies to start the React server.
$ cd clarity/frontend
$ npm install
$ npm start
The server will start running at http://localhost:3000
Install postgresql and create a database named fastapidbname
with the user name postgres
and give your desired password
You can change the following line in backend/main.py
with your password.
db_password = urllib.parse.quote_plus(str(os.environ.get("db_password", "<enter your password here>")))
If you want to create the database with your own creadentials, edit the following line in backend/main.py
db_name = os.environ.get("db_name", "<enter your database name>")
db_username = urllib.parse.quote_plus(str(os.environ.get("db_username", "<enter your database username>")))
db_password = urllib.parse.quote_plus(str(os.environ.get("db_password", "<enter your database password>")))
In a new terminal we will run the fastAPI server. Before that create a virtual environment and install all the requirements.
$ cd clarity
$ python3 -m venv env
$ source env/bin/activate
$ cd backend
$ pip install -r requirements.txt
$ uvicorn main:app --reload
The server will start running at http://localhost:8000 For testing the REST API with swagger UI open http://localhost:8000/docs in your browser
Copyright (C) 2020 Ajitesh Panda, Ankit Maity Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".