Install Vue CLI
npm install -g @vue/cli
Installing dependencies:
npm install
Running the app for development
npm run serve
Building the app for production:
npm run build
Runing unit tests
npm run jest
You may need to install jest to run tests:
npm install -g jest
To setup your environment follow the steps at https://flutter.dev/docs/get-started/install
Run the web application locally as specified above (using the npm run serve
script)
Run the flutter application from your IDE.
To update the HTML displayed in the app, run
./compile_web.sh
(Note - I haven't been able to test it yet)
Then build the application.
If you use windows or can't run the script, you'll want to run in the web directory
npm run build
And copy the contents of web/dist
into mobile/assets/webapp
Base Requirements
Install Django
pip install -r dependencies.txt
To start the backend, navigate to /backend
python manage.py runserver
You can generate an auth token by sending a POST request to: /api/auth
with the following parameters:
{ 'username': 'value', 'password': 'value' }
You can also generate an auth token by sending a POST request to: /api/fb_auth
with the following parameters:
{ 'accessToken': 'value' }
with the value being a facebook access token.
The response will contain an authentification token as well as the user profile:
{
'token': 'value',
'user': { user_instance }
}
Then to make authentificated requests using postman, make sure to include the following header:
Authorization: Token <YOUR_TOKEN>
The token is stored on the frontend's localStorage such as to preserve user sessions.
/api/auth_health
You should see a similar response:
{
"status": "user is authentificated",
"username": "d4c2975740c44f5598ed68c59ed5cf5a"
}
Install Docker here
Install Docker Compose here
./run_db.sh
This will start the docker container, wait until it is initialised and execute model migrations automatically.
You can also do it manually:
docker-compose up -d
-d will let the process run in the background.
docker-compose down
docker-compose down -v
mysql --host=127.0.0.1 --port=8088 -uadmin -pdzalekaxDf0JRN9VTPLI9JyvimB
Or you can also use the container to login:
docker exec -it barter_db mysql -uadmin -pdzalekaxDf0JRN9VTPLI9JyvimB
Note: there also is a root user, its password is set within the .env file.
Sending a GET request to http://localhost:8000/api/worker?username<user>
will return the user profile for the specified username.
Sending a POST request to http://localhost:8000/api/business
with the following body:
{
"business_name": "My Business!", // Name for the business
"working_days": "monday, tuesday, sunday", // A comma separated list of days the business is open
"work_tags": "business tes ", // currently just a text field
"description": "My Business Description", // business description
"contact": "0627111111 or petits@tcd.ie", // text field for contact details
"start_time": 8, // opening time for the business (0 - 24)
"end_time": 20 // closing time for the business (0 - 24)
}
Will register a business for the logged in user.