- Web-Based tool for admin to manage online courses
- Grape API
- For user to view online courses
- For user to purchase online courses
- For user to view user courses
- ruby 2.6.3
- rails 5.2.3
- postgres
setup .env file (or .env.development), refer to the example file at .env.example
bundle install
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake db:seed
bundle exec yarn install
Just run the rails command to start the server
bundle exec rails s
Then visit http://localhost:3000
bundle exec rspec
POST | /api/:version/authentications/token(.json) | v1 | Authenticate user and retrieve authentication token
GET | /api/:version/courses(.json) | v1 | Return list of courses for sale
GET | /api/:version/courses/:id(.json) | v1 | Return a specific course for sale
POST | /api/:version/courses/purchase(.json) | v1 | Purchase a course and return purchase record
GET | /api/:version/user_courses(.json) | v1 | Return list of user courses
GET | /api/:version/user_courses/:id(.json) | v1 | Return a specific user course
If you use Postman, that's perfert! 👍 Download and import the API collections.
use curl
❗️Assuming that you already signed up with you email❗️
Use you API token for authorization.
Get it with ➡️ POST /api/v1/authentications/token?email={your_email}&password:{your_passord}
You can use test user to try!
email: test_user1@snapask.com
password: secretsecret
You need to add { api_token: your_api_token }
in params for other APIs to authenticate.
- Ya-Rong, Teng - RongRongTeng