- We want you to implement some REST APIs by using any languages and frameworks.
- You can see the specification of APIs in spec directory.
- These specs are written with api-first-spec, and has some API tests.
- Your goal is to develop a web application which be able to pass all these tests.
This test requires
- Some web application framework
- MySQL database
- GitHub account(To fork this repository.)
Fork this repository to your GitHub account at first. And then, develop an application by yourself.
Database structure and sample data are written in sql/create.sql.
Build your own mysql server and run this script.
If you want to build it automatically, you can use our test env builder
You can set up an environment with following commands.
git clone [email protected]:code-check/env-builder.git test-env
cd test-env
cp Vagrantfile.sample Vagrantfile
cp hosts.sample hosts
vagrant up
ansible-playbook all.yml
vagrant ssh
git clone [email protected]:[YOUR GITHUB ACCOUNT]/sample-test.git
mysql -uvagrant -pvagrant -Dvagrant < sample-test/sql/create.sql
cd sample-test
And then, implement the app and push to your REPO.
api-first-spec uses Mocha test framework.
You can run all tests with following commands.
cd sample-test
npm install
mocha spec/*
Of course you can try running a single test.
mocha spec/users_login.js
As default, application settings are defined in spec/config/config.json.
You can edit it easy to use.
This app is simple event reserve system.
- It has two kind of users.
- student
- company
- All users can see every event list. (include none logged-in user)
- The student can reserve and unreserve the event.
- The company can see their own event list.
- Login with email and password
- Its response is login token and user data
- group_id = 1 is student user.
- group_id = 2 is company user.
- Login is not required
- "from" parameter is required.
- It specify the date list start from.
- "offset" and "limit" parameter are option.
- Login is required.
- The user must be student.
- Login is required.
- The user must be company.
- The event information includes the number of attendees.
If you are a manager of this project and you can change the specification of this app, what would you do? Write your opinion to answer.md