Java 17 //Setting PATH and JAVA_HOME is needed
MSQL SERVER //We recommend the developer version, default settings
You will need to install maven and makefile, for this we reccomend the chocolatey packet manager for windows
Open cmd with Admin privileges and install chocolatey:
winget install Chocolatey.Chocolatey
Restart the cmd and install make and maven:
choco install maven
choco install make
Enable TCP/IP connection with the database:
- Open SQL server configuration manager
- Choose SQL Native Client configuration from the leftside menu
- Choose Client Protocols
- Enable TCP/IP option
In order to run frontend
- Download flutter SDK zip from: https://docs.flutter.dev/get-started/install/windows/mobile?tab=download
- Extract files. Important: developers suggest that you should consider
C:\users\{username}orC:\Users\{username}\AppData\Localpaths. You shouldn't install flutter inside a path that (1) contains special characters or spaces or inside path (2) that requires elevated privileges or when your path meets both of these conditions - Update your environment variable PATH by adding (unzip directory)\flutter\bin folder
- Install dart & flutter plugins in Android Studio, then restard IDE
- Open project 'Lezaczek/frontend' via Android Studio. Important: if Lezaczek will be opened instead of Lezaczek/frontend, errors with pubspec.yaml file and directories will occur
- Dart SDK is not configured will pop up - click Open Dart settings and enter following configuration:
- Enable Dart support for project 'frontend'
- Dart SDK path: (flutter directory)\flutter\bin\cache\dart-sdk
- Enable Dart support for the following modules: Project 'frontend'
- Click apply & ok
- Warning about pub get dependencies will pop up - click get dependencies (alternatively: open terminal and enter dart pub get). If there's still problem, try with upgrade dependencies (or dart pub upgrade)
In case you haven't created any emulators:
- Open Tools -> Device Manager and click Add a new device...
- Enter your configuration including device model, amount of RAM memory etc.
- Close the wizard Enable port forwarding for connection of the emulated device with the backend:
- In the emulator open chrome browser, type in the localhost:8080/api/v1/hello. Until you can see the greetings message it is not set up.
- Open Chrome or other chromium based browser on your computer. Type in the "//inspect/:devices#devices"
- Open the "Configure..." button on the site next to "discover network targets" which should be checked.
- Add "localhost:5554" and "localhost:5555" to the list and enable port forwarding at the bottom of the box.
- Try to refresh the page on the emulator, if you don't see the greetings message there is something wrong If your emulator is already set up:
- Run the device. It will be automatically selected as the device that can run 'main.dart' configuration
- Run 'main.dart' configuration. After a while, the application will start. Important: if you're experiencing troubles with starting virtual device, edit its configuration by switching Emulated Performance -> Graphics to Software. If it didn't make any difference, switch to Hardware
Open the repository database folder, choose the lezaczek.sql file Open this file in microsoft sql server managment studio and execute the querry
To connect backend to the database, export these Environment variables with correct values:
- SQL_SERVER_TESTS (in format jdbc:sqlserver://(hostname);databaseName=(name);)
- TEST_USER
- TESTER_PASS
- JWT_SECRET
Alternatively you can edit application.test.test.properties file in backend/src/main/resources
If these are correctly set you should be able to run this command in the cmd in backend folder
make run-test-build-windows
GET /api/v1/hello
Used to verify if http server is running. Returns "Greetings from Spring Boot!"
POST /api/v1/auth/login
Used to login the user. Accepts JSON in format {email:String, password:String}.
Returns {response:"ok", refreshToken:String, accessToken:String} or {response:"error", errorReason:String}
Sends Cookies accessToken (httpOnly, Secure, path:"/") and refreshToken (httpOnly, Secure, path:"/api/v1/auth/refresh")
PUT /api/v1/auth/register
Used to register the user. Accepts JSON in format {email:String, name:String, surname: String, password: String, gender: [0-2]}.
Returns {response: "ok"} or {response: "error", errorReason:String}
POST /api/v1/auth/refresh
Used to refresh the users authToken. Accepts Cookie authToken or Cookie refreshToken.
Returns new accessToken cookie and JSON {response:"ok",accessToken:String} or {response:"error", errorReason:String}, without the cookie
GET /api/v1/events/{id}
Used to get event data (by the user that created it). Accepts Cookie authToken or Cookie refreshToken.
GET /api/v1/events/date/{YYYY-MM-DD}
Used to get all events on a selected date (by the user that created them). Accepts Cookie authToken or Cookie refreshToken.
PUT /api/v1/events/
Used for adding events. Accepts Cookie authToken or Cookie refreshToken. Accepts JSON in format {"eventId": int, "userID": int, "name": String,"description": String,
"place": String,"eventType": String,"dateStart": Date(YYYY-MM-DD),"dateEnd": Date(YYYY-MM-DD),"startingTime": Time(HH:MM:SS),"endingTime": Time(HH:MM:SS)}
Returns {response: "ok"} or {response: "error", errorReason:String}
POST /api/v1/events/
Used for updating events. Accepts Cookie authToken or Cookie refreshToken. Accepts JSON in format {"eventId": int, "userID": int, "name": String,"description": String,
"place": String,"eventType": String,"dateStart": Date(YYYY-MM-DD),"dateEnd": Date(YYYY-MM-DD),"startingTime": Time(HH:MM:SS),"endingTime": Time(HH:MM:SS)}
Returns {response: "ok"} or {response: "error", errorReason:String}
DELETE /api/v1/events/{id}
Used to delete event (by the user that created it). Accepts Cookie authToken or Cookie refreshToken.
Returns {response: "ok"} or {response: "error", errorReason:String}