{"id":17071593,"url":"https://github.com/rikukissa/sql-exercises","last_synced_at":"2026-04-10T01:58:40.402Z","repository":{"id":151622619,"uuid":"83605661","full_name":"rikukissa/sql-exercises","owner":"rikukissa","description":"Java app for creating SQL exercises","archived":false,"fork":false,"pushed_at":"2017-05-09T20:16:21.000Z","size":1999,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T11:29:02.844Z","etag":null,"topics":["java","java-8","react","spark","sql"],"latest_commit_sha":null,"homepage":"https://rikukissa.github.io/sql-exercises/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rikukissa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-01T21:54:51.000Z","updated_at":"2017-05-07T22:21:46.000Z","dependencies_parsed_at":"2023-05-25T02:00:35.960Z","dependency_job_id":null,"html_url":"https://github.com/rikukissa/sql-exercises","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/rikukissa/sql-exercises","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikukissa%2Fsql-exercises","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikukissa%2Fsql-exercises/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikukissa%2Fsql-exercises/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikukissa%2Fsql-exercises/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rikukissa","download_url":"https://codeload.github.com/rikukissa/sql-exercises/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikukissa%2Fsql-exercises/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002103,"owners_count":26083307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","java-8","react","spark","sql"],"created_at":"2024-10-14T11:37:01.964Z","updated_at":"2025-10-09T22:39:38.471Z","avatar_url":"https://github.com/rikukissa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQL Exercises\n\n## Installation\n\n**Prerequirements:**\n\nInstall Java 8 JDK, PostgreSQL, [Maven](https://maven.apache.org/), [Node.js](https://nodejs.org/en/) and [Yarn](https://yarnpkg.com/en/docs/install).\nMake sure you are able to run `node`, `yarn` and `npm` commands from the command line.\n\n\n**Database**\n\n```\nCREATE USER exercises WITH PASSWORD \"super_secret_database_password\";\nCREATE DATABASE exercises;\nGRANT ALL PRIVILEGES ON DATABASE \"exercises\" to exercises;\nGRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO exercises;\nGRANT ALL PRIVILEGES ON ALL SEQUENCES in schema public to exercises;\n```\n\n**Installation \u0026 running the app:**\n\n1. Clone this repository\n2. Run `mvn clean install` to install dependencies\n3. Run `mvn exec:java -Dexec.mainClass=\"Main\"` to start the app\n4. Start the client by going into frontend directory and running `yarn install \u0026\u0026 npm start`\n\n\n### Building a release version\n\n1. Run `yarn build:jar` in `client` directory\n\nThis builds the frontend assets and copies them under `src/main/resources/build`.\nAfter this the client can be accessed through the running API's root path e.g. `http://localhost:4567/`.\n\n2. Build `.jar` file by running `mvn assembly:assembly`. `target/` directory should now contain a file named `sql-exercises.jar`\n\n3. The jar can be run with `java -jar target/sql-exercises.jar`\nFollowing optional environment parameters can be used to override the default database connection url, user and password\n\n```\nJDBC_DATABASE_URL=jdbc:postgresql://localhost:5432/exercises\nJDBC_DATABASE_USERNAME=exercises\nJDBC_DATABASE_PASSWORD=super_secret_database_password\n```\n\n### Test users\n\nInitial database seed contains the following users\n* **Opettaja**\n  * student number: 12345\n  * role: teacher\n\n* **Admin**\n  * student number: 00000\n  * role: admin\n\n* **Juha Sipilä**\n  * student number: 0001\n  * role: student\n\n* **Alexander Stubb**\n  * student number: 0002\n  * role: student\n\n* **Timo Soini**\n  * student number: 0003\n  * role: student\n\n\n## API endspoints\n\n### Users\n##### Create a new user\n`POST /users`\n##### List all users\n`GET /users`\n\n##### Get specific user\n`GET /users/:id`\n\n##### Get currently logged in user\n`GET /users/me`\n\n##### Login\n`POST /login`\n\n**Example body**:\n```\n{\n  \"studentNumber\": \"123456\"\n}\n```\n\n**Example response**:\n\n```\n{\n  \"token\": \"eyJhbGciOiJIUzI1NiIsInN0dWRlbnROdW1iZXIiOiI5NjQxMiJ9.e30.5tek_58eNqJDDowNsq3RsyUUySWaBC_dfeGeSsK9wi8\"\n}\n```\n\nAfter this you can use this token to access restricted routes by including it to your request headers\n\n```\nAuthorization: \"eyJhbGciOiJIUzI1NiIsInN0dWRlbnROdW1iZXIiOiI5NjQxMiJ9.e30.5tek_58eNqJDDowNsq3RsyUUySWaBC_dfeGeSsK9wi8\"\n```\n\n### Sessions\n##### Create session\n`POST /sessions`\n\n##### Find specific session\n`GET /sessions/:id`\n\n### Exercises\n##### Create new exercise\n`POST /exercises`\n\n##### List all exercises\n`GET /exercises`\n\n##### Get specific exercise\n`GET /exercises/:id`\n\n### Exercise lists\n\n##### Create new exercise list\n`POST /exercise-lists`\n\n##### List all exercise lists\n`GET /exercise-lists`\n\n##### Get specific exercise list\n`GET /exercise-lists/:id`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frikukissa%2Fsql-exercises","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frikukissa%2Fsql-exercises","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frikukissa%2Fsql-exercises/lists"}